Error during artifact deployment - java

I am trying to deploy an application in Wildfly 10 but I get the following error:
/usr/lib/jvm/jdk1.8.0_121/bin/java -classpath /opt/jetbrains/idea-IU-163.13906.18/lib/idea_rt.jar:/opt/jetbrains/idea-IU-163.13906.18/lib/util.jar -Dfile.encoding=UTF-8 com.intellij.rt.execution.CommandLineWrapper /tmp/classpath com.intellij.javaee.oss.process.JavaeeProcess 42364 com.intellij.javaee.oss.jboss.agent.JBoss71Agent
[2017-10-05 12:50:04,818] Artifact Gradle : com.solveralynx.wildrunner.api : skin.war: Server is not connected. Deploy is not available.
[2017-10-05 12:50:04,818] Artifact Gradle : com.solveralynx.wildrunner.api : drcs-development.war: Server is not connected. Deploy is not available.
Oct 05, 2017 12:50:04 PM org.xnio.Xnio <clinit>
INFO: XNIO version 3.4.0.Final
Oct 05, 2017 12:50:04 PM org.xnio.nio.NioXnio <clinit>
INFO: XNIO NIO Implementation Version 3.4.0.Final
Oct 05, 2017 12:50:04 PM org.jboss.remoting3.EndpointImpl <clinit>
INFO: JBoss Remoting version 4.0.21.Final
[2017-10-05 12:50:05,133] Artifact Gradle : com.solveralynx.wildrunner.api : skin.war: Artifact is being deployed, please wait...
[2017-10-05 12:50:05,133] Artifact Gradle : com.solveralynx.wildrunner.api : drcs-development.war: Artifact is being deployed, please wait...
Connected to server
Connected to the target VM, address: 'localhost:44287', transport: 'socket'
[2017-10-05 12:50:08,064] Artifact Gradle : com.solveralynx.wildrunner.api : skin.war: Artifact is deployed successfully
[2017-10-05 12:50:08,064] Artifact Gradle : com.solveralynx.wildrunner.api : skin.war: Deploy took 2,931 milliseconds
[2017-10-05 12:50:15,349] Artifact Gradle : com.solveralynx.wildrunner.api : drcs-development.war: Error during artifact deployment. See server log for details.
[2017-10-05 12:50:15,350] Artifact Gradle : com.solveralynx.wildrunner.api : drcs-development.war: java.lang.Exception: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"drcs-development.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"drcs-development.war\".POST_MODULE: WFLYSRV0153: Failed to process phase POST_MODULE of deployment \"drcs-development.war\"
Caused by: java.lang.NoClassDefFoundError: Failed to link com/solveralynx/wildrunner_api/drcs/business_impl/ejb/jobs/GBMeteringDataJobEJB (Module \"deployment.drcs-development.war:main\" from Service Module Loader): com/solveralynx/wildrunner_api/drcs/business_api/ejb/jobs/MeteringDataJobLocal"},"WFLYCTL0412: Required services that are not installed:" => ["jboss.deployment.unit.\"drcs-development.war\".POST_MODULE"],"WFLYCTL0180: Services with missing/unavailable dependencies" => undefined}
My wildfly deployment structure looks like this:
<jboss-deployment-structure>
<!-- Make sub deployments isolated by default, so they cannot see each others classes without a Class-Path entry -->
<ear-subdeployments-isolated>false</ear-subdeployments-isolated>
<!-- This corresponds to the top level deployment. For a war this is the war's module, for an ear -->
<!-- This is the top level ear module, which contains all the classes in the EAR's lib folder -->
<deployment>
<!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->
<exclusions>
<!--<module name="com.google.guava" slot="main"/>-->
</exclusions>
<!-- This allows you to define additional dependencies, it is the same as using the Dependencies: manifest attribute -->
<dependencies>
<module name="javax.faces.api" slot="main" export="true"/>
<module name="com.sun.jsf-impl" slot="main" export="true"/>
<module name="com.google.gwt.user" slot="main" export="true"/>
<module name="com.google.gwt.servlet" slot="main" export="true"/>
<module name="org.dom4j" slot="main" export="true"/>
<module name="org.apache.xalan" slot="main"/>
</dependencies>
<!-- These add additional classes to the module. In this case it is the same as including the jar in the EAR's lib directory -->
<resources>
</resources>
</deployment>
<sub-deployment name="web.war">
<exclusions>
<module name="javax.faces.api" slot="1.2"/>
<module name="com.sun.jsf-impl" slot="1.2"/>
</exclusions>
<dependencies>
<module name="javax.faces.api" slot="main"/>
<module name="com.sun.jsf-impl" slot="main"/>
<module name="com.google.gwt.user" slot="main"/>
<module name="com.google.gwt.servlet" slot="main"/>
<module name="org.dom4j" slot="main"/>
<module name="org.jboss.xnio" slot="main"/>
</dependencies>
</sub-deployment>
<sub-deployment name="business-impl.jar">
<dependencies>
<module name="org.jboss.xnio" slot="main"/>
<module name="com.microsoft.sqlserver" slot="main"/>
</dependencies>
</sub-deployment>
</jboss-deployment-structure>
I don't know what causes this error to happen. I'm thinking that I have to change POST_MODULE phase into something different.
Thank you in advance.

Related

LinkageError with org.jboss.logging

I am trying to migrate a aplication running on wildfly 8.2 to jboss 7.2, using slf4j as logging framework. However when I try to deploy in JBoss, I get the following error:
Caused by: java.lang.LinkageError: Failed to link
org/jboss/logging/Logger$Level (Module
\"deployment.backend-2.1.2.war\" from Service Module Loader): loader
constraint violation: loader (instance of
org/jboss/modules/ModuleClassLoader) previously initiated loading for
a different type with name \"org/jboss/logging/Logger$Level\""}}}
Current jboss-deployment-structure:
<exclusions>
<module name="org.apache.log4j" />
<module name="org.slf4j" />
<module name='org.slf4j.impl' />
<module name="org.apache.commons.logging" />
<module name="org.log4j" />
<module name="org.jboss.logging" />
</exclusions>
I couldn't find any solution to solve this error, running mvn dependency:tree, org.jboss.logging was imported from Hibernate 4.3.11.Final, then my pom with hibernate now looks :
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate.version}</version>
<exclusions>
<exclusion>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
But the same error persists.
This issue is related to the fact that in your configuration file: standalone.xml, you had created or imported the same logger twice, the level also should not repeat.
Caused by: java.lang.LinkageError: Failed to link org/jboss/logging/Logger$Level (Module \"deployment.backend-2.1.2.war\" from Service Module Loader): loader constraint violation: loader (instance of org/jboss/modules/ModuleClassLoader) previously initiated loading for a different type with name \"org/jboss/logging/Logger$Level\""}}}
Furthermore, be careful with the flag use-parent-handlers on the logger configuration, which will dictate if the logger info should be used by the parent handler. More information here

How to resolve java.lang.LinkageError org.bouncycastle.mail.smime.SMIMESignedGenerator.generate(Ljavax/mail/internet/MimeBodyPart;)

I am using Bouncycastle (bcmail, bcprov, bcpkix) 1.57 in combination with Jboss EAP 6.4 (jboss-AS 7.5) and Java 1.8.
I get a Linkage error with the following stacktrace:
Caused by: java.lang.LinkageError:
loader constraint violation: when resolving method "org.bouncycastle.mail.smime.SMIMESignedGenerator.generate(Ljavax/mail/internet/MimeBodyPart;)Ljavax/mail/internet/MimeMultipart;"
the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, de/deutschepost/paket/mkp/transformation/SMIMEPreparator,
and the class loader (instance of org/jboss/modules/ModuleClassLoader) for the method's defining class, org/bouncycastle/mail/smime/SMIMESignedGenerator,
have different Class objects for the type javax/mail/internet/MimeBodyPart used in the signature
As far as my understanding goes there must be a duplicate or a conflict in library versions somewhere in the hierarchy, but unfortunately I can't find any.
Here is the list of all the dependencies that are present in the classpath at runtime:
activation-1.1.jar
activemq-broker-5.11.0.jar
activemq-client-5.11.0.jar
activemq-jms-pool-5.11.0.jar
activemq-openwire-legacy-5.11.0.jar
activemq-pool-5.11.0.jar
antlr-2.7.7.jar
aqapi-11.2.0.3-1.jar
asm-5.0.4.jar
aspectjrt-1.6.1.jar
aspectjweaver-1.8.9.jar
c3p0-0.9.5.2.jar
camel-core-2.18.4.jar
camel-cxf-2.18.4.jar
camel-cxf-transport-2.18.4.jar
camel-ftp-2.18.4.jar
camel-http-2.18.4.jar
camel-http-common-2.18.4.jar
camel-jaxb-2.18.4.jar
camel-jetty-2.18.4.jar
camel-jetty9-2.18.4.jar
camel-jetty-common-2.18.4.jar
camel-jms-2.18.4.jar
camel-mail-2.18.4.jar
camel-mail-patch-2.10-senacor-3-SNAPSHOT.jar
camel-ognl-2.18.4.jar
camel-quartz2-2.18.4.jar
camel-spring-2.18.4.jar
cglib-nodep-2.1_3.jar
classmate-1.3.0.jar
commons-codec-1.4.jar
commons-collections-3.2.1.jar
commons-httpclient-3.1.jar
commons-io-1.4.jar
commons-lang-2.4.jar
commons-lang3-3.3.2.jar
commons-logging-1.0.4.jar
commons-net-3.3.jar
commons-pool-1.5.6.jar
core-7.0.0-SNAPSHOT.jar
cryptacular-1.0.jar
cxf-core-3.1.12.jar
cxf-rt-bindings-soap-3.1.12.jar
cxf-rt-bindings-xml-3.1.12.jar
cxf-rt-databinding-jaxb-3.1.12.jar
cxf-rt-frontend-jaxrs-3.1.12.jar
cxf-rt-frontend-jaxws-3.1.12.jar
cxf-rt-frontend-simple-3.1.12.jar
cxf-rt-rs-client-3.1.11.jar
cxf-rt-rs-security-oauth-3.1.11.jar
cxf-rt-security-3.1.12.jar
cxf-rt-security-saml-3.1.12.jar
cxf-rt-transports-http-3.1.12.jar
cxf-rt-ws-addr-3.1.12.jar
cxf-rt-wsdl-3.1.12.jar
cxf-rt-ws-policy-3.1.12.jar
cxf-rt-ws-security-3.1.12.jar
dms-11.2.0.3-1.jar
dom4j-1.6.1.jar
dsn-1.5.5.jar
ehcache-2.10.3.jar
ehcache-core-2.5.7.jar
geronimo-j2ee-management_1.1_spec-1.0.1.jar
geronimo-jms_1.1_spec-1.1.1.jar
geronimo-jta_1.0.1B_spec-1.0.1.jar
gson-2.7.jar
guava-18.0.jar
h2-1.3.173.jar
hamcrest-all-1.3.jar
hamcrest-core-1.3.jar
hawtbuf-1.11.jar
hibernate-c3p0-5.2.10.Final.jar
hibernate-commons-annotations-5.0.1.Final.jar
hibernate-core-5.2.10.Final.jar
hibernate-ehcache-5.2.10.Final.jar
hibernate-envers-5.2.10.Final.jar
hibernate-jpa-2.1-api-1.0.0.Final.jar
hibernate-validator-4.2.0.Final.jar
httpclient-4.5.3.jar
httpcore-4.4.6.jar
httpmime-4.5.3.jar
itext-2.1.7.jar
jandex-2.0.3.Final.jar
jasypt-1.9.2.jar
javassist-3.20.0-GA.jar
java-support-7.1.1.jar
javax.annotation-api-1.2.jar
javax.inject-1.jar
javax.mail-1.5.5.jar
javax.mail-api-1.5.5.jar
javax.servlet-api-3.1.0.jar
javax.ws.rs-api-2.0.1.jar
jaxb2-basics-runtime-0.6.3.jar
jaxb-api-2.2.11.jar
jaxb-core-2.2.11.jar
jaxb-impl-2.2.11.jar
jboss-logging-3.3.0.Final.jar
jboss-transaction-api_1.2_spec-1.0.1.Final.jar
jettison-1.3.7.jar
jetty-client-9.2.21.v20170120.jar
jetty-continuation-9.2.21.v20170120.jar
jetty-http-9.2.21.v20170120.jar
jetty-io-9.2.21.v20170120.jar
jetty-jmx-9.2.21.v20170120.jar
jetty-security-9.2.21.v20170120.jar
jetty-server-9.2.21.v20170120.jar
jetty-servlet-9.2.21.v20170120.jar
jetty-servlets-9.2.21.v20170120.jar
jetty-util-9.2.21.v20170120.jar
jms-1.1.jar
joda-time-2.3.jar
jsch-0.1.54.jar
jsmpp-2.1.0.jar
json-simple-1.1.1.jar
jsr250-api-1.0.jar
jta-1.1.jar
jutf7-1.0.0.jar
mchange-commons-java-0.2.11.jar
neethi-3.0.3.jar
netty-all-4.0.26.Final.jar
oauth-20100527.jar
oauth-provider-20100527.jar
ognl-3.1.10.jar
ojdbc6-11.2.0.4.0.jar
opensaml-core-3.1.1.jar
opensaml-profile-api-3.1.1.jar
opensaml-saml-api-3.1.1.jar
opensaml-saml-impl-3.1.1.jar
opensaml-security-api-3.1.1.jar
opensaml-security-impl-3.1.1.jar
opensaml-soap-api-3.1.1.jar
opensaml-xacml-api-3.1.1.jar
opensaml-xacml-impl-3.1.1.jar
opensaml-xacml-saml-api-3.1.1.jar
opensaml-xacml-saml-impl-3.1.1.jar
opensaml-xmlsec-api-3.1.1.jar
opensaml-xmlsec-impl-3.1.1.jar
optivo-3.0.0-SNAPSHOT.jar
oro-2.0.8.jar
pushy-0.4.3.jar
quartz-2.2.3.jar
slf4j-api-1.7.5.jar
spring-aop-4.3.8.RELEASE.jar
spring-aspects-4.3.8.RELEASE.jar
spring-beans-4.3.8.RELEASE.jar
spring-context-4.3.8.RELEASE.jar
spring-context-support-4.3.8.RELEASE.jar
spring-core-4.3.8.RELEASE.jar
spring-data-jdbc-core-1.0.0.RELEASE.jar
spring-data-oracle-1.0.0.RELEASE.jar
spring-expression-4.3.8.RELEASE.jar
spring-jdbc-4.3.8.RELEASE.jar
spring-jms-4.3.8.RELEASE.jar
spring-messaging-4.3.8.RELEASE.jar
spring-orm-4.3.8.RELEASE.jar
spring-retry-1.0.0.RELEASE.jar
spring-tx-4.3.8.RELEASE.jar
spring-web-4.3.8.RELEASE.jar
stax2-api-3.1.4.jar
stax-api-1.0.1.jar
ucp-11.2.0.4.0.jar
validation-api-1.0.0.GA.jar
velocity-1.6.2.jar
woodstox-core-asl-4.4.1.jar
wsdl4j-1.6.3.jar
wss4j-bindings-2.1.10.jar
wss4j-policy-2.1.10.jar
wss4j-ws-security-common-2.1.10.jar
wss4j-ws-security-dom-2.1.10.jar
wss4j-ws-security-policy-stax-2.1.10.jar
wss4j-ws-security-stax-2.1.10.jar
xbean-spring-3.5.jar
xml-apis-1.3.04.jar
xmlpull-1.1.3.1.jar
xml-resolver-1.2.jar
xmlschema-core-2.2.2.jar
xmlsec-2.0.8.jar
xpp3_min-1.1.4c.jar
xstream-1.4.5.jar
xstream-hibernate-1.4.5.jar
Apart from these I have an explicit dependency to Bouncycastle module (I added the module myself in jboss modules). The configuration file module.xml is as follows:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.bouncycastle">
<resources>
<resource-root path="bcmail-jdk15on-1.57.jar"/>
<resource-root path="bcprov-jdk15on-1.57.jar"/>
<resource-root path="bcpkix-jdk15on-1.57.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="org.jboss.logging"/>
<module name="org.jboss.modules"/>
<module name="javax.activation.api" />
<module name="javax.mail.api"/>
</dependencies>
</module>
I would be glad if anyone can help me out here.
Thanks.
This issue is due to presence of multiple javax-mail versionsin the project classpath.Removing all the different versions for this dependency and keeping just one would resolve the issue.By default you could try using javax.mail.api-1.4.5 which is shipped with EAP 6.4

Wildfly Deployment Fails at missing "jboss.deployment.unit"

Currently I try, for my first time, to use Wildfly with MongoDB and Hibernate OGM. When I deploy my Project to Wildfly, the following error occurs:
"{ \"WFLYCTL0080: Failed services\" => {\"jboss.deployment.unit.\\\"{MYAPP}.war\\\".STRUCTURE\" => \"org.jboss.msc.service.StartException in service jboss.deployment.unit.\\\"{MYAPP}.war\\\".STRUCTURE: WFLYSRV0153: Failed to process phase STRUCTURE of deployment \\\"{MYAPP}.war\\\"
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYSRV0168: Error loading jboss-deployment-structure.xml from {MYUSERDIR}/wildfly10/standalone/deployments/{MYAPP}.war/WEB-INF/jboss-deployment-structure.xml
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[2,1]
Message: Unexpected element '{http://www.jboss.com/xml/ns/javaee}jboss-web'\"},
\"WFLYCTL0412: Required services that are not installed:\" => [\"jboss.deployment.unit.\\\"{MYAPP}.war\\\".STRUCTURE\"],
\"WFLYCTL0180: Services with missing/unavailable dependencies\" => undefined }"
My jboss-deployment-structure.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="org.hibernate" slot="ogm" services="import" />
<module name="org.hibernate.ogm.mongodb" slot="main" services="import" />
</dependencies>
</deployment>
</jboss-deployment-structure>
This Jboss Document mentions to add Modules (which I did) to the Wildfly Folder and add an Entry to the Manifest.mf File which I created manually.
Does anybody have an idea, what to try next?
I would also appreciate a Recommendation for a good Tutorial.
Sidenotes:
NetBeans 8.2
Wildfly 10
MacOS
MongoDB on Ubuntu 16.04 VM
I googled a lot
The Tutorial I basically used

Unable to instantiate driver SQLServerDriver in Wildfly 10

I am having the following error:
15:02:34,434 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 33) WFLYCTL0013: Operation ("add") failed - address: ([
("subsystem" => "datasources"),
("jdbc-driver" => "sqlserver")
]) - failure description: "WFLYJCA0034: Unable to instantiate driver class \"com.microsoft.jdbc.sqlserver.SQLServerDriver\". See log (WARN) for more details"
The module.xml in $JBOSS_HOME\modules\com\microsoft\sqlserver\main:
<module xmlns="urn:jboss:module:1.1" name="com.microsoft.sqlserver" slot="main">
<resources>
<resource-root path="sqljdbc42.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.transaction.api"/>
</dependencies>
</module>
This is the content of sqljdbc42.jar
And the driver definition in standalone.xml
<driver name="sqlserver" module="com.microsoft.sqlserver">
<driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
</driver>
Please help me find out what I'm not seeing
UPDATE:
For historic context: the "com.microsoft.jdbc.sqlserver" package is
from the old SQL Server 2000 JDBC driver, they changed it somewhere
around 2005 to "com.microsoft.sqlserver.jdbc" by Mark Rotteveel
From what i can see from the jar content the class package in your driver is wrong, try with
<driver name="sqlserver" module="com.microsoft.sqlserver">
<driver-class>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver-class>
</driver>

What's the module name if deploy jdbc in Jboss AS 7 as web application

From this post start from Jboss AS7 the jdbc driver is able to deploy as regular application. However a question is, how other application is able to refer to this jdbc jar?
here is what I tried but it doesn't work
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
......
<deployment>
<dependencies>
<module name="ojdbc6.jar" />
</dependencies>
</deployment>
.....
</jboss-deployment-structure>
UPDATE
When I deploy ojdbc.jar there is a section of log from console:
10:56:20,416 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "ojdbc6.jar"
10:56:21,487 INFO [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-2) JBAS010403: Deploying JDBC-compliant driver class oracle.jdbc.OracleDriver (version 11.2)
10:56:21,489 INFO [org.jboss.as.osgi] (MSC service thread 1-7) JBAS011907: Register module: Module "deployment.ojdbc6.jar:main" from Service Module Loader
10:56:21,499 INFO [org.jboss.as.server] (HttpManagementService-threads - 6) JBAS018559: Deployed "ojdbc6.jar"
Per the log jdbc module is with name deployment.ojdbc6.jar:main, but after I update jboss-deployment-structure.xml
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
......
<deployment>
<dependencies>
<module name="deployment.ojdbc6.jar:main" />
</dependencies>
</deployment>
.....
</jboss-deployment-structure>
it still does not work. with following message:
10:59:34,448 INFO [org.jboss.as.server] (HttpManagementService-threads - 7) JBAS015870: Deploy of deployment "MyApp.war" was rolled back with failure message {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.deployment.unit.\"MyApp.war.war\".POST_MODULE Missing[JBAS014861: <one or more transitive dependencies>]","jboss.module.service.\"deployment.MyApp.war.war\".main Missing[jboss.module.spec.service.\"deployment.ojdbc6.jar:main\".main]"]}
10:59:35,198 INFO [org.jboss.as.server.deployment] (MSC service thread 1-7) JBAS015877: Stopped deployment MyApp.war.war in 749ms
You can reference the jars from other deployments in this way:
<module name="deployment.YourEarOrWar.YourJar.jar" />
Where deployment is the general prefix for a reference to your deployed apps.
However, for a lib like a jdbc-driver I recommend to put it in the module-folder of the JBoss
<module xmlns="urn:jboss:module:1.1" name="driver.ojdbc">
<resources>
<resource-root path="ojdbc6.jar"/>
</resources>
</module>
and reference it then
<module name="driver.ojdbc"/>
See also
https://community.jboss.org/thread/169894
and
http://www.mastertheboss.com/jboss-as-7/how-to-install-a-module-on-jboss-as-7

Categories

Resources