Below are exceptions and the solutions I applied while developing a remote client enterprise application.
To start with, enable debug for your application server to see the detail and good luck troubleshooting.
Exceptions :
Starting with java.lang.ClassNotFoundException: org.hibernate.collection.internal.Persistent.........
Solution :
I fixed the exception be adding hibernate Entity Manager Dependencies.
Exception:
Error javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
Solution:
Add JBOSS-CLIENT Dependencies to your project
Exception:
IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling
Solution:
Confirm that your EJB module have been deployed.
Exception:
org.jboss.naming.remote.client.initialcontextfactory wildfly
javax.naming.NamingException: WFLYNAM0027: Failed instantiate InitialContextFactory org.jboss.naming.remote.client.InitialContextFactory from classloader
javax.naming.namenotfoundexception while trying to lookup ejb
Caused by: org.jboss.modules.ModuleNotFoundException: xxxxx:main
Solution:
Pay close attention to your JNDI context lookup URL.
Follow the link below, it might point you in the right direction
https://docs.jboss.org/author/display/WFLY8/JNDI+Reference?_sscc=t
Exception:
Caused by: java.lang.NoClassDefFoundError:
Solutions:
After adding manifest to the calling jar/war, goto the dependencies manifest and add the meta-inf for access to the meta-inf.
for example, your manifest file of TemplateClient.jar should look like
Manifest-Version: 1.0
Dependencies: lib/TemplateEJB-1.0-SNAPSHOT.jar export meta-inf
suppose TemplateEJB-xxx is being called from TemplateClient.jar
Read https://docs.jboss.org/author/display/WFLY10/Class+Loading+in+WildFly.
In conclusion, for remote client, on wildfly, your project pom should look like
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-ejb-client-bom</artifactId>
<version>10.0.0.Final</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jboss.remoting</groupId>
<artifactId>jboss-remoting</artifactId>
<version>4.0.21.Final</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-remote-naming</artifactId>
<version>2.0.4.Final</version>
<scope>runtime</scope>
</dependency>
To start with, enable debug for your application server to see the detail and good luck troubleshooting.
Exceptions :
Starting with java.lang.ClassNotFoundException: org.hibernate.collection.internal.Persistent.........
Solution :
I fixed the exception be adding hibernate Entity Manager Dependencies.
Exception:
Error javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
Solution:
Add JBOSS-CLIENT Dependencies to your project
Exception:
IllegalStateException: EJBCLIENT000025: No EJB receiver available for handling
Solution:
Confirm that your EJB module have been deployed.
Exception:
org.jboss.naming.remote.client.initialcontextfactory wildfly
javax.naming.NamingException: WFLYNAM0027: Failed instantiate InitialContextFactory org.jboss.naming.remote.client.InitialContextFactory from classloader
javax.naming.namenotfoundexception while trying to lookup ejb
Caused by: org.jboss.modules.ModuleNotFoundException: xxxxx:main
Solution:
Pay close attention to your JNDI context lookup URL.
Follow the link below, it might point you in the right direction
https://docs.jboss.org/author/display/WFLY8/JNDI+Reference?_sscc=t
Exception:
Caused by: java.lang.NoClassDefFoundError:
Solutions:
After adding manifest to the calling jar/war, goto the dependencies manifest and add the meta-inf for access to the meta-inf.
for example, your manifest file of TemplateClient.jar should look like
Manifest-Version: 1.0
Dependencies: lib/TemplateEJB-1.0-SNAPSHOT.jar export meta-inf
suppose TemplateEJB-xxx is being called from TemplateClient.jar
Read https://docs.jboss.org/author/display/WFLY10/Class+Loading+in+WildFly.
In conclusion, for remote client, on wildfly, your project pom should look like
<dependency>
<groupId>org.wildfly</groupId>
<artifactId>wildfly-ejb-client-bom</artifactId>
<version>10.0.0.Final</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.jboss.remoting</groupId>
<artifactId>jboss-remoting</artifactId>
<version>4.0.21.Final</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jboss</groupId>
<artifactId>jboss-remote-naming</artifactId>
<version>2.0.4.Final</version>
<scope>runtime</scope>
</dependency>
Comments
Post a Comment