Good Day....
We are working on a project to migratate J2EE application from WAS 8.5 to JBOSS EAP 7.0 and we are new to JBOSS.
Application bundle with:
1) EAR (WAR and EJB)
2) Application Utility Jars and Persistence jars (Entity classes)
3)Third party jar like log4j2.5,Jackson,hibernate,
We created folder named sharedLib and maintained sharedLib/main/module.xml
We moved all our Application Utility Jars, Persistence jars, and Third party jar to shardLib Module.
<resource-root path="../SEC_BatchService_Contract-1.0.0.jar"/>
<resource-root path="../SEC_DepartmentService_Contract-1.0.0.jar"/>
<resource-root path="../SEC_LoginService_Contract-1.0.0.jar"/>
<resource-root path="../SEC_MenuService_Contract-1.0.0.jar"/>
<resource-root path="../SEC_ProcessesService_Contract-1.0.0.jar"/>
<resource-root path="../SEC_SessionMaintenanceService_Contract-1.0.0.jar"/>
<resource-root path="../SEC_SessionService_Contract-1.0.0.jar"/>
<resource-root path="../SecurityInterfaceServices_Contract-1.0.0.jar"/>
<resource-root path="../SEC_UserAuthoriser_Contract-1.0.0.jar"/>
<resource-root path="../SEC_UserMaintenanceService_Contract-1.0.0.jar"/>
<resource-root path="../SEC_UserRole_Contract-1.0.0.jar"/>
<resource-root path="../SystemUtility_Contract-1.0.0.jar"/>
<resource-root path="../WorkFlow_Contract-1.0.0.jar"/>
<resource-root path="../Application_Contract-1.0.0.jar"/>
<resource-root path="../BootStrapService_Contract-1.0.0.jar"/>
<resource-root path="../Intergration_Contract-1.0.0.jar"/>
<resource-root path="../Logger_Contract-1.0.0.jar"/>
<resource-root path="../Persistence_Contract-1.0.0.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/Logger_Contract-1.0.0.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/antlr-2.7.7.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/btf-1.2.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/com.ibm.websphere.appserver.api.json-1.0.13.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/commons-codec-1.3.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/commons-httpclient-3.0.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/cors-filter-2.5.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/disruptor-3.0.0.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/dom4j-1.6.1.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/guava-19.0.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/hibernate-commons-annotations-4.0.5.Final.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/hibernate-core-4.2.7.Final.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/hibernate-jpa-2.0-api-1.0.1.Final.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/jackson-annotations-2.7.3.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/jackson-core-2.7.3.jar"/>
<resource-root path="/apps/SGDEV/config/SEC/product/thirdParty/jackson-coreutils-1.8.jar"/>
And APP_EAR/META-INF/MANIFEST.MF
Manifest-Version: 1.0
Dependencies: sharedLib
We are not facing any issue while invoking sharedLib Module files from EAR. But files which is resides in sharedLib not able to access EJB jar of EAR.
Example WAR -----> EJB--> sharedLib (Module) Fine
WAR -----> EJB1--> sharedLib ---> EJB2.jar Failed with NoClassDifferror. (not able to access any class of EJB jar POJO classes.)
can we invoke EAR EJB Jar from sharedLib (Isolated Module)
Error :
Flow : Rest Service ----> EJB.jar ---> EJB.jar ---> sharedLib ---> EJB
Caused by: java.lang.NoClassDefFoundError: scb/technical/bootstrap/process/SystemProperties ----------------(POJO Class resides in EJB JAR) --------------
at scb.technical.security.service.util.SecurityUtility.convertDateToUserTZ(SecurityUtility.java:257) ----------------------(POJO Class resides in sharedLib Module)----------------------
at scb.technical.security.service.LoginServiceBean.validateLogin(LoginServiceBean.java:161) ------------------------(SessionBean resides in EJB JAR)----------------------------
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)
at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)
at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:64)
at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)
at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:254)
... 212 more
Caused by: java.lang.ClassNotFoundException: scb.technical.bootstrap.process.SystemProperties from [Module "sharedLib:main" from local module loader #66133adc (finder: local module finder #7bfcd12c (roots: /jboss/eap/7.0/jboss-eap/modules,/jboss/eap/7.0/jboss-eap/modules/system/layers/base/.overlays/layer-base-jboss-eap-7.0.6.CP,/jboss/eap/7.0/jboss-eap/modules/system/layers/base))]
Server : JBOSS EAP 7.0
Thanks
Viswa..
Related
I am creating global module in wildfly which includes xml-api jar as well.
But When the parsing happens for the xml file, it throws the following exception.
I searched in the forum and many post saying to remove the xml-api and xml-beans jars from the class path. Because there is a conflict of JBoss / JDK xml jars and our xml-api jars. But I need to have my jars to be loaded with precedence. How can I achieve that. Please provide the suggestion.
13:11:51,686 ERROR [stderr] (default task-1) Caused by: java.lang.ClassCastExcep
tion: __redirected.__DatatypeFactory cannot be cast to javax.xml.datatype.Dataty
peFactory
13:11:51,688 ERROR [stderr] (default task-1) at javax.xml.datatype.DatatypeFa
ctory.newInstance(Unknown Source)
13:11:51,690 ERROR [stderr] (default task-1) at com.thoughtworks.xstream.conv
erters.extended.DurationConverter$1.getFactory(DurationConverter.java:39)
13:11:51,691 ERROR [stderr] (default task-1) at com.thoughtworks.xstream.conv
erters.extended.DurationConverter.<init>(DurationConverter.java:44)
13:11:51,691 ERROR [stderr] (default task-1) ... 74 more
Thanks
Senthil
I solved the issue.
I have removed the below modules and added javax.api and org.slf4j as dependencies in my module.xml. It is because wildfly already having these modules and loaded as part of core class loading. Thats why there is a conflict when it is reloaded.
Module.xml
Removed content :
<resource-root path="xml-apis-<version>.jar">
<resource-root path="slf4j-api-<version>.jar"/>
Added content :
<dependencies>
<module name="javax.api"/>
<module name="org.slf4j"/>
</dependencies>
corrected Module.xml
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.3" name="drools">
<resources>
<resource-root path="aether-api-1.0.0.v20140518.jar"/>
<resource-root path="aether-connector-basic-1.0.0.v20140518.jar"/>
<resource-root path="aether-impl-1.0.0.v20140518.jar"/>
<resource-root path="aether-spi-1.0.0.v20140518.jar"/>
<resource-root path="aether-transport-file-1.0.0.v20140518.jar"/>
<resource-root path="aether-transport-http-1.0.0.v20140518.jar"/>
<resource-root path="aether-transport-wagon-1.0.0.v20140518.jar"/>
<resource-root path="aether-util-1.0.0.v20140518.jar"/>
<resource-root path="ant-1.8.3.jar"/>
<resource-root path="ant-launcher-1.8.3.jar" />
<resource-root path="antlr-runtime-3.5.jar"/>
<resource-root path="aopalliance-1.0.jar"/>
<resource-root path="cdi-api-1.0-SP4.jar"/>
<resource-root path="commons-codec-1.4.jar"/>
<resource-root path="commons-lang-2.6.jar"/>
<resource-root path="commons-logging-1.1.1.jar"/>
<resource-root path="dom4j-1.6.1.jar"/>
<resource-root path="drools-beliefs-6.5.0.Final.jar"/>
<resource-root path="drools-compiler-6.5.0.Final.jar"/>
<resource-root path="drools-core-6.5.0.Final.jar"/>
<resource-root path="drools-decisiontables-6.5.0.Final.jar"/>
<resource-root path="drools-jsr94-6.5.0.Final.jar"/>
<resource-root path="drools-persistence-jpa-6.5.0.Final.jar"/>
<resource-root path="drools-pmml-6.5.0.Final.jar"/>
<resource-root path="drools-reteoo-6.5.0.Final.jar"/>
<resource-root path="drools-scorecards-6.5.0.Final.jar"/>
<resource-root path="drools-verifier-6.5.0.Final.jar"/>
<resource-root path="drools-templates-6.5.0.Final.jar"/>
<resource-root path="ecj-4.4.2.jar"/>
<resource-root path="guava-13.0.1.jar"/>
<resource-root path="hibernate-jpa-2.0-api-1.0.1.Final.jar"/>
<resource-root path="httpclient-4.3.6.jar"/>
<resource-root path="httpcore-4.3.3.jar"/>
<resource-root path="itext-2.1.2.jar"/>
<resource-root path="javassist-3.18.1-GA.jar"/>
<resource-root path="javax.inject-1.jar"/>
<resource-root path="jaxb-core-2.2.11.jar"/>
<resource-root path="jaxb-impl-2.2.11.jar"/>
<resource-root path="jboss-interceptors-api_1.1_spec-1.0.1.Final.jar"/>
<resource-root path="jboss-transaction-api_1.1_spec-1.0.1.Final.jar"/>
<resource-root path="jcl-over-slf4j-1.7.2.jar"/>
<resource-root path="jsoup-1.8.3.jar"/>
<resource-root path="jsr94-1.1.jar"/>
<resource-root path="jsr250-api-1.0.jar"/>
<resource-root path="kie-api-6.5.0.Final.jar"/>
<resource-root path="kie-ci-6.5.0.Final.jar"/>
<resource-root path="kie-internal-6.5.0.Final.jar"/>
<resource-root path="knowledge-api-6.5.0.Final.jar"/>
<resource-root path="maven-aether-provider-3.2.5.jar"/>
<resource-root path="maven-artifact-3.2.5.jar" />
<resource-root path="maven-compat-3.2.5.jar"/>
<resource-root path="maven-core-3.2.5.jar"/>
<resource-root path="maven-model-3.2.5.jar"/>
<resource-root path="maven-model-builder-3.2.5.jar"/>
<resource-root path="maven-plugin-api-3.2.5.jar"/>
<resource-root path="maven-repository-metadata-3.2.5.jar"/>
<resource-root path="maven-settings-3.2.5.jar"/>
<resource-root path="maven-settings-builder-3.2.5.jar"/>
<resource-root path="mvel2-2.2.8.Final.jar"/>
<resource-root path="org.eclipse.sisu.inject-0.3.0.M1.jar"/>
<resource-root path="org.eclipse.sisu.plexus-0.3.0.M1.jar"/>
<resource-root path="plexus-cipher-1.7.jar"/>
<resource-root path="plexus-classworlds-2.5.2.jar"/>
<resource-root path="plexus-component-annotations-1.5.5.jar"/>
<resource-root path="plexus-interpolation-1.21.jar"/>
<resource-root path="plexus-sec-dispatcher-1.3.jar"/>
<resource-root path="plexus-utils-3.0.20.jar"/>
<resource-root path="poi-3.13.jar"/>
<resource-root path="poi-ooxml-3.13.jar"/>
<resource-root path="poi-ooxml-schemas-3.13.jar"/>
<resource-root path="protobuf-java-2.6.0.jar"/>
<resource-root path="sisu-guice-3.2.3-no_aop.jar"/>
<!-- <resource-root path="slf4j-api-1.7.2.jar"/> -->
<resource-root path="stax-api-1.0.1.jar"/>
<resource-root path="wagon-http-2.6.jar"/>
<resource-root path="wagon-http-shared-2.6.jar"/>
<resource-root path="wagon-provider-api-2.6.jar"/>
<resource-root path="xmlbeans-2.3.0.jar"/>
<resource-root path="xmlpull-1.1.3.1.jar"/>
<resource-root path="xpp3_min-1.1.4c.jar"/>
<resource-root path="xstream-1.4.9.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="org.slf4j"/>
</dependencies>
</module>
Thanks
Senthil
I am currently migrating apps from JBoss 5.1 to JBoss 7.0 EAP server.
I have added a module to JBoss server named - org.springframework for spring dependency jars
<?xml version="1.0" ?>
<module xmlns="urn:jboss:module:1.1" name="org.springframework">
<resources>
<resource-root path="spring-core-3.0.5.RELEASE.jar"/>
<resource-root path="spring-context-3.0.5.RELEASE.jar"/>
<resource-root path="spring-beans-3.0.5.RELEASE.jar"/>
<resource-root path="spring-expression-3.0.5.RELEASE.jar"/>
<resource-root path="spring-web-3.0.5.RELEASE.jar"/>
<resource-root path="spring-aop-3.0.5.RELEASE.jar"/>
<resource-root path="spring-asm-3.0.5.RELEASE.jar"/>
<resource-root path="spring-jdbc-3.0.5.RELEASE.jar"/>
<resource-root path="spring-tx-3.0.5.RELEASE.jar"/>
<resource-root path="org.springframework.web.servlet-3.0.0.M3.jar"/>
<resource-root path="commons-logging-1.1.1.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.servlet.jsp.api"/>
<module name="javax.faces.api"/>
</dependencies>
</module>
I have defined the module dependency in jboss-deployment-structure.xml of the WAR
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="com.oracle" />
<module name="org.springframework" />
</dependencies>
</deployment>
</jboss-deployment-structure>
The war deployed to server also contains spring-context-3.0.5.RELEASE.jar in its WEB-INF/lib folder
So I think the required jar - spring-context-3.0.5.RELEASE.jar exists in class path. But still I am getting the below error :
04:33:30,496 INFO [org.springframework.beans.factory.xml.XmlBeanDefinitionReader] (default task-19) Loading XML bean definitions from class path resource [core_services.xml]
04:33:30,507 INFO [org.springframework.beans.factory.support.DefaultListableBeanFactory] (default task-19) Pre-instantiating singletons in org.springframework.beans.fact
ory.support.DefaultListableBeanFactory#9b765aa: defining beans [LogService,CacheService,PropertyService]; root of factory hierarchy
2017.02.09 04:33:30 ERROR CashViewsPortalServiceImpl(-2): org/springframework/context/support/ClassPathXmlApplicationContext
CallStack=java.lang.NoClassDefFoundError: org/springframework/context/support/ClassPathXmlApplicationContext
at com.karthik.common.service.Services.getService(Services.java:31)
at com.karthik.data.service.DataServices.getService(DataServices.java:18)
at com.karthik.portal.server.PortalServiceImpl.getInitializeInfo(PortalServiceImpl.java:83)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:561)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:265)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:305)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:62)
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:43)
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:57)
1) Why do we need add module in Jboss 7 EAP server for class loading even though the jars are bundled in WEB-INF/lib folder of the war
deployed on server?
2) How to resolve the above error?
I think you have n't defined the spring dependencies perfectly. Below are the steps:
You can define Spring as a module
The following are steps to create a Spring module:
1.Download the desired version of Spring. For this example we are using Spring 3.1.1.
2.Create the directory: $JBOSS_HOME/modules/org/springframework/spring/main.
3.Copy the Spring libraries you downloaded to that directory.
4.Create module.xml with the following contents under that directory. Make sure these correspond to the libraries' names:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.springframework.spring">
<resources>
<resource-root path="org.springframework.aop-3.1.1.RELEASE.jar"/>
<resource-root path="org.springframework.asm-3.1.1.RELEASE.jar"/>
<resource-root path="org.springframework.aspects-3.1.1.RELEASE.jar"/>
<resource-root path="org.springframework.beans-3.1.1.RELEASE.jar"/>
<resource-root path="org.springframework.context-3.1.1.RELEASE.jar"/>
<resource-root path="org.springframework.context.support-3.1.1.RELEASE.jar"/>
<resource-root path="org.springframework.core-3.1.1.RELEASE.jar"/>
<resource-root path="org.springframework.expression-3.1.1.RELEASE.jar"/>
<resource-root path="org.springframework.instrument-3.1.1.RELEASE.jar"/>
<resource-root path="org.springframework.instrument.tomcat-3.1.1.RELEASE.jar"/>
<resource-root path="org.springframework.jdbc-3.1.1.RELEASE.jar"/>
<resource-root path="org.springframework.jms-3.1.1.RELEASE.jar"/>
<resource-root path="org.springframework.orm-3.1.1.RELEASE.jar"/>
<resource-root path="org.springframework.oxm-3.1.1.RELEASE.jar"/>
<resource-root path="org.springframework.test-3.1.1.RELEASE.jar"/>
<resource-root path="org.springframework.transaction-3.1.1.RELEASE.jar"/>
<resource-root path="org.springframework.web-3.1.1.RELEASE.jar"/>
<resource-root path="org.springframework.web.portlet-3.1.1.RELEASE.jar"/>
<resource-root path="org.springframework.web.servlet-3.1.1.RELEASE.jar"/>
<resource-root path="org.springframework.web.struts-3.1.1.RELEASE.jar"/>
</resources>
<dependencies>
<module name="org.apache.commons.logging"/>
<module name="javax.api" export="true"/>
<module name="org.jboss.vfs"/>
</dependencies>
</module>
Here is an absolute minimal module.xml (the different Spring version is irrelevant):
<?xml version="1.0"?>
<module xmlns="urn:jboss:module:1.1" name="org.springframework.spring">
<resources>
<resource-root path="spring-aop-3.2.3.RELEASE.jar"/>
<resource-root path="spring-beans-3.2.3.RELEASE.jar"/>
<resource-root path="spring-context-3.2.3.RELEASE.jar"/>
<resource-root path="spring-core-3.2.3.RELEASE.jar"/>
<resource-root path="spring-expression-3.2.3.RELEASE.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="org.apache.commons.logging"/>
</dependencies>
</module>
5.Put the following jboss-deployment-structure.xml in your application archive (WEB-INF/jboss-deployment-structure.xml for WAR or META-INF/jboss-deployment-structure.xml for EAR or EJB-jar) to use the above module:
If you're using JBoss EAP 6.1.x and greater or EAP 7, then use below:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="org.springframework.spring" export="true" meta-inf="export"/>
</dependencies>
</deployment>
</jboss-deployment-structure>
If JBoss EAP 6.0.x, then use below
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="org.springframework.spring" export="true">
<imports>
<include path="META-INF**"/>
<include path="org**"/>
</imports>
<exports>
<include path="META-INF**"/>
<include path="org**"/>
</exports>
</module>
</dependencies>
</deployment>
</jboss-deployment-structure>
Note: The meta-inf on the module in the jboss-deployment-structure.xml was added in JBoss EAP 6.1.0, which allows the files in the META-INF of a resource to be visible. Since this was not available in JBoss EAP 6.0.x, the section allows you to get access to the META-INF directory which is not visible by default.
Note: The Spring Framework module should not include resources such as servlet-api.jar, xml-apis.jar, jta-api.jar, and other APIs. These APIs are implemented by either the JDK or JBoss and trying to use a different version of the API will lead to classloading issues and other problems.
Note: The Spring module should include all of its non Java / JavaEE dependencies. The Spring module can depend on javax.api / javaee.api provided by JBoss and any public JBoss module, but for other dependencies Spring has such as aopalliance, they would need to be included as resources in the module or in another custom module.
I'm trying to simplify the provisioning of JBoss EAP 6 applications by adding common components to the base EAP 6 installation directory (e.g. ojdbc driver).
For the WMQ JCA resource adapter, I have everything working just fine if I put the 'wmq.jmsra.rar' archive in the 'deployments' folder. I just need to configure the resource-adapters section of the standalone.xml file according to the official documentation.
Now, is it possible to create a JBoss module and include it via the 'global-modules' section? I tried creating a module wmq.ra with resource-root wmq.jmsra.rar, but the module won't load.
I may have found the answer i was looking for. I ran into post about the similar issue for Active MQ here and here. I followed the same canvas for WMQ:
unpack the wmq.jmsra.rar in your module directory (e.g. modules/wmq/jmsra/main/)
create a module.xml descriptor for you module
this one worked for me with WMQ 7.5.0.3. I had problems when some of the dependencies were missing
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="wmq.jmsra">
<resources>
<resource-root path="."/>
<resource-root path="com.ibm.mq.commonservices.jar"/>
<resource-root path="com.ibm.mq.connector.jar"/>
<resource-root path="com.ibm.mq.headers.jar"/>
<resource-root path="com.ibm.mq.jar"/>
<resource-root path="com.ibm.mq.jmqi.jar"/>
<resource-root path="com.ibm.mq.jmqi.local.jar"/>
<resource-root path="com.ibm.mq.jmqi.remote.jar"/>
<resource-root path="com.ibm.mq.jmqi.system.jar"/>
<resource-root path="com.ibm.mq.jms.admin.jar"/>
<resource-root path="com.ibm.mq.pcf.jar"/>
<resource-root path="com.ibm.mqjms.jar"/>
<resource-root path="com.ibm.msg.client.commonservices.j2se.jar"/>
<resource-root path="com.ibm.msg.client.commonservices.jar"/>
<resource-root path="com.ibm.msg.client.jms.internal.jar"/>
<resource-root path="com.ibm.msg.client.jms.jar"/>
<resource-root path="com.ibm.msg.client.matchspace.jar"/>
<resource-root path="com.ibm.msg.client.provider.jar"/>
<resource-root path="com.ibm.msg.client.ref.jar"/>
<resource-root path="com.ibm.msg.client.wmq.common.jar"/>
<resource-root path="com.ibm.msg.client.wmq.factories.jar"/>
<resource-root path="com.ibm.msg.client.wmq.jar"/>
<resource-root path="com.ibm.msg.client.wmq.v6.jar"/>
<resource-root path="dhbcore.jar"/>
</resources>
<dependencies>
<module name="javax.api"/>
<module name="javax.resource.api"/>
<module name="javax.jms.api"/>
<module name="javax.management.j2ee.api"/>
</dependencies>
</module>
import your module the usual way in standalone.xml
I didn't fully validate this solution in production like environment, I'll update if needed.
You can refer to EAP6 and WebSphere MQ Integration document for installing and configuring the resource adapter.
Hi StackOverflow Community,
I have a WAR which I have deployed to a JBoss Wildfly 8.2 instance. Also in Wildfly, I have created two modules:
a third party JMS JCA adapter module,
and a model module (model.jar) that contains message classes used to communicate between the JMS broker and the WAR
The WAR has a jboss-deployment-structure.xml that declares a dependency on the JCA module:
<?xml version='1.0' encoding='UTF-8'?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">
<deployment>
<dependencies>
<module name="com.thirdparty.mq.ra" slot="main"/>
<module name="com.company.model" slot="main">
</dependencies>
</deployment>
</jboss-deployment-structure>
The WAR has the model.jar file packaged in its WEB-INF/lib folder.
The JMS module has a dependency on the model module:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.3" name="com.thirdparty.mq.ra">
<resources>
<resource-root path="."/>
<resource-root path="thirdparty-jms-provider.jar"/>
...
<resource-root path="thirdparty-lib.jar"/>
</resources>
<dependencies>
<module name="com.company.model"/>
<module name="javax.api"/>
<module name="javax.jms.api"/>
<module name="javax.transaction.api"/>
<module name="javax.management.j2ee.api"/>
<module name="javax.resource.api"/>
<module name="org.jboss.invocation"/>
<module name="org.jboss.remote-naming" optional="true"/>
<module name="org.slf4j"/>
</dependencies>
</module>
When running, I get the following exception:
Caused by: java.lang.ClassCastException: com.company.model.web.dto.WebAuthenticationResponse cannot be cast to com.company.model.web.dto.WebAuthenticationResponse
I suspect it is a classloader issue. Is there some extra information I have to specify in the module.xml or jboss-deployment-structure.xml files?
Thanks for your help!
Assuming that your model.jar corresponds to your com.company.model module, your WAR classloader now sees the model classes twice, both from its own libraries in WEB-INF/lib and via the module dependency.
You should either import or embed a module/library, but not both.
By the way, importing a RAR module looks a bit suspicious. You should never depend on the implementation of a resource adapter. Maybe you can factor out an API module and import that.
Im trying to create a jms bridge from WildFly 8 to openmq. Every example i tried did not work. Can someone help me. I never have created a jms bridge before.
The jms-bridge entry in my standalone-full.xml
<source>
<connection-factory name="jms/ConnectionFactory"/>
<destination name="jms/TestQueue"/>
<context>
<property key="java.naming.factory.initial" value="com.sun.enterprise.naming.SerialInitContextFactory"/>
<property key="java.naming.provider.url" value="mq://localhost:7676"/>
</context>
</source>
<target>
<connection-factory name="jmsConnectionFactory"/>
<destination name="/"jms/TestQueue"/>
</target>
<quality-of-service>AT_MOST_ONCE</quality-of-service>
<failure-retry-interval>500</failure-retry-interval>
<max-retries>1</max-retries>
<max-batch-size>500</max-batch-size>
<max-batch-time>500</max-batch-time>
<add-messageID-in-header>true</add-messageID-in-header>
</jms-bridge>
I created a module from imqjmsra.rar.
The module.xml
<resource-root path="fscontext.jar"/>
<resource-root path="imqbroker.jar"/>
<resource-root path="imqjmsbridge.jar"/>
<resource-root path="imqjmsra.jar"/>
<resource-root path="imqjmx.jar"/>
<resource-root path="imqstomp.jar"/>
<!-- add the dependencies required by JMS Bridge code -->
<module name="javax.api" />
<module name="javax.jms.api" />
<module name="javax.transaction.api"/>
<module name="javax.resource.api"/>
The error that i get is
2014-04-04 14:36:04,846 WARN [org.hornetq.jms.server] (pool-3-thread-1) HQ122010: Failed to connect JMS Bridge: javax.naming.NamingException: JBAS011843: Failed instantiate InitialContextFactory com.sun.enterprise.naming.SerialInitContextFactory from classloader ModuleClassLoader for Module "org.glassfish:main" from local module loader #6b573f80 (finder: local module finder #2d0a238e (roots: C:\Installs\JBoss\wildfly-8.0.0.Final\modules,C:\Installs\JBoss\wildfly-8.0.0.Final\modules\system\layers\base)) [Root exception is java.lang.ClassNotFoundException: com.sun.enterprise.naming.SerialInitContextFactory from [Module "org.glassfish:main" from local module loader #6b573f80 (finder: local module finder #2d0a238e (roots: C:\Installs\JBoss\wildfly-8.0.0.Final\modules,C:\Installs\JBoss\wildfly-8.0.0.Final\modules\system\layers\base))]]
at org.jboss.as.naming.InitialContext.getDefaultInitCtx(InitialContext.java:116)
at org.jboss.as.naming.InitialContext.init(InitialContext.java:99)
at javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:153) [rt.jar:1.7.0_45]
at org.jboss.as.naming.InitialContext.<init>(InitialContext.java:90)
at org.jboss.as.naming.InitialContextFactory.getInitialContext(InitialContextFactory.java:44)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684) [rt.jar:1.7.0_45]
at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:307) [rt.jar:1.7.0_45]
at javax.naming.InitialContext.init(InitialContext.java:242) [rt.jar:1.7.0_45]
at javax.naming.InitialContext.<init>(InitialContext.java:216) [rt.jar:1.7.0_45]
at org.hornetq.jms.bridge.impl.JNDIFactorySupport.createObject(JNDIFactorySupport.java:53)
at org.hornetq.jms.bridge.impl.JNDIDestinationFactory.createDestination(JNDIDestinationFactory.java:38)
at org.hornetq.jms.bridge.impl.JMSBridgeImpl.setupJMSObjects(JMSBridgeImpl.java:1217)
at org.hornetq.jms.bridge.impl.JMSBridgeImpl.setupJMSObjectsWithRetry(JMSBridgeImpl.java:1457)
at org.hornetq.jms.bridge.impl.JMSBridgeImpl.access$2000(JMSBridgeImpl.java:76)
at org.hornetq.jms.bridge.impl.JMSBridgeImpl$FailureHandler.run(JMSBridgeImpl.java:2046)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
I figured it out. I needed to change module.xml file to
<module xmlns="urn:jboss:module:1.0" name="org.glassfish">
<resources>
<resource-root path="glassfish-embedded-all-3.1.1.jar"/>
</resources>
<dependencies>
<system export="true">
<paths>
<path name="sun/corba"/>
</paths>
</system>
<module name="javax.api" />
<module name="javax.jms.api" />
<module name="javax.transaction.api"/>
<module name="javax.resource.api"/>
<module name="javax.rmi.api"/>
</dependencies>
</module>