EAR built using build.gradle not deploying properly - java

I'm using build.gradle to build an EAR.
buildscript
{
repositories
{
mavenCentral();
maven{url "https://repository.jboss.org/nexus/content/repositories/releases/"}
}
configurations
{
compile
testCompile
testRuntime
jacoco
}
dependencies{classpath 'org.ajoberstar:gradle-jacoco:0.3.0'}
}
allprojects
{
group='com.sial.ecommerce'
version=''
repositories
{
mavenCentral();
maven{url"https://repository.jboss.org/nexus/content/repositories/releases/"}
}
apply plugin:'java'
apply plugin:'jacoco';
apply plugin: 'ear'
dependencies
{
deploy project(path:':app', configuration: 'archives');
deploy project(path:':firstEJB', configuration: 'archives');
}
ear
{
version = "";
archiveName ="XYZ.ear";
appDirName 'EarContent'
duplicatesStrategy = DuplicatesStrategy.EXCLUDE;
caseSensitive = true;
rootSpec.exclude("**/activation-1.1.jar");
rootSpec.exclude("**/asm*.jar");
rootSpec.exclude("**/jboss-*.jar");
rootSpec.exclude("**/org.jacoco*.jar");
rootSpec.exclude("**/wildfly-*.jar");
rootSpec.exclude("**/hibernate-*.jar");
rootSpec.exclude("**/gradle-*.jar");
rootSpec.exclude("**/cdi-*.jar");
rootSpec.exclude("**/org.osgi.*.jar");
rootSpec.exclude("**/serializer-*.jar");
rootSpec.exclude("**/arquillian-*.jar");
rootSpec.exclude("**/resteasy-*.jar");
rootSpec.exclude("**/guava-*.jar");
rootSpec.exclude("**/jackson-jaxrs-*.jar");
rootSpec.exclude("**/jackson-core-asl-*.jar");
rootSpec.exclude("**/jackson-mapper-asl-*.jar");
rootSpec.exclude("**/reflections-*.jar");
rootSpec.exclude("**/metrics-core-*.jar");
rootSpec.exclude("**/servo-core-*.jar");
rootSpec.exclude("**/aspectjweaver-*.jar");
rootSpec.exclude("**/javax.json-*.jar");
rootSpec.exclude("**/jaxrs-api-*.jar");
rootSpec.exclude("**/javax.mail-*.jar");
rootSpec.exclude("**/validation-api-*.jar");
rootSpec.exclude("**/javassist-*.jar");
rootSpec.exclude("**/dom4j-*.jar");
rootSpec.exclude("**/annotations-*.jar");
rootSpec.exclude("**/javax.inject-*.jar");
rootSpec.exclude("**/xalan-*.jar");
rootSpec.exclude("**/el-api-*.jar");
rootSpec.exclude("**/jsr250-api-*.jar");
rootSpec.exclude("**/xml-apis-*.jar");
rootSpec.exclude("**/slf4j-api-1.7.6.jar");
}
}
Its built structure:
XYZ.ear
|
|------------- lib
|-------------META-INF
|--------------firstEJB.jar
|--------------app.war
When I try to deploy, classes in firstEJB.jar cannot be accesed.
I'm getting an error:
15:49:24,583 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.deployment.subunit."XYZ.ear"."app.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."XYZ.ear"."app.war".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of subdeployment "app.war" of deployment "XYZ.ear"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166) [wildfly-server-8.0.0.Final.jar:8.0.0.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_71]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_71]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_71]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: java.lang.ClassNotFoundException: com.sial.ecommerce.core.init.DeepInit from [Module "deployment.XYZ.ear.app.war:main" from Service Module Loader]
at org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.checkDeclaredApplicationClassAsServlet(JaxrsScanningProcessor.java:292)
at org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.scanWebDeployment(JaxrsScanningProcessor.java:154)
at org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.deploy(JaxrsScanningProcessor.java:105)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159) [wildfly-server-8.0.0.Final.jar:8.0.0.Final]
... 5 more
Caused by: java.lang.ClassNotFoundException: com.sial.ecommerce.core.init.DeepInit from [Module "deployment.XYZ.ear.app.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final]
at org.jboss.as.jaxrs.deployment.JaxrsScanningProcessor.checkDeclaredApplicationClassAsServlet(JaxrsScanningProcessor.java:290)
DeepInit class is in firstEJB.jar
When I started the Wildfly server in debug mode and tried to debug, I found that the directory looking for the class is different from the expected one.
It looks in :
C:/Apps/wildfly-8.0.0.Final/bin/content/XYZ.ear/lib
which is invalid.
Expected directory is :
C:/Apps/wildfly-8.0.0.Final/standalone/deployments/XYZ.ear
While doing deployment using exploded method(i.e. right clicking and adding the project in wildfly server) it works fine.
application.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/application_7.xsd" id="Application_ID" version="7">
<display-name>ABC</display-name>
<module>
<web>
<web-uri>app.war</web-uri>
<context-root>app</context-root>
</web>
</module>
<module><ejb>myfirstEJB.jar</ejb></module>
</application>
I wonder how "C:/Apps/wildfly-8.0.0.Final/bin/content/XYZ.ear/lib" is being used, since I'm not setting this anywhere.
Can someone please help me find a way to change the directory to
C:/Apps/wildfly-8.0.0.Final/standalone/deployments/XYZ.ear
so I can access classes in firstEJB.jar?

Related

Jakarta EE with Apache Shiro

I am using Wildfly webserver, and trying to implement Apache Shiro within Jakarta EE application, unfortunately I am getting this error:
16:49:36,189 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 1) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "testjee8-1.0-SNAPSHOT")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"testjee8-1.0-SNAPSHOT.war\".undertow-deployment.UndertowDeploymentInfoService" => "Failed to start service
Caused by: java.lang.NoClassDefFoundError: Failed to link org/apache/shiro/web/servlet/ShiroFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/AbstractShiroFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/OncePerRequestFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/NameableFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/AbstractFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): javax/servlet/Filter"}}
16:49:36,190 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 1) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "testjee8-1.0-SNAPSHOT")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"testjee8-1.0-SNAPSHOT.war\".undertow-deployment.UndertowDeploymentInfoService" => "Failed to start service
Caused by: java.lang.NoClassDefFoundError: Failed to link org/apache/shiro/web/servlet/ShiroFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/AbstractShiroFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/OncePerRequestFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/NameableFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/AbstractFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): javax/servlet/Filter"}}
16:49:36,190 ERROR [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0021: Deploy of deployment "testjee8-1.0-SNAPSHOT.war" was rolled back with the following failure message:
{"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"testjee8-1.0-SNAPSHOT.war\".undertow-deployment.UndertowDeploymentInfoService" => "Failed to start service
Caused by: java.lang.NoClassDefFoundError: Failed to link org/apache/shiro/web/servlet/ShiroFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/AbstractShiroFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/OncePerRequestFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/NameableFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/AbstractFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): javax/servlet/Filter"}}
16:49:36,214 INFO [org.jboss.as.server.deployment] (MSC service thread 1-3) WFLYSRV0028: Stopped deployment testjee8-1.0-SNAPSHOT (runtime-name: testjee8-1.0-SNAPSHOT.war) in 23ms
[2023-01-02 04:49:36,249] Artifact testjee8:war exploded: Error during artifact deployment. See server log for details.
[2023-01-02 04:49:36,250] Artifact testjee8:war exploded: java.lang.Exception: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"testjee8-1.0-SNAPSHOT.war\".undertow-deployment.UndertowDeploymentInfoService" => "Failed to start service
Caused by: java.lang.NoClassDefFoundError: Failed to link org/apache/shiro/web/servlet/ShiroFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/AbstractShiroFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/OncePerRequestFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/NameableFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): Failed to link org/apache/shiro/web/servlet/AbstractFilter (Module \"deployment.testjee8-1.0-SNAPSHOT.war\" from Service Module Loader): javax/servlet/Filter"}}
looks like the class is not found...
The following web.xml and shiro.ini (placed in WEB-INF) as follows:
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_5_0.xsd"
version="5.0">
<context-param>
<param-name>shiroConfigLocations</param-name>
<param-value>/WEB-INF/shiro.ini</param-value>
</context-param>
<listener>
<listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class>
</listener>
<filter>
<filter-name>ShiroFilter</filter-name>
<filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>ShiroFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
</web-app>
Shiro.ini:
[main]
[urls]
/** = noSessionCreation,authcJWT[permissive]
Forgot to add the pom.xml:
...
<dependency>
<groupId>org.apache.shiro</groupId>
<artifactId>shiro-web</artifactId>
<version>1.10.0</version>
</dependency>
...
Please help me how to address this issue!
Unfortunately, Apache Shiro is not compatible with Jarkarta namespace yet. According to Apache Shiro's [publication]: https://shiro.apache.org/blog/2022/06/30/jakarta-work.html, version 1.10.0 of Shiro was supposed to be shipped with jakarta but unfortunately as of this writing their latest version, being 1.10.1, does not come with the jakarta namespace yet.

How to debug ClassNotFoundException: org.apache.struts2.tiles.StrutsTilesListener?

The error:
2016-04-12 12:32:04,399 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] (ServerService Thread Pool -- 62) HHH000230: Schema export complete
2016-04-12 12:32:04,753 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./BanqueEEWeb.UndertowDeploymentInfoService: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./BanqueEEWeb.UndertowDeploymentInfoService: java.lang.ClassNotFoundException: org.apache.struts2.tiles.StrutsTilesListener from [Module "deployment.BanqueEE.ear.BanqueEEWeb.war:main" from Service Module Loader]
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.createServletConfig(UndertowDeploymentInfoService.java:870)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.start(UndertowDeploymentInfoService.java:242)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881) [jboss-msc-1.2.0.Final.jar:1.2.0.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [rt.jar:1.8.0_66]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.8.0_66]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.8.0_66]
Caused by: java.lang.ClassNotFoundException: org.apache.struts2.tiles.StrutsTilesListener from [Module "deployment.BanqueEE.ear.BanqueEEWeb.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197) [jboss-modules.jar:1.3.0.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:443) [jboss-modules.jar:1.3.0.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:431) [jboss-modules.jar:1.3.0.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:373) [jboss-modules.jar:1.3.0.Final]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:118) [jboss-modules.jar:1.3.0.Final]
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.addListener(UndertowDeploymentInfoService.java:1145)
at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService.createServletConfig(UndertowDeploymentInfoService.java:734)
... 6 more
2016-04-12 12:32:05,109 INFO [org.jboss.weld.Bootstrap] (weld-worker-4) WELD-000119: Not generating any bean definitions from org.apache.struts2.tiles.StrutsTilesListener because of underlying class loading error: Type org.apache.struts2.tiles.StrutsTilesListener from [Module "deployment.BanqueEE.ear.BanqueEEWeb.war:main" from Service Module Loader] not found. If this is unexpected, enable DEBUG logging to see the full error.
2016-04-12 12:32:07,323 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) JBAS014613: Operation ("deploy") failed - address: ([("deployment" => "BanqueEE.ear")]) - failure description: {"JBAS014671: Failed services" => {"jboss.undertow.deployment.default-server.default-host./BanqueEEWeb.UndertowDeploymentInfoService" => "org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./BanqueEEWeb.UndertowDeploymentInfoService: java.lang.ClassNotFoundException: org.apache.struts2.tiles.StrutsTilesListener from [Module \"deployment.BanqueEE.ear.BanqueEEWeb.war:main\" from Service Module Loader]
Caused by: java.lang.ClassNotFoundException: org.apache.struts2.tiles.StrutsTilesListener from [Module \"deployment.BanqueEE.ear.BanqueEEWeb.war:main\" from Service Module Loader]"}}
2016-04-12 12:32:07,408 INFO [org.jboss.as.server] (ServerService Thread Pool -- 34) JBAS018559: Deployed "BanqueEE.ear" (runtime-name : "BanqueEE.ear")
2016-04-12 12:32:07,410 INFO [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report
JBAS014777: Services which failed to start: service jboss.undertow.deployment.default-server.default-host./BanqueEEWeb.UndertowDeploymentInfoService: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./BanqueEEWeb.UndertowDeploymentInfoService: java.lang.ClassNotFoundException: org.apache.struts2.tiles.StrutsTilesListener from [Module "deployment.BanqueEE.ear.BanqueEEWeb.war:main" from Service Module Loader]
How to debug this error in Struts 2?
You have missed a library struts2-tiles-plugin-x.x.x.x.jar and probably their dependencies.
What you need is to add these libraries to the Deployment Assembly. It will help you to archive ear project and include dependencies that have equivalent manifest settings in their classpath.
If you want to know what is a Deployment Assembly you can read this article Eclipse : Java EE Module Dependencies is replaced by Web Deployment Assembly.
“Web Deployment Assembly“, which provide more powerful and flexible ways to configure the project packaging structure.
There's also a page that describes the process of linking external resources with the ear application: Web Application Development: Configuring Projects with External Resources.
Do you have some javaee api jar in your war ? Maybe a servlet.jar ? Please remove it, and check after that.

Wildfly 9.0.2-Final ClassNotFoundException for Struts 1.x

While deploying app.war (Struts 1.x) on my Wildfly this information appears:
Cannot upload deployment: {"WFLYCTL0080: Failed services" =>
{"jboss.deployment.unit.\"app.war\".POST_MODULE" =>
"org.jboss.msc.service.StartException in service
jboss.deployment.unit.\"app.war\".POST_MODULE: WFLYSRV0153: Failed to
process phase POST_MODULE of deployment \"app.war\" Caused by:
java.lang.RuntimeException: WFLYSRV0177: Error getting reflective
information for class org.ajaxtags.tags.AjaxDisplayTag with
ClassLoader ModuleClassLoader for Module \"deployment.app.war:main\"
from Service Module Loader Caused by: java.lang.NoClassDefFoundError:
au/id/jericho/lib/html/Segment Caused by:
java.lang.ClassNotFoundException: au.id.jericho.lib.html.Segment from
[Module \"deployment.app.war:main\" from Service Module Loader]"}}
I have downloaded jericho-html-2.6.1-sources.jar and placed this as a module into ${wf-dir}\modules\system\layers\base\au\id\jericho\lib\html\main\ with an module.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.3" name="au.id.jericho.lib.html">
<resources>
<resource-root path="jericho-html-2.6.1-sources.jar"/>
</resources>
<dependencies>
</dependencies>
</module>
And there's still same issue...
Thanks for any help! :)
This was fixed by changing build system from Ant to Maven - looks like Wildfly has some problem while resolving directory conventions. On Glassfish 3.1.1 this worked with Ant

How to add lib into modules in wildfly 8.2 Final?

I'm trying to deploy my jar using appclient but i get this error.
This is my deploy command
C:\wildfly-8.2.0.Final\bin>appclient socket-gateway.jar
16:56:03,155 ERROR [org.jboss.msc.service.fail] (MSC service thread
1-16) MSC000001: Failed to start service
jboss.deployment.unit."socket-gateway.jar".POST_MODULE:
org.jboss.msc.service.StartException in service
jboss.deployment.unit."socket-gateway.jar".POST_MODULE: JBAS018733:
Failed to process phase POST_MODULE ofdeployment "socket-gateway.jar"
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:166)
[wildfly-server-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)
[jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)
[jboss-msc-1.2.2.Final.jar:1.2.2.Final]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[rt.jar:1.7.0_71]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[rt.jar:1.7.0_71]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_71] Caused by: java.lang.RuntimeException: JBAS014187: Could not load view
com.switching.serverapi.ServiceManagerBeanRemote
at org.jboss.as.ejb3.deployment.processors.EjbRefProcessor.processDescriptorEntries(EjbRefProcessor.java:99)
at org.jboss.as.ee.component.deployers.AbstractDeploymentDescriptorBindingsProcessor.deploy(AbstractDeploymentDescriptorBindingsProcessor.java:95)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:159)
[wildfly-server-8.2.0.Final.jar:8.2.0.Final]
... 5 more Caused by: java.lang.ClassNotFoundException: com.serverapi.ServiceManagerBeanRemote from [Module
"deployment.socket-gateway.jar:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:213)
[jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459)
[jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408)
[jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389)
[jboss-modules.jar:1.3.3.Final]
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134)
[jboss-modules.jar:1.3.3.Final]
at java.lang.Class.forName0(Native Method) [rt.jar:1.7.0_71]
at java.lang.Class.forName(Class.java:274) [rt.jar:1.7.0_71]
at org.jboss.as.server.deployment.reflect.DeploymentClassIndex.classIndex(DeploymentClassIndex.java:54)
[wildfly-server-8.2.0.Final.jar:8.2.0.Final]
at org.jboss.as.ejb3.deployment.processors.EjbRefProcessor.processDescriptorEntries(EjbRefProcessor.java:97)
... 7 more
16:56:03,167 ERROR [org.jboss.as.controller.management-operation]
(Thread-43) JBAS014613: Operation ("deploy") failed - address:
([("deployment" => "socket-gate way.jar")]) - failure description:
{"JBAS014671: Failed services" =>
{"jboss.deployment.unit.\"socket-gateway.jar\".POST_MODULE" =>
"org.jboss.msc.service.Start Exception in service
jboss.deployment.unit.\"socket-gateway.jar\".POST_MODULE: JBAS018733:
Failed to process phase POST_MODULE of deployment
\"socket-gateway.jar\" Caused by: java.lang.RuntimeException:
JBAS014187: Could not load view
com.switching.serverapi.ServiceManagerBeanRemote Caused by:
java.lang.ClassNotFoundException:
com.switching.serverapi.ServiceManagerBeanRemote from [Module
\"deployment.socket-gateway.jar:main\" from Service Module Loader]"}}
16:56:03,170 ERROR [org.jboss.as.server] (Thread-43) JBAS015870:
Deploy of deployment "socket-gateway.jar" was rolled back with the
following failure message: {"JBAS014671: Failed services" =>
{"jboss.deployment.unit.\"socket-gateway.jar\".POST_MODULE" =>
"org.jboss.msc.service.StartException in service jboss.deployme
nt.unit.\"socket-gateway.jar\".POST_MODULE: JBAS018733: Failed to
process phase POST_MODULE of deployment \"socket-gateway.jar\" Caused
by: java.lang.RuntimeException: JBAS014187: Could not load view
com.switching.serverapi.ServiceManagerBeanRemote Caused by:
java.lang.ClassNotFoundException:
com.switching.serverapi.ServiceManagerBeanRemote from [Module
\"deployment.socket-gateway.jar:main\" from Service Module Loader]"}}
16:56:03,197 INFO [org.jboss.as.server.deployment] (MSC service thread
1-9) JBAS015877: Stopped deployment socket-gateway.jar (runtime-name:
socket-gateway.jar ) in 26ms 16:56:03,198 INFO
[org.jboss.as.controller] (Thread-43) JBAS014774: Service status
report JBAS014777: Services which failed to start: service
jboss.deployment.unit ."socket-gateway.jar".POST_MODULE
From that error it clearly said " java.lang.ClassNotFoundException: com.serverapi.ServiceManagerBeanRemote from [Module "deployment.socket-gateway.jar:main" from Service Module Loader]".
And i already read the redhat documentation
using that references , i make folder in "C:\wildfly-8.2.0.Final\modules\com\switching\serverapi" and put the serverapi.jar (this jar where the code for com.serverapi.ServiceManagerBeanRemote )
but i still have same problems. Anyone can help me?
Thank you
i think the folder you have made is not in the right directory. It should be under:
[WidlFly-HOME]\modules\system\layers\base .. \com\switching\serverapi\serverapi.jar

Error deploying jar file on jboss-as-7.1.1

I have the following situation:
I have a java application with three projects:
Java Project
EJB Module
Web Project
using net beans, I build the three projects and upload them on the server.
The Java Project deploy successfully but the EJB Module which depends on the Java Project gives the following error:
12:35:00,811 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."MyApp.jar".POST_MODULE: org.jboss.msc.service$
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.6.0_20]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.6.0_20]
at java.lang.Thread.run(Thread.java:636) [rt.jar:1.6.0_20]
Caused by: java.lang.RuntimeException: Error getting reflective information for class gss.myapp.sessions.CardValidatorBean with ClassLoader ModuleClassLoader for Module "deplo$
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:58)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:85)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:70)
at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:55)
at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 5 more
Caused by: java.lang.NoClassDefFoundError: gss/commons/exceptions/BusinessEntityFindException
at java.lang.Class.getDeclaredFields0(Native Method) [rt.jar:1.6.0_20]
at java.lang.Class.privateGetDeclaredFields(Class.java:2308) [rt.jar:1.6.0_20]
at java.lang.Class.getDeclaredFields(Class.java:1760) [rt.jar:1.6.0_20]
at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
... 10 more
Caused by: java.lang.ClassNotFoundException: gss.commons.exceptions.BusinessEntityFindException from [Module "deployment.MyApp.jar:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)
... 15 more
The exception clearly states that it could not find the class
gss.commons.exceptions.BusinessEntityFindException
Your ejb jar file MANIFEST.MF should contain the classpath it needs
e.g
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.8.1
Created-By: 1.6.0_25-b06 (Sun Microsystems Inc.)
Class-Path: your-java-project.jar
and make sure you include your your-java-project.jar in your server classpath.
You need add gss.commons.exceptions.BusinessEntityFindException class to JBoss:
I'll call YOUR_JAR.jar to the jar that contains gss/commons/exceptions/BusinessEntityFindException
1: Add a Module to JBoss
Stop your JBoss Server
Find YOUR_JAR.jar on your directory
Make the next directory on your JBoss: JBOSS_HOME/modules/org/gss/main
Put YOUR_JAR.jar on this directory
Make a file called module.xml and add:
<
<?xml version="1.0" encoding="UTF-8"?>
<module xmlns="urn:jboss:module:1.1" name="org.gss">
<resources>
<resource-root path="YOUR_JAR.jar"/>
</resources>
</module>
*
2: Call your new module from your project:
On your web project make a file WEB-INF/jboss-deployment-structure.xml
add:
<
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure>
<deployment>
<dependencies>
<module name="org.gss" meta-inf="export">
<imports>
<include path="META-INF" />
</imports>
</module>
</dependencies>
</deployment>
</jboss-deployment-structure>
start your Jboss Server

Categories

Resources