• Post Reply Bookmark Topic Watch Topic
  • New Topic

Class not found during execution  RSS feed

 
Thomas Pascal Michem Campos
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody,
I create a a jar : it is a client of a Web Service that i have to use. I create this jar under Java 6 because it has to turn under Java 6 like my application.
My application is a Spring/Struts application and i include with Maven the precedent jar. My application calls methods of the Web Service.
When i create a war of my application, thanks to Maven (commands "Maven clean followed by command Maven install), all is OK : the build succeeds. The compilation is OK.
But when i put this war in the JBoss deployment directory, i have this error : "class X not found". The class X is a class present in my web service client jar. And i verify that this class is well present in the jar effectively present in the war.
It's surprising. Now, i do not understand what happens.
Have a nice day everybody.
Thomas
 
Stephan van Hulst
Saloon Keeper
Posts: 7722
142
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you have a jar inside a war? That makes no sense. Your client application should run separately from your web application. You also can't call methods of the web application directly unless you're using something like RMI.

Can you show us an example of where one application is calling the other, and can you show us your POM?
 
Thomas Pascal Michem Campos
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stephan van Hulst wrote:So you have a jar inside a war? That makes no sense. Your client application should run separately from your web application. You also can't call methods of the web application directly unless you're using something like RMI.

Can you show us an example of where one application is calling the other, and can you show us your POM?


Thanks for your answer Stephan.
In fact, one ask me to take an existing application : i have no choice of the architecture.
I created a Web Service and i have to call from the application. From the application, i use my Web Service from a client jar. It works.
Now, i have to use an existing Web Service. I create a client jar like for my Web Service. It does not work. JBoss can't find a class existing in the jar.


Here is my call.



OrderWS ordreSoumis = getOrder();
OrderByBatchCompoundReq requestForTheOrdering = new OrderByBatchCompoundReq();
OrderByBatchCompoundRes response = this.appelWebServiceOrdering.placeOrder(requestForTheOrdering);


JBoss does not found the OrderByBatchCompoundReq  class.


I join you the part of the pom dealing with the web services.



The jar webserviceordering contains the class OrderByBatchCompoundReq , but during the deployment, the JBoss does noy find this class OrderByBatchCompoundReq  contained in the webserviceordering jar.

For the client jar for my Web Service called from the application (artifectId = webservice), all is OK.

Thank you and have a good day,
  Thomas

 
Thomas Pascal Michem Campos
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I see the error.
JBoss indicates (server.log).
Failed to define class com.toulouse.evotec.webservice.OrderByBatchCompoundReq in Module "deployment.EvotecSMTLSBIS.war:main" from Service Module Loader: java.lang.UnsupportedClassVersionError: com/toulouse/evotec/webservice/OrderByBatchCompoundReq : Unsupported major.minor version 51.0
I run with Java SE 6.
I will see in this direction.
 
Thomas Pascal Michem Campos
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is surprising, in the MANIFEST.MF file, i have :
Manifest-Version: 1.0
Created-By: 1.6.0_31 (Sun Microsystems Inc.)

So it seems to be compiled under Java 6.
 
Thomas Pascal Michem Campos
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody,
I made a mistake.
In fact, my project works under Java 6 and JBoss server works under Java 6.
I add a jar compiled under Java 7 in my project, and that's the reason 1 class of my jar can't be defined (unsupported version) and consequently can't be found.
Friday, i was hurry to see the Euro soccer championship and forgot to add the good jar ie the jar compiled under Java 6 to my project.
I resolved my problem by creating a jar under Java 6 and adding this jar to my project.
Have a good day Stephan and everybody,
  Thomas
 
Stephan van Hulst
Saloon Keeper
Posts: 7722
142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for getting back to us, glad you managed to make it work.
 
Thomas Pascal Michem Campos
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stephan van Hulst wrote:Thanks for getting back to us, glad you managed to make it work.

Thanks for your contribution Stephan.
You are right in your post, but i have to take an existing application that is deployed as a war containing jars in the WENB-INF/lib directory.
Thanks for your help.
I wish you a good day.
  Thomas
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!