I recently studied ejb3 and encountered a lot of difficult problems when using ejb3 web service. Now I want to summarize the frequently asked questions and share them with you, we hope that you will spend less time searching for solutions in the sky. For details, see:
1.
Server error message:
Jboss5 java. Lang. noclassdeffounderror: ORG/Apache/xerces/XS/xsmodel
Symptoms:
(This occurs in jboss5.1) it can be deployed normally when started on the console, and an error is reported in eclipse.
Solution:
It is likely that the JBoss plug-in of eclipse is selected when the server is added. The location is JBoss-> JBoss V5.0, and changed to the jbossas tool plug-in the JBoss tool plug-in. The location is: JBoss community-> JBoss as v5.1
2.
(This problem exists in jboss5.1)
Client call error,
When jbossws is used to call WebService, the following two exceptions are reported alternately:
Javax. xml. ws. webserviceexception: No Content-Type in the header
And
Javax. xml. ws. webserviceexception: Java. Lang. unsupportedoperationexception: setproperty must be overridden by all subclasses of soapmessage
When axis is used, the following error is reported:
Org. xml. Sax. saxparseexception: premature end of file.
Cause and solution:
Copy the file under the jboss_home/client directory in jboss4.2 to the jboss_home/lib/endorsed directory in jboss5.1, and restart the service.
Jboss-jaxrpc.jar
Jboss-jaxws.jar
Jboss-jaxws-ext.jar
Jboss-saaj.jar
Another method is to download jboss5.1 jdk1.6.
Refer to the following:
I read the release notes for JBoss as 4.2.3.ga and it describes what to do if running webservies using jdk1.6. here is what helped me: (taken from the release notes and followed exactly as printed)
* Jbossas 4.2.3.ga can be compiled with both java5 & java6. the java5 compiled binary is our primary/recommended
Binary distribution. It has undergone rigorous testing and can run under both a Java 5 and a Java 6 runtime. When
Running under Java 6 you need to manually copy the following libraries from the jboss_home/client directory
The jboss_home/lib/endorsed directory, so that the JAX-WS 2.0 APIs supported by jbossws are used:
Jboss-jaxrpc.jar
Jboss-jaxws.jar
Jboss-jaxws-ext.jar
Jboss-saaj.jar