[JBossWS] - Re: EJB3 and JBossWS (JAXWS), is WSgen even needed for botto
by jason.greene@jboss.com
"dwin" wrote : please clarify for me,
|
| this "magic" that happens behind the scene is specific to JBossWS 1.2 or to any implementation of JAX-WS?
It's a feature specific to JBossWS. The whole reason for the JAX-WS wrapper classes is to solve a technical problem that is specific to the vender. So since the end-user never actually does anything with these classes, we think it's silly to epect them to run an offline tool to generate them. So if you do not include them, we generate them on the fly for you during deployment.
That said, since the wrapper types are required artifacts, in order for your deployment to be portable to other containers (if you even care) you would need to generate them offline using the wsgen tool. I recently finished the offline tool for this purpose (code is currently in trunk).
Also, this only applies to the wrapper types. The WSDL file is not needed on any JAX-WS compliant container.
-Jason
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4007106#4007106
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4007106
17 years, 11 months
[JBossWS] - Jaxb EAR project - please help
by X490812
I have an EAR project. In the project I have a web app and an EJB. My goal is to have a REST webservice servlet that gets the XML payload, uses JAXB to unmarshal it into XJC generated classes, then pass those classes to an EJB for processing. What I have found is the following:
scenario 1)
here is the EAR fle structure:
EAR
bpo-lib.jar - holds the XJC generated classes
bpo-ejb.jar - references bpo-lib.jar in its manifest.mf file
bpo-webservice.war - holds the rest servlet that does the unmarshaling and passes unmarshaled objects to EJB
- holds bpo-lib.jar in WEB-INF/lib - I did this because I saw in the FAQ that JAXBContext.newInstance tries to load
classes using the same clasloader that the JAXBContext class is in
- references bpo-lib.jar in its manifest.mf file
The result is that I can unmarshal the data into the XJC classes, but after I pass them to the EJB, I try to cast the object into the expected types and get a class cast exception. this is possibly the behavior mentioned in https://jaxb.dev.java.net/faq/#classloader
scenario 2)
here is the EAR file structure:
EAR
bpo-lib.jar - holds the XJC generated classes
bpo-ejb.jar - references bpo-lib.jar in its manifest.mf file
bpo-webservice.war - holds the rest servlet that does the unmarshaling and passes unmarshaled objects to EJB
- does NOT hold bpo-lib.jar in WEB-INF/lib - I did this because in theory, on JBOSS4.0.4GA,
the EAR classes are accessible to the WAR context. I.E., I should NOT have to put the bpo-lib.jar file
in both the WEB-INF/lib dir and the EAR file
- references bpo-lib.jar in its manifest.mf file
The result is that I can NOT unmarshal the data into the XJC classes.
To analyze this, I checked what classes the JAXBContext knows about, and what I found was that when it unmarshalled data, I had this set of classes:
boolean
byte
char
com.homeq.bpo.domain.FirstAmericanSchema.request.AppraisalStatusResponses
com.homeq.bpo.domain.FirstAmericanSchema.request.AppraisalStatusResponses$AppraisalStatusResponse
com.homeq.bpo.domain.FirstAmericanSchema.request.AppraisalStatusResponses$AppraisalStatusResponse$Notes
com.homeq.bpo.domain.FirstAmericanSchema.request.NoteType
com.homeq.bpo.domain.FirstAmericanSchema.request.ResultsDataType
com.sun.xml.bind.api.CompositeStructure
double
.
.
.
When it did not unmarshal data it had this set of classes:
boolean
byte
char
com.homeq.bpo.domain.FirstAmericanSchema.request.ObjectFactory
com.sun.xml.bind.api.CompositeStructure
double
float
.
.
.
The above shows (I think) that I MUST have the bpo-lib.jar in the WEB-INF/lib dir as the classloader that loads JAXBContext must also load the generated files. But as shown in scenario 1 above, this prevents you from also referencing those classes in an EJB as an EJB should not access classes loaded inside of the WAR classloader.
Would I be correct in stating that using JAXB in a rest based web service on JBOSS4.0.4GA cannot be done, or am I missing something?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4007082#4007082
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4007082
17 years, 11 months
[JBossWS] - Re: webservices in jboss 5.0
by deployer_man
There are no exceptions, and there are no java errors.
The problem is that the aplication is deployed as an EJB3.0, but no as a Webservice. http://localhost:8080/jbossws/services is Empty.
Im working with the default configuration.
I've been looking in the ($JBOSS)/default/tmp and ($JBOSS)/default/work and there wasn't any webservice resources.
thanks for your answer.
Here is the las part of the output that appears when a I start Jboss 5.0
anonymous wrote :
| [TomcatDeployment] deploy, ctxPath=/, warUrl=.../deploy/ROOT.war/
| 23:24:31,301 INFO [StandardContext] Ya ha sido arrancado el Contenedor org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/]
| 23:24:33,928 INFO [MCKernelAbstraction] installing bean: jboss.j2ee:jar=j5.jar,name=j5bean,service=EJB3 with dependencies:
| 23:24:34,075 INFO [EJBContainer] STARTED EJB: bean.j5bean ejbName: j5bean
| 23:24:34,180 INFO [Http11Protocol] Arrancando Coyote HTTP/1.1 en puerto http-0.0.0.0-8080
| 23:24:34,200 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-0.0.0.0-8009
| 23:24:34,210 INFO [ServerImpl] JBoss (Microcontainer) [5.0.0.Beta1 (build: CVSTag=https://svn.jboss.org/repos/jbossas/tags/JBoss_5_0_0_Beta1 date=200611191849)] Started in 21s:557ms
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4007063#4007063
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4007063
17 years, 11 months
[JBossWS] - webservices in jboss 5.0
by deployer_man
Hello I'm using jboss 4.0.5 in order to deploy webservices using anotations like @Webservice and @webmethod. When I deploy the aplication I get a webservice and a EJB3.0.
But when I deploy the same code in Jboss 5.0.0 the webservices doesn't work. The endpoint haven´t been publicated. Somebody can tell what I´m doing wrong.
Here an example of Webservice
anonymous wrote :
| package bean;
| import java.util.ArrayList;
| import javax.ejb.Stateless;
| import javax.jws.WebMethod;
| import javax.jws.WebService;
|
| @Stateless
| @WebService
| public class j4Bean {
|
| @WebMethod
| public ArrayList getInt(int num)
| {
| ArrayList list= new ArrayList();
| list.add("Hola");
|
| return list;
| }
| }
|
Here is the interface
anonymous wrote :
| package bean;
|
| import java.util.ArrayList;
|
| import javax.ejb.Remote;
| import javax.jws.WebMethod;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
| import javax.jws.soap.SOAPBinding.Style;
|
| @Remote
| @WebService
| @SOAPBinding(style=Style.RPC)
| public interface j4 {
|
| @WebMethod ArrayList getInt(int num);
|
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006985#4006985
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006985
17 years, 11 months
[JBossWS] - Error consuption web service
by Rikr2
Im traying to consume a web service and i get this error:
AxisFault
| faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
| faultSubcode:
| faultString: org.xml.sax.SAXParseException: Premature end of file.
| faultActor:
| faultNode:
| faultDetail:
| {http://xml.apache.org/axis/}stackTrace:org.xml.sax.SAXParseException: Premature end of file.
| at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source)
| at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown Source)
| at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
| at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source)
| at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
| at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
| at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
| at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
| at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
| at javax.xml.parsers.SAXParser.parse(SAXParser.java:375)
| at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
| at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
| at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
| at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
| at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
| at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
| at org.apache.axis.client.Call.invoke(Call.java:2767)
| at org.apache.axis.client.Call.invoke(Call.java:2443)
| at org.apache.axis.client.Call.invoke(Call.java:2366)
| at org.apache.axis.client.Call.invoke(Call.java:1812)
I'll appreciate any idea.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4006906#4006906
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4006906
17 years, 11 months