jboss throws Unmarshalling error: null calling signature validation web service - java

I send a validation request to a web service of esignature with generated code from the wsdl provided here:
https://ec.europa.eu/cefdigital/DSS/webapp-demo/services/
Wsdl is the SoapDocumentValidationService.
The validation works fine with my tester executing from eclipse and with the validation service runing on an apache-tomcat-8.5.31.
But when I try to run a test from the navigator using a jboss-5.2.0 (with cxf bug solved) to deploy the app, the jboss gives an "Unmarshalling error: null" on the returning xml from the web service, presumably by incompatibility with some library or methods.
The apache doesn't have any errors, and tha validation seems normal there.
pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>pluginsib-validatesignature-esginature</artifactId>
<groupId>org.enterprise.pluginsib.validatesignature</groupId>
<packaging>jar</packaging>
<version>2.0.0</version>
<name>PluginsIB - Validate Signature - ESignature</name>
<parent>
<groupId>org.enterprise.pluginsib.validatesignature</groupId>
<artifactId>pluginsib-validatesignature</artifactId>
<version>2.0.0</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<!-- JBoss dependency versions -->
<version.org.jboss.spec.jboss.javaee.6.0>3.0.0.Final</version.org.jboss.spec.jboss.javaee.6.0>
<cxf.version>2.2.12</cxf.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jboss.spec</groupId>
<artifactId>jboss-javaee-6.0</artifactId>
<version>${version.org.jboss.spec.jboss.javaee.6.0}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<repositories>
<repository>
<id>java.net-m2</id>
<name>java.net - Maven 2</name>
<url>https://repository.jboss.org/nexus/content/repositories/java.net-m2</url>
</repository>
<repository>
<id>maven-nuxeo</id>
<name>Maven Nuxeo Repository</name>
<url>https://maven.nuxeo.org/nexus/content/groups/public/</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</releases>
<snapshots>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
</snapshots>
</repository>
<!-- Requerim GENAPP i PLUGINSIB -->
<repository>
<id>github-governib-maven</id>
<name>GitHub GovernIB Maven Repository</name>
<url>https://governib.github.io/maven/maven/</url>
</repository>
</repositories>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<!--<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<artifact>org.enterprise.genapp:genapp-core</artifact>
<includes>
<include>org/enterprise/genapp/common/i18n/I18N*.*</include>
<include>org/enterprise/genapp/common/ws/Ws*Adapter.*</include>
</includes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>-->
<!--XXX<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/src/main/resources</outputDirectory>
<resources>
<resource>
<directory>${basedir}/../../logic/src/main/resources</directory>
<includes>
<include>logicmissatges_*.properties</include>
<include>genapp_*.properties</include>
<include>portafib_genapp_*.properties</include>
</includes>
<filtering>true</filtering>
</resource>
</resources>
<overwrite>true</overwrite>
</configuration>
</execution>
</executions>
</plugin>-->
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<profiles>
<profile>
<id>regenerateapi</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>regenerateapi</name>
</property>
</activation>
<build>
<plugins>
<!--Java to WSDL Plugin-->
<!--<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-java2ws-plugin</artifactId>
<version>${cxf.version}</version>
<dependencies>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>${cxf.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-simple</artifactId>
<version>${cxf.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>generate-wsdl-esignatureValidation.wsdl</id>
<phase>generate-sources</phase>
<configuration>
<className>eu.europa.esig.dss.validation.SoapDocumentValidationService</className>
<genWsdl>true</genWsdl>
<verbose>true</verbose>
<frontend>jaxws</frontend>
<databinding>jaxb</databinding>
<outputFile>${basedir}/src/main/resources/wsdl/esignatureValidation.wsdl</outputFile>
<argline>-s ${basedir}/code -portname EsignatureValidationWs -address http://localhost:8080/services/soap/validation?wsdl</argline>
</configuration>
<goals>
<goal>java2ws</goal>
</goals>
</execution>
</executions>
</plugin>-->
<!--WSDL to Java Plugin-->
<plugin>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-codegen-plugin</artifactId>
<version>${cxf.version}</version>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<bindingFiles>
<bindingFile>${project.basedir}/bindings/bindings.xjc</bindingFile>
</bindingFiles>
<sourceRoot>${project.basedir}/src/main/java</sourceRoot>
<defaultOptions>
<autoNameResolution>true</autoNameResolution>
</defaultOptions>
<wsdlOptions>
<wsdlOption>
<wsdl>${basedir}/src/main/resources/wsdl/esignatureValidation.wsdl</wsdl>
<packagenames>
<packagename>org.enterprise.pluginsib.validatesignature.esignature.ws</packagename>
</packagenames>
<!--<serviceName>SoapDocumentValidationService</serviceName>-->
</wsdlOption>
</wsdlOptions>
</configuration>
<goals>
<goal>wsdl2java</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>3.1.1</version>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<outputDirectory>${project.build.directory}/alternateLocation</outputDirectory>
<overWriteReleases>false</overWriteReleases>
<overWriteSnapshots>false</overWriteSnapshots>
<overWriteIfNewer>true</overWriteIfNewer>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>org.jboss.ws.cxf</groupId>
<artifactId>jbossws-cxf-client</artifactId>
<version>4.1.1.Final</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.2</version>
<scope>test</scope>
</dependency>
<!--<dependency>
<groupId>eu.europa.ec.joinup.sd-dss</groupId>
<version>5.3.1</version>
<artifactId>dss-validation-soap-client</artifactId>
</dependency>-->
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mailapi</artifactId>
<version>1.4.3</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk16</artifactId>
<version>1.46</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcmail-jdk16</artifactId>
<version>1.46</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bctsp-jdk16</artifactId>
<version>1.46</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.java.xades</groupId>
<artifactId>jxades</artifactId>
<version>0.1.5</version>
</dependency>
<dependency>
<groupId>org.enterprise.pluginsib.validatesignature</groupId>
<artifactId>pluginsib-validatesignature-api</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>
</project>
The error on the jboss:
13:16:17,167 INFO [STDOUT] DefaultValidationEventHandler: [ERROR]: null
Location: line 1
13:16:17,171 WARNING [PhaseInterceptorChain] Interceptor for {http://validation.dss.esig.europa.eu/}SoapDocumentValidationServiceImplService#{http://validation.dss.esig.europa.eu/}validateSignature has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Unmarshalling Error: null
at
****(A lot of trash)****
org.enterprise.pluginsib.validatesignature.esignature.ESignatureValidateSignaturePlugin.validateSignature(ESignatureValidateSignaturePlugin.java:231)
at org.enterprise.plugins.validatesignature.tester.ejb.ValidateSignatureEjb.validate(ValidateSignatureEjb.java:61)
The fragment of the construction of the data and the validation request:
SoapDocumentValidationService validationService;
{
SoapDocumentValidationServiceImplService service;
URL wsdl = new URL(endpoint + "?wsdl");
service = new SoapDocumentValidationServiceImplService(wsdl);
validationService = service.getSoapDocumentValidationServiceImplPort();
Map<String, Object> reqContext;
reqContext = ((BindingProvider) validationService).getRequestContext();
reqContext.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, endpoint);
}
//Declaration of REMOTEDOCUMENT
RemoteDocument remSign = new RemoteDocument();
RemoteDocument doc = null;
byte[] sigData = validationRequest.getSignatureData();
//Signature
if (sigData != null) {
remSign.setBytes(sigData);
remSign.setDigestAlgorithm(null);
remSign.setMimeType(getMimeType(sigData));
remSign.setName(null);
//Signed document
byte[] docData = validationRequest.getSignedDocumentData();
if (docData != null) {
doc = new RemoteDocument();
doc.setBytes(docData);
doc.setDigestAlgorithm(null);
doc.setMimeType(getMimeType(docData));
doc.setName(null);
}
}
//Final object to validate "DataToValidate"
org.enterprise.pluginsib.validatesignature.esignature.ws.DataToValidateDTO dataToValidateDTO = new DataToValidateDTO();
dataToValidateDTO.setSignedDocument(remSign);
dataToValidateDTO.setOriginalDocument(doc);
dataToValidateDTO.setPolicy(null);
//Validacio del document
org.enterprise.pluginsib.validatesignature.esignature.ws.WsReportsDTO signatureReport;
ValidateSignatureResponse validateSignatureResponse = new ValidateSignatureResponse();
Notice that this app HAS to be deployed on a jboss-5.2.0, and that the plugin that generates the code from the wsdl it's the one just below the coment:
"WSDL to Java Plugin" in the pom.xml
I am suspecting about a bug or incompaibility with jboss, or a problem with generation of the code that autmatically assigns names to classes with the same name, but I am not sure and don't know how to solve it either if it's the case.
*If someone wants the full trace of the jboss ask in the coments, the size exceeds the max number of characters allowed here. And sorry for my english.

Related

gwt maven plugin deploy to standalone tomcat not loading

I'm using the latest gwt maven plugin (https://tbroyer.github.io/gwt-maven-plugin/index.html) to compile a multi module GWT project and deploy it to tomcat 9. I am also using intellij 14 as my IDE. It's a client app only ie. no server/servlet. When I build via the IDE gwt plugin and zip up and deploy that output to tomcat my app works fine.
However, using the maven plugin, everything compiles ok and the contents of the war look fine to me. The war deploys ok to tomcat, but I simply see a blank page when I try to load it on my browser (latest chrome edition).
I'm running dev tools and jscript console and there are no errors being reported, network view, shows the content downloading ok. I've set break points in my nocache js files and stepped through it with no problems. Below is my pom. I'd appreciated any insight / help with this as it's been bugging me for days..
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>guml-ui</artifactId>
<groupId>guml-ui</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dashboard</artifactId>
<!--<packaging>gwt-app</packaging>-->
<dependencies>
<dependency>
<groupId>guml-ui</groupId>
<artifactId>myworkspace</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>guml-ui</groupId>
<artifactId>project</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>guml-ui</groupId>
<artifactId>common</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/java/au/com/guml/ui/components/dashboard/public</directory>
</resource>
<resource>
<directory>war</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.0-rc-9</version>
<extensions>true</extensions>
<configuration>
<moduleName>au.com.guml.ui.components.dashboard.Dashboard</moduleName>
<moduleShortName>Dashboard</moduleShortName>
<warDir>${basedir}/../gumlui-war/target/gumlui-war-${project.version}</warDir>
<devmodeWorkDir>${basedir}/../gumlui-war/target/gumlui-war-${project.version}</devmodeWorkDir>
<webappDirectory>${basedir}/../gumlui-war/target/gumlui-war-${project.version}</webappDirectory>
<skipModule>true</skipModule>
<draftCompile>true</draftCompile>
<startupUrls>Dashboard.html</startupUrls>
</configuration>
<executions>
<execution>
<id>compile-module-common</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<moduleName>au.com.guml.ui.components.common.Common</moduleName>
<moduleShortName>Common</moduleShortName>
</configuration>
</execution>
<execution>
<id>compile-module-myworkspace</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<moduleName>au.com.guml.ui.components.myworkspace.MyWorkspace</moduleName>
<moduleShortName>MyWorkspace</moduleShortName>
</configuration>
</execution>
<execution>
<id>compile-module-project</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<moduleName>au.com.guml.ui.components.project.Project</moduleName>
<moduleShortName>Project</moduleShortName>
</configuration>
</execution>
<execution>
<id>compile-module-dashboard</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<moduleName>au.com.guml.ui.components.dashboard.Dashboard</moduleName>
<moduleShortName>Dashboard</moduleShortName>
</configuration>
</execution>
</executions>
</plugin>
<!-- copy the host html page -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>copy-hosthtml</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/../gumlui-war/target/gumlui-war-${project.version}</outputDirectory>
<resources>
<resource>
<directory>war</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-public</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/../gumlui-war/target/gumlui-war-${project.version}/Dashboard</outputDirectory>
<resources>
<resource>
<directory>src/main/java/au/com/guml/ui/components/dashboard/public</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
Cheers,
Matt.
For anyone that is interested I got the maven build working on the multi module gwt project. See the following pom (dashboard) which is my app which inherits other modules.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>guml-ui</artifactId>
<groupId>guml-ui</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>dashboard</artifactId>
<!--<packaging>gwt-app</packaging>-->
<dependencies>
<dependency>
<groupId>guml-ui</groupId>
<artifactId>myworkspace</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>guml-ui</groupId>
<artifactId>project</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>guml-ui</groupId>
<artifactId>common</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>4.1.0.Final</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator-sources</artifactId>
<version>4.1.0.Final</version>
<scope>system</scope>
<systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/hibernate-validator-4.1.0.Final-sources.jar</systemPath>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.1</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/java/au/com/guml/ui/components/dashboard/public</directory>
</resource>
<resource>
<directory>src/main/java</directory>
</resource>
</resources>
<plugins>
<plugin>
<groupId>net.ltgt.gwt.maven</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>1.0-rc-9</version>
<extensions>true</extensions>
<configuration>
<moduleName>au.com.guml.ui.components.dashboard.Dashboard</moduleName>
<moduleShortName>Dashboard</moduleShortName>
<warDir>${basedir}/../gumlui-war/target/gumlui</warDir>
<devmodeWorkDir>${basedir}/../gumlui-war/target/gumlui</devmodeWorkDir>
<webappDirectory>${basedir}/../gumlui-war/target/gumlui</webappDirectory>
<skipModule>true</skipModule>
<startupUrls>Dashboard.html</startupUrls>
<!--<style>PRETTY</style>-->
</configuration>
<executions>
<execution>
<id>compile-module-common</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<moduleName>au.com.guml.ui.components.common.Common</moduleName>
<moduleShortName>Common</moduleShortName>
</configuration>
</execution>
<execution>
<id>compile-module-myworkspace</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<moduleName>au.com.guml.ui.components.myworkspace.MyWorkspace</moduleName>
<moduleShortName>MyWorkspace</moduleShortName>
</configuration>
</execution>
<execution>
<id>compile-module-project</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<moduleName>au.com.guml.ui.components.project.Project</moduleName>
<moduleShortName>Project</moduleShortName>
</configuration>
</execution>
<execution>
<id>compile-module-dashboard</id>
<goals>
<goal>compile</goal>
</goals>
<configuration>
<moduleName>au.com.guml.ui.components.dashboard.Dashboard</moduleName>
<moduleShortName>Dashboard</moduleShortName>
</configuration>
</execution>
</executions>
</plugin>
<!-- copy the host html page -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<executions>
<execution>
<id>copy-public</id>
<phase>prepare-package</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/../gumlui-war/target/gumlui/Dashboard</outputDirectory>
<resources>
<resource>
<directory>src/main/java/au/com/guml/ui/components/dashboard/public</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
I have to include the build resources entries on this pom and my inherited projects to manually include the public directory, not sure why, this appears to a quirk with the plugin.

Images not exported to executable jar file

I'm modifying Weka, an open-source Maven project, and my modifications are running perfectly on eclipse. However, when I export to an executable jar file, I get a null pointer exception, because it's not able to find the images I created and added to the project upon getImage() calls.
It seems that this is a rather common problem with jar files, so I tried using the URL method to load, but upon further investigation, when I look into the jar file with SecureZIP, the images(.png) that I added to the project are not even in the jar (however, the images (.png) that were in the original open source distribution were, despite the fact that all the images were in the same folder and of the same type (.png) designated by the build path in the source). Is there something I'm forgetting to do? Why are my images not exporting to the jar, but the other images in the folder are?
Library Handling is: "Extract required libraries into generated JAR".
Images are in src/main/java/weka/gui.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>nz.ac.waikato.cms.weka</groupId>
<artifactId>weka-stable</artifactId>
<version>3.8.1-SNAPSHOT</version>
<!-- weka-version -->
<packaging>jar</packaging>
<name>weka-stable</name>
<description>The Waikato Environment for Knowledge Analysis (WEKA), a machine learning workbench. This is the stable version. Apart from bugfixes, this version does not receive any other updates.
</description>
<url>http://www.cms.waikato.ac.nz/ml/weka/</url>
<organization>
<name>University of Waikato, Hamilton, NZ</name>
<url>http://www.waikato.ac.nz/</url>
</organization>
<licenses>
<license>
<name>GNU General Public License 3</name>
<url>http://www.gnu.org/licenses/gpl-3.0.txt</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<id>wekateam</id>
<name>The WEKA Team</name>
<email>wekalist#list.waikato.ac.nz</email>
</developer>
</developers>
<mailingLists>
<mailingList>
<name>wekalist</name>
<subscribe>https://list.waikato.ac.nz/mailman/listinfo/wekalist</subscribe>
<unsubscribe>https://list.waikato.ac.nz/mailman/listinfo/wekalist</unsubscribe>
<archive>https://list.waikato.ac.nz/mailman/htdig/wekalist/</archive>
</mailingList>
</mailingLists>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>
<scm>
<connection>scm:svn:https://svn.cms.waikato.ac.nz/svn/weka/branches/stable-3-8/weka</connection>
<developerConnection>scm:svn:https://svn.cms.waikato.ac.nz/svn/weka/branches/stable-3-8/weka</developerConnection>
<url>https://svn.cms.waikato.ac.nz/svn/weka/branches/stable-3-8/weka</url>
</scm>
<profiles>
<profile>
<id>release-sign-artifacts</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.1</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<profile>
<!-- used for skipping tests -->
<id>no-tests</id>
<properties>
<skipTests>true</skipTests>
</properties>
</profile>
</profiles>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>nz.ac.waikato.cms.weka.thirdparty</groupId>
<artifactId>java-cup-11b</artifactId>
<version>2015.03.26</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>nz.ac.waikato.cms.weka.thirdparty</groupId>
<artifactId>java-cup-11b-runtime</artifactId>
<version>2015.03.26</version>
</dependency>
<dependency>
<groupId>nz.ac.waikato.cms.weka.thirdparty</groupId>
<artifactId>bounce</artifactId>
<version>0.18</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.10</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.googlecode.matrix-toolkits-java</groupId>
<artifactId>mtj</artifactId>
<version>1.0.4</version>
</dependency>
<dependency>
<groupId>net.sourceforge.f2j</groupId>
<artifactId>arpack_combined_all</artifactId>
<version>0.1</version>
</dependency>
<dependency>
<groupId>com.googlecode.netlib-java</groupId>
<artifactId>netlib-java</artifactId>
<version>1.1</version>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<weka.main.class>weka.gui.GUIChooser</weka.main.class>
</properties>
<build>
<directory>dist</directory>
<outputDirectory>build/classes</outputDirectory>
<testOutputDirectory>build/testcases</testOutputDirectory>
<resources>
<resource>
<targetPath>${project.build.outputDirectory}</targetPath>
<directory>${project.build.sourceDirectory}</directory>
<includes>
<include>**/*.arff</include>
<include>**/*.cost</include>
<include>**/*.cup</include>
<include>**/*.default</include>
<include>**/*.excludes</include>
<include>**/*.flex</include>
<include>**/*.gif</include>
<include>**/*.icns</include>
<include>**/*.ico</include>
<include>**/*.jflex</include>
<include>**/*.jpeg</include>
<include>**/*.jpg</include>
<include>**/*.kfml</include>
<include>**/*.matrix</include>
<include>**/*.png</include>
<include>**/*.properties</include>
<include>**/*.props</include>
<include>**/*.txt</include>
<include>**/*.xml</include>
<include>**/DatabaseUtils.props.*</include>
<include>weka/gui/beans/README</include>
</includes>
</resource>
<resource>
<targetPath>${project.build.testOutputDirectory}</targetPath>
<directory>${project.build.testSourceDirectory}</directory>
<includes>
<include>**/*.arff</include>
<include>**/*.cost</include>
<include>**/*.cup</include>
<include>**/*.default</include>
<include>**/*.excludes</include>
<include>**/*.flex</include>
<include>**/*.gif</include>
<include>**/*.icns</include>
<include>**/*.ico</include>
<include>**/*.jflex</include>
<include>**/*.jpeg</include>
<include>**/*.jpg</include>
<include>**/*.kfml</include>
<include>**/*.matrix</include>
<include>**/*.png</include>
<include>**/*.properties</include>
<include>**/*.props</include>
<include>**/*.txt</include>
<include>**/*.xml</include>
<include>**/DatabaseUtils.props.*</include>
<include>weka/gui/beans/README</include>
</includes>
</resource>
</resources>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.0.2</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.7.2</version>
<configuration>
<includes>
<include>**/*Test.java</include>
</includes>
<disableXmlReport>true</disableXmlReport>
<redirectTestOutputToFile>true</redirectTestOutputToFile>
<systemPropertyVariables>
<weka.test.Regression.root>src/test/resources/wekarefs</weka.test.Regression.root>
<weka.test.maventest>true</weka.test.maventest>
<user.timezone>Pacific/Auckland</user.timezone>
</systemPropertyVariables>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.1</version>
<configuration>
<tagBase>https://svn.cms.waikato.ac.nz/svn/weka/tags</tagBase>
<useReleaseProfile>false</useReleaseProfile>
<!-- tests are performed with the ant build file, hence skipped here. -->
<preparationGoals>clean verify -P no-tests</preparationGoals>
<goals>deploy -P no-tests</goals>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>2.4.1</version>
<configuration>
<filesets>
<fileset>
<directory>.</directory>
<includes>
<include>**/*~</include>
<include>**/.attach_pid*</include>
<include>**/hs_err_pid*</include>
</includes>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<archive>
<manifest>
<mainClass>${weka.main.class}</mainClass>
</manifest>
</archive>
</configuration>
<executions>
<execution>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<excludeResources>true</excludeResources>
</configuration>
</execution>
<execution>
<id>attach-test-sources</id>
<goals>
<goal>test-jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.8.1</version>
<configuration>
<maxmemory>1000m</maxmemory>
<subpackages>weka:org</subpackages>
<show>public</show>
<outputDirectory>${project.basedir}/doc</outputDirectory>
<!-- when using Java 8, use this setting to avoid overly strict javadoclet -->
<!--additionalparam>-Xdoclint:none</additionalparam-->
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

java.lang.LinkageError or java.lang.NoClassDefFoundError

I'm having some issues in packaging a plugin for the Protégé Desktop ontology editor (v5), which includes both a Reasoner and also some Views and Tabs. In the constructor of the reasoner I need to retrieve the IRI of the active ontology:
MastroReasoner(#Nonnull OWLOntology ontology, #Nonnull MastroConfiguration configuration) throws ReasonerInitializationException {
super(ontology, configuration, BufferingMode.BUFFERING);
this.configuration = configuration;
this.ontology = ontology;
this.ontologyIRI = ontology.getOntologyID().getOntologyIRI().orNull();
initReasoner();
}
where getOntologyIRI() type is Optional<IRI>. Whenever I start the reasoner I have the following error:
11:26:16.547 [Classification Thread] ERROR o.p.e.o.m.i.OWLReasonerManager - An error occurred during reasoning: com/google/common/base/Optional.
java.lang.NoClassDefFoundError: com/google/common/base/Optional
I modified then my pom.xml to embed the dependency inside my bundle, but now I'm having a different error:
11:41:48.221 [Classification Thread] ERROR o.p.e.o.m.i.OWLReasonerManager - An error occurred during reasoning: loader constraint violation: loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) previously initiated loading for a different type with name "com/google/common/base/Optional".
java.lang.LinkageError: loader constraint violation: loader (instance of org/apache/felix/framework/BundleWiringImpl$BundleClassLoaderJava5) previously initiated loading for a different type with name "com/google/common/base/Optional"
I have been searching the above error a lot here on SO and generally on Google, and all the answers I found says that the problem come from the fact that there are possibly 2 JARs providing the same class (within the same package). So how come that If I do not add the JAR I have java.lang.NoClassDefFoundError?
Here is my pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>it.uniroma1.dis.mastro.protege</groupId>
<artifactId>mastro-protege-plugin</artifactId>
<packaging>bundle</packaging>
<version>1.0-SNAPSHOT</version>
<name>Mastro Protégé Plugin</name>
<description>Mastro DL-Lite Reasoner for the Protégé Desktop ontology editor</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<symbolic.name>it.uniroma1.dis.mastro.protege</symbolic.name>
<protege.version>5.0.0</protege.version>
</properties>
<dependencies>
<dependency>
<groupId>edu.stanford.protege</groupId>
<artifactId>protege-editor-owl</artifactId>
<version>5.0.0</version>
</dependency>
<dependency>
<groupId>edu.stanford.protege</groupId>
<artifactId>protege-editor-core</artifactId>
<version>5.0.0</version>
</dependency>
<dependency>
<groupId>edu.stanford.protege</groupId>
<artifactId>protege-common</artifactId>
<version>5.0.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.owlapi</groupId>
<artifactId>owlapi-osgidistribution</artifactId>
<version>4.2.5</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.21</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>18.0</version>
</dependency>
<dependency>
<groupId>it.uniroma1.dis</groupId>
<artifactId>mastro-api</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.fifesoft</groupId>
<artifactId>rsyntaxtextarea</artifactId>
<version>2.5.8</version>
</dependency>
<dependency>
<groupId>com.bulenkov</groupId>
<artifactId>iconloader</artifactId>
<version>1.0</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.0</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.0.1</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-Activator>org.protege.editor.owl.ProtegeOWL</Bundle-Activator>
<Bundle-Category>protege</Bundle-Category>
<Bundle-ClassPath>.</Bundle-ClassPath>
<Bundle-ContactAddress>**********</Bundle-ContactAddress>
<Bundle-Description>${project.description}</Bundle-Description>
<Bundle-DocURL>${project.organization.url}</Bundle-DocURL>
<Bundle-Name>${project.name}</Bundle-Name>
<Bundle-SymbolicName>${symbolic.name};singleton:=true</Bundle-SymbolicName>
<Bundle-Vendor>${project.organization.name}</Bundle-Vendor>
<Bundle-Version>${project.version}</Bundle-Version>
<Import-Package>
javax.swing,
javax.swing.*,
org.osgi.framework,
org.protege.editor.owl,
org.w3c.dom,
org.w3c.dom.bootstrap,
org.w3c.dom.events,
org.w3c.dom.ls,
org.xml.sax,
org.xml.sax.ext,
org.xml.sax.helpers,
javax.xml.parsers
</Import-Package>
<Require-Bundle>
org.eclipse.equinox.registry,
org.eclipse.equinox.common,
org.protege.editor.core.application,
org.protege.editor.owl,
org.semanticweb.owl.owlapi
</Require-Bundle>
<Embed-Dependency>
commons-collections4,
guava,
iconloader,
mastro-api,
rsyntaxtextarea,
</Embed-Dependency>
</instructions>
</configuration>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>install</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>it.uniroma1.dis.mastro.protege</groupId>
<artifactId>mastro-protege-plugin</artifactId>
<version>1.0-SNAPSHOT</version>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${env.PROTEGE_HOME}/plugins/</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
EDIT (11 July 2016)
In order to check whether the problem is caused by one of the libraries I am using I created a new Example plugin with just the reasoner configuration and no library included (so there is no extra JAR that could be including another copy of the com.google.common.base.Optional package.
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>example-protege-plugin</artifactId>
<packaging>bundle</packaging>
<version>1.0-SNAPSHOT</version>
<name>Example Protégé Plugin</name>
<description>Example for the Protégé Desktop ontology editor</description>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<symbolic.name>it.uniroma1.dis.example.protege</symbolic.name>
<protege.version>5.0.0</protege.version>
</properties>
<developers>
<developer>
<name>*********</name>
<email>*********</email>
<organization>${project.organization.name}</organization>
<organizationUrl>${project.organization.url}</organizationUrl>
</developer>
</developers>
<dependencies>
<dependency>
<groupId>edu.stanford.protege</groupId>
<artifactId>protege-editor-owl</artifactId>
<version>5.0.0</version>
</dependency>
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<version>3.0.1</version>
<extensions>true</extensions>
<configuration>
<instructions>
<Bundle-Activator>org.protege.editor.owl.ProtegeOWL</Bundle-Activator>
<Bundle-Category>protege</Bundle-Category>
<Bundle-ClassPath>.</Bundle-ClassPath>
<Bundle-ContactAddress>pantaleone#dis.uniroma1.it</Bundle-ContactAddress>
<Bundle-Name>Example Protege Plugin</Bundle-Name>
<Bundle-SymbolicName>${symbolic.name};singleton:=true</Bundle-SymbolicName>
<Bundle-Vendor>${project.organization.name}</Bundle-Vendor>
<Bundle-Version>${project.version}</Bundle-Version>
<Import-Package>
org.osgi.framework,
org.protege.editor.owl.*;version="5.0.0",
</Import-Package>
<Require-Bundle>
org.eclipse.equinox.registry,
org.eclipse.equinox.common,
org.protege.editor.owl,
org.semanticweb.owl.owlapi
</Require-Bundle>
</instructions>
</configuration>
<executions>
<execution>
<id>bundle-manifest</id>
<phase>install</phase>
<goals>
<goal>manifest</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.10</version>
<executions>
<execution>
<id>copy</id>
<phase>package</phase>
<goals>
<goal>copy</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.version}</version>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${env.PROTEGE_HOME}/plugins/</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
plugin.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?eclipse version="3.0"?>
<plugin>
<extension id="Example.reasoner.factory" name="Example" point="org.protege.editor.owl.inference_reasonerfactory">
<name value="Example Reasoner"/>
<label value="Example Reasoner"/>
<class value="it.uniroma1.dis.example.protege.reasoner.ExampleReasonerInfo"/>
</extension>
</plugin>
This is the structure of my JAR:
And this is the error being generated:
13:13:39.811 [Classification Thread] ERROR o.p.e.o.m.i.OWLReasonerManager - An error occurred during reasoning: com/google/common/base/Optional.
java.lang.NoClassDefFoundError: com/google/common/base/Optional
at it.uniroma1.dis.example.protege.reasoner.ExampleReasoner.<init>(ExampleReasoner.java:17) ~[na:na]
at it.uniroma1.dis.example.protege.reasoner.ExampleReasonerFactory.createReasoner(ExampleReasonerFactory.java:47) ~[na:na]
at it.uniroma1.dis.example.protege.reasoner.ExampleReasonerFactory.createReasoner(ExampleReasonerFactory.java:9) ~[na:na]
at org.protege.editor.owl.model.inference.ReasonerUtilities.createReasoner(ReasonerUtilities.java:20) ~[na:na]
at org.protege.editor.owl.model.inference.OWLReasonerManagerImpl$ClassificationRunner.ensureRunningReasonerInitialized(OWLReasonerManagerImpl.java:427) ~[na:na]
at org.protege.editor.owl.model.inference.OWLReasonerManagerImpl$ClassificationRunner.run(OWLReasonerManagerImpl.java:382) ~[na:na]
at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_91]
Caused by: java.lang.ClassNotFoundException: com.google.common.base.Optional not found by it.uniroma1.dis.example.protege [24]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1556) ~[org.apache.felix.main.jar:na]
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:77) ~[org.apache.felix.main.jar:na]
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1993) ~[org.apache.felix.main.jar:na]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_91]
... 7 common frames omitted
Whenever I execute the following line from within my reasoner constructor (the only line present in the constructor method, other than super):
System.out.println("IRI: " + ontology.getOntologyID().getOntologyIRI().orNull());
Any thoughts?

Missing Class after Maven Install

So I've pretty much been banging my head against the wall trying to solve this one...
This is my first time using Maven, and am using it on OSX to install the ews-java-api.
After clean, or instal, and everything builds successfully, but I am still unable to access the classes through a java file.
I'm getting the following errors,
Connect.java:3: error: package microsoft.exchange.webservices.data does not exist
import microsoft.exchange.webservices.data.*;
Connect.java:15: error: cannot find symbol
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
^
symbol: class ExchangeService
location: class Connect
I'm curious if I've overall made a mistake with the install path, when installing Maven... or if theres another issue regarding where I'm downloading the A.P.I package?
Any help is much appreciated!!
[EDIT]
This is my bash.profile output...
$ cat ~/.bash_profile
export M2_HOME=/Users/joliv64/mailtests/apache-maven-3.3.3/
export PATH=$PATH:$M2_HOME/bin
Also this is my pom.xml file.
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.microsoft.ews-java-api</groupId>
<artifactId>ews-java-api</artifactId>
<version>3.0-SNAPSHOT</version>
<name>Exchange Web Services Java API</name>
<description>Exchange Web Services (EWS) Java API</description>
<!-- Required by the site command for certain relative URL configuration. -->
<url>http://www.microsoft.com/</url>
<!-- Used by the javadoc plugin to generate the comments at the bottom. -->
<inceptionYear>2012</inceptionYear>
<!-- Used to define a minimum Maven version. Used in conjunction with plugin
management to lock in a more current version of the various plugins. -->
<prerequisites>
<maven>3.1.0</maven>
</prerequisites>
<organization>
<name>Microsoft</name>
<url>http://www.microsoft.com/</url>
</organization>
<properties>
<!-- Eliminates the file encoding warning. Of course, all of your files
should probably be UTF-8 nowadays. -->
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<javaLanguage.version>1.6</javaLanguage.version>
<javadoc.doclint.param/>
<!-- Dependencies [BUILD]: -->
<maven-gpg-plugin.version>1.6</maven-gpg-plugin.version>
<maven-javadoc-plugin.version>2.10.3</maven-javadoc-plugin.version>
<maven-compiler-plugin.version>3.3</maven-compiler-plugin.version>
<nexus-staging-maven-plugin.version>1.6.5</nexus-staging-maven-plugin.version>
<maven-source-plugin.version>2.4</maven-source-plugin.version>
<animal-sniffer-maven-plugin.version>1.14</animal-sniffer-maven-plugin.version>
<animal-sniffer-maven-plugin.signature.version>1.1</animal-sniffer-maven-plugin.signature.version>
<!-- Dependencies [REPORT]: -->
<maven-site-plugin.version>3.4</maven-site-plugin.version>
<maven-project-info-reports-plugin.version>2.8</maven-project-info-reports-plugin.version>
<versions-maven-plugin.version>2.2</versions-maven-plugin.version>
<maven-jxr-plugin.version>2.5</maven-jxr-plugin.version>
<maven-surefire-report-plugin.version>2.18.1</maven-surefire-report-plugin.version>
<!-- Dependencies [COMPILE]: -->
<httpclient.version>4.4.1</httpclient.version>
<httpcore.version>4.4.1</httpcore.version>
<commons-logging.version>1.2</commons-logging.version>
<joda-time.version>2.8</joda-time.version>
<commons-lang3.version>3.4</commons-lang3.version>
<!-- Dependencies [TEST]: -->
<junit.version>4.12</junit.version>
<hamcrest-all.version>1.3</hamcrest-all.version>
<mockito-core.version>1.10.19</mockito-core.version>
<slf4j.version>1.7.12</slf4j.version>
<logback.version>1.1.3</logback.version>
</properties>
<profiles>
<profile>
<!-- handle broken builds on jdk1.8 due to doclint function -->
<id>default-jdk18-profile</id>
<activation>
<jdk>[1.8,)</jdk>
</activation>
<properties>
<javadoc.doclint.param>-Xdoclint:none</javadoc.doclint.param>
</properties>
</profile>
<profile>
<id>release-sign-artifacts</id>
<activation>
<property>
<name>gpg.passphrase</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
<licenses>
<license>
<name>MIT License</name>
<url>http://opensource.org/licenses/MIT</url>
<distribution>repo</distribution>
</license>
</licenses>
<issueManagement>
<url>https://github.com/OfficeDev/ews-java-api/issues</url>
<system>GitHub Issues</system>
</issueManagement>
<ciManagement>
<system>travis</system>
<url>https://travis-ci.org/OfficeDev/ews-java-api</url>
</ciManagement>
<scm>
<url>https://github.com/OfficeDev/ews-java-api</url>
<connection>scm:git:ssh://git#github.com:OfficeDev/ews-java-api.git</connection>
<developerConnection>scm:git:ssh://git#github.com:OfficeDev/ews-java-api.git</developerConnection>
</scm>
<distributionManagement>
<snapshotRepository>
<id>ossrh-snapshot</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2</url>
</repository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>${httpclient.version}</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>${httpcore.version}</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>${commons-logging.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>${commons-lang3.version}</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>${joda-time.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>${hamcrest-all.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito-core.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>${slf4j.version}</version>
<scope>test</scope>
</dependency>
<!-- Added Dependency -->
<dependency>
<groupId>com.microsoft.ews-java-api</groupId>
<artifactId>ews-java-api</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<plugins>
<!-- Deployment / build plugins -->
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>${nexus-staging-maven-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<!-- Ref.: http://books.sonatype.com/nexus-book/reference/staging-deployment.html -->
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<encoding>${project.build.sourceEncoding}</encoding>
<source>${javaLanguage.version}</source>
<target>${javaLanguage.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<linksource>true</linksource>
<additionalparam>${javadoc.doclint.param}</additionalparam>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>${maven-source-plugin.version}</version>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>${animal-sniffer-maven-plugin.version}</version>
<configuration>
<signature>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java16-sun</artifactId>
<version>${animal-sniffer-maven-plugin.signature.version}</version>
</signature>
</configuration>
<executions>
<execution>
<id>check-java16-sun</id>
<phase>test</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Deployment / build plugins END -->
</plugins>
<!-- Used to bump all of the various core plugins up to Maven current.
Use this in conjunction with the versions-maven-plugin to keep your Maven
plugins up to date. -->
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>${maven-site-plugin.version}</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<reporting>
<plugins>
<!-- Basic report generation. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>${maven-project-info-reports-plugin.version}</version>
</plugin>
<!-- Dependency version reporting. Relies on standard version numbering
- you should use standard version numbering too!
http://mojo.codehaus.org/versions-maven-plugin/version-rules.html -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>versions-maven-plugin</artifactId>
<version>${versions-maven-plugin.version}</version>
<reportSets>
<reportSet>
<reports>
<report>dependency-updates-report</report>
<report>plugin-updates-report</report>
<report>property-updates-report</report>
</reports>
</reportSet>
</reportSets>
</plugin>
<!-- Generates the Javadoc for the report. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven-javadoc-plugin.version}</version>
<configuration>
<linksource>true</linksource>
<additionalparam>${javadoc.doclint.param}</additionalparam>
</configuration>
</plugin>
<!-- Generates a nice HTML linked source cross-reference. -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jxr-plugin</artifactId>
<version>${maven-jxr-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>${maven-surefire-report-plugin.version}</version>
</plugin>
</plugins>
</reporting>
<repositories>
<repository>
<id>sonatype-snapshots</id>
<name>Sonatype OSS Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
Two suspected areas we can have as mentioned in the Comments.
Either you don't have dependency for Jar contains the mentioned class.
Or If its present then problem is with the .classpath file.
#user1933888/ #Ferdinand Neman/ #Subodh Joshi are very right.
#Zavael- By default scope is compile need not to define explicitly.
REFER: https://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html
Note: I Don't have right to add comment above so I mentioned here.
I am newbie to this portal:-)
So the solution to the problem was much simpler than expected..
I was compiling my file with javac, and did not put my class into a package to compile with mvn.
Also, the imports were a tad off because they were not as advertised from some source code. So of course mvn was building correctly, I was just trying to access the classes in an incorrect manner.
Thanks for the help!

Can't access moskito-inspect webui

I am trying to use moskito-inspect tool in embedded mode, here is my pom.xml
<properties>
<moskito.version>2.5.5</moskito.version>
<moskito-central.version>1.1.0</moskito-central.version>
</properties>
...
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>aspectj-maven-plugin</artifactId>
<version>1.5</version>
<configuration>
<aspectLibraries>
<aspectLibrary>
<groupId>net.anotheria</groupId>
<artifactId>moskito-aop</artifactId>
</aspectLibrary>
</aspectLibraries>
<complianceLevel>1.7</complianceLevel>
<source>1.7</source>
<target>1.7</target>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<configuration>
<artifactItems><artifactItem>
<groupId>net.anotheria</groupId>
<artifactId>moskito-webui</artifactId>
<version>${moskito.version}</version>
<type>jar</type>
<overWrite>true</overWrite>
<outputDirectory>${project.build.directory}/tmp</outputDirectory>
<includes>moskito/**,**/*.jsp</includes>
</artifactItem></artifactItems>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>unpack</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.1</version>
<configuration>
<webResources>
<resource>
<directory>${project.build.directory}/tmp</directory>
</resource>
</webResources>
</configuration>
</plugin>
</plugins>
...
<dependencies>
<dependency>
<groupId>net.anotheria</groupId>
<artifactId>moskito-core</artifactId>
<version>${moskito.version}</version>
</dependency>
<dependency>
<groupId>net.anotheria</groupId>
<artifactId>moskito-aop</artifactId>
<version>${moskito.version}</version>
</dependency>
<dependency>
<groupId>net.anotheria</groupId>
<artifactId>moskito-web</artifactId>
<version>${moskito.version}</version>
</dependency>
<dependency>
<groupId>net.anotheria</groupId>
<artifactId>moskito-webui</artifactId>
<version>${moskito.version}</version>
</dependency>
<dependency>
<groupId>net.anotheria</groupId>
<artifactId>moskito-inspect-embedded</artifactId>
<version>${moskito.version}</version>
</dependency>
<dependency>
<groupId>net.anotheria</groupId>
<artifactId>moskito-inspect-jersey</artifactId>
<version>${moskito.version}</version>
</dependency>
<dependency>
<groupId>org.moskito</groupId>
<artifactId>moskito-central-embedded-connector</artifactId>
<version>${moskito-central.version}</version>
</dependency>
<dependency>
<groupId>org.moskito</groupId>
<artifactId>moskito-central-storages</artifactId>
<version>${moskito-central.version}</version>
</dependency>
</dependencies>
When I am running maven clean install I am getting war-file, which has the next inner structure:
When I deploy this war-file in tomcat, I can access my application by this URL:
http://localhost:8080/ada
(where ada - application name)
so I have tried to access moskito-inspect webui by this URLs:
http://localhost:8080/ada/moskito
http://localhost:8080/moskito
http://localhost:8080/ada/mui
http://localhost:8080/mui
However, tomcat response for all these links in 404 [Not found].
What am I doing wrong, may be someone faced the same problem?
Thanks in advance
I have figure out that you should add to your web.xml Moskito filters configuration - like in this article.
But author also said in this article that
With version 2.4.0 and servlet spec 3.0 no changes of the web.xml are
needed.
That's why I ignored that guide - very misleading advice!

Categories