java - Class not found in META-INF/lib after deployment on Glassfish although all jars are there -


i'm facing following problem: while deploying eclipse ejb-project glassfish server, i'm getting "class [ ... ] not found" in server's log 1 of beans. therefore, eclipse tells me "deploy failing".

the definitive cause error i'm using class 3rd party jar (apache shiro). while/after deployment, glassfish not able find used class. if skip 1 , line of code using class apache shiro, works fine.

i use maven dependency management , correctly added maven dependencies java build path (so not face errors while implementing code) , ejb deployment assembly.

the maven dependencies (all needed jars) correctly packeted in ejb-jar-file underneath meta-inf/lib. double checked (1) exporting , inspecting ejb-jar-file eclipse export , (2) analysing files on glassfish server. apache shiro jars deployed under domain1/eclipseapps/my-app-root/meta-inf/lib (i tried meta-inf/classes same error).

by way: when added apache shiro jars under domain1/lib, worked fine.

thus, assume there wrong classpath glassfish not able find jars under /meta-inf/lib.

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>organizationandsecurity</groupid>   <artifactid>organizationandsecurity</artifactid>   <version>0.0.1-snapshot</version>   <packaging>ejb</packaging>   <name>organization , security</name>   <description>provide facilities manage organization units &amp; members, resources , permissions.</description>    <build>     <sourcedirectory>ejbmodule</sourcedirectory>     <resources>       <resource>         <directory>ejbmodule</directory>         <excludes>           <exclude>**/*.java</exclude>         </excludes>       </resource>     </resources>     <plugins>       <plugin>         <artifactid>maven-compiler-plugin</artifactid>         <version>3.3</version>         <configuration>           <source>1.8</source>           <target>1.8</target>           <failonmissingwebxml>false</failonmissingwebxml>         </configuration>       </plugin>       <plugin>         <artifactid>maven-ejb-plugin</artifactid>         <version>2.5</version>         <configuration>           <ejbversion>3.2</ejbversion>           <failonmissingwebxml>false</failonmissingwebxml>         </configuration>       </plugin>     </plugins>   </build>   <dependencies>     <dependency>         <groupid>org.apache.shiro</groupid>         <artifactid>shiro-core</artifactid>         <version>1.2.5</version>         <type>ejb</type>     </dependency>     <dependency>         <groupid>org.apache.shiro</groupid>         <artifactid>shiro-web</artifactid>         <version>1.2.5</version>         <type>ejb</type>     </dependency>     <dependency>         <groupid>org.slf4j</groupid>         <artifactid>slf4j-simple</artifactid>         <version>1.6.1</version>         <type>ejb</type>     </dependency>   </dependencies> </project> 

my ejb-jar.xml

<?xml version="1.0" encoding="utf-8"?> <ejb-jar 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/ejb-jar_3_2.xsd" version="3.2">     <display-name>organizationandsecurity</display-name> </ejb-jar> 

my glassfish-ejb-jar.xml

<?xml version="1.0" encoding="utf-8"?> <!doctype    public "-//glassfish.org//dtd glassfish application server 3.1 ejb 3.1//en" "http://glassfish.org/dtds/glassfish-ejb-jar_3_1-1.dtd"> <glassfish-ejb-jar>     <enterprise-beans>         <ejb>             <ejb-name>authenticatormessagebean</ejb-name>             <jndi-name>jms/queue/authenticationmessagequeue</jndi-name>             <resource-ref>                 <res-ref-name>connectionfactory</res-ref-name>                 <jndi-name>authenticationmessageconnectionfactory</jndi-name>             </resource-ref>         </ejb>     </enterprise-beans> </glassfish-ejb-jar> 

i using eclipse mars.2 (4.5.2), glassfish 4.1, java (jdk) 1.8.0_25

question: why glassfish server not able find jars deployed meta-inf/lib ejb-project and, subsequently, isn't able find class used apache shiro's jar file?

a ejb-project cannot include additional jars, if need then, need ear-project includes both ejb-project third-party libraries

ear-project + ejb-project + apache-shiro


Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -