-
1. Re: No class definition Error.
sfcoy Aug 16, 2012 7:00 AM (in response to sudhabalu)1 of 1 people found this helpfulAccessing application classes from a module is tricky if they are not passed into the module as arguments.
It would be simpler to bundle your EJB jar in an EAR file and add your compression library as a jar to the EAR/lib directory.
-
2. Re: No class definition Error.
sudhabalu Aug 16, 2012 7:12 AM (in response to sfcoy)Thanks for your reply. I have already tried to add compression library to the EAR/lib. But that doesn't work Still getting same exception
-
3. Re: No class definition Error.
sfcoy Aug 16, 2012 9:29 AM (in response to sudhabalu)You need to add a classpath manifest entry in the compression lib with the name of the ejb jar, or configure the EAR classloading as described in Class Loading in AS7.
-
4. Re: No class definition Error.
sudhabalu Aug 17, 2012 1:28 AM (in response to sfcoy)I did the followings.
1.Added the ejb jar name in the classpath manifest entry of compression lib
2.Set ear-subdeployments-isolated to false
But no luck. Still couldn't solve the problem.
-
5. Re: No class definition Error.
nickarls Aug 17, 2012 1:50 AM (in response to sudhabalu)What is the error message with all stuff in ear/lib and isolation=false? Is it jar -> jar reference within the ear or is there any jar -> war access?
-
6. Re: No class definition Error.
sudhabalu Aug 17, 2012 2:04 AM (in response to nickarls)Compression stuff is defined as module and loaded the same in standalone-full.xml as shown below.
<global-modules>
<module name="solverminds.compress.compressapi" slot="main"/>
</global-modules>
From my bean/servlet used to call compress api to compress/decompress data.
lrp.documentation.booking.shared.vo.Booking object = (lrp.documentation.booking.shared.vo.Booking)cmp.decompress(compressedData);
Its showing the mentioned error in the above line.
-
7. Re: No class definition Error.
nickarls Aug 17, 2012 2:14 AM (in response to sudhabalu)Can you raise log levels so you can see that the module is actually is well-defined and picked up?
-
8. Re: No class definition Error.
sudhabalu Aug 17, 2012 2:18 AM (in response to nickarls)ok. But its my error.
11:04:20,638 INFO [stdout] (http-127.0.0.1-127.0.0.1-8080-1) Exception raised in decompress() :java.lang.ClassNotFoundException: lrp.documentation.booking.shared.vo.Booking from [Module "solverminds.compress.compressapi:main" from local module loader @94884d (roots: E:\jboss-as-7.1.1.Final\modules)]
Its showing lrp.documentation.booking.shared.vo.Booking class is not found in compress API.
-
9. Re: No class definition Error.
sfcoy Aug 17, 2012 2:20 AM (in response to nickarls)I think Sudha is directly referencing a class defined in his application from his module. I don't think you can do that without passing a classloader to the module.
Which is why I suggested the EAR solution.
Sudha, What did your manifest classpath entry look like? I would expect to see something like:
Class-Path: ../your-ejb.jar
-
10. Re: No class definition Error.
sudhabalu Aug 17, 2012 2:26 AM (in response to sfcoy)i Just added like this.
Class-Path: ejbjarname.jar
I added this manifest entry in the compress library jar's which is loaded as module.
-
11. Re: No class definition Error.
sfcoy Aug 17, 2012 2:35 AM (in response to sudhabalu)If you have code like:
{code:java}lrp.documentation.booking.shared.vo.Booking object = (lrp.documentation.booking.shared.vo.Booking)cmp.decompress(compressedData);{code}
in your module and the class lrp.documentation.booking.shared.vo.Booking is defined in your ejb jar then you will have classloading problems.
Put everything together in an EAR file.
-
12. Re: No class definition Error.
nickarls Aug 17, 2012 2:35 AM (in response to sudhabalu)Why would the compression module (as in AS module in the modules dir) need to reference the code in the EAR/EJB?
One would think that you either would have the compression lib and the code using it in the same EAR or the compression stuff in a module and then just referenced from the applications.
Or am I missing something here?
-
13. Re: No class definition Error.
sudhabalu Aug 17, 2012 2:43 AM (in response to sfcoy)No am not having that code in my module. In compress API all operations done as object.
That code i have used in my servlet.
I am just passing some object to compress API to decompress the same.
-
14. Re: No class definition Error.
nickarls Aug 17, 2012 2:42 AM (in response to sudhabalu)So you now have have an EAR. In that EAR you have a WAR. In that WAR you have a servlet class which references a class that is packed in a JAR and placed in the lib folder of the beforementioned EAR?