[JBossWS] - Problem in passing/returning objects over dynamic web servic
by rashmi_yes
Hi Friends,
I am beginner in java web service.
Here is the problem I am facing when I pass/return user defined objects to remote web service method using dynamic we service call.
The client can call the remote web service method in 2 ways.
1. By generating client stubs using WSDL file
- In this case, I am able to pass/return the user defined objects to remote method without any issue only when the server side web services are deployed in any server(jboss)
- But in java 1.6 & above, the web services can be deployed without server using endpoint. In this case, I am not able to pass/return objects over web service calls.
2. Without generating client stubs (dynamic web service call)
- This will establish a connection at run time using the given WSDL file (I have attached the document). I have to form an XML(This will contain API name, arguments) string as input at run time
- In this case, it allows only string as argument while passing & returning.
Please let me know if you can help me on this.
Regards,
pani
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4145054#4145054
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4145054
16 years, 8 months
[JBossWS] - Error during deployment with EJB3 exposed as WebService
by ashishtiwari
I am using JBoss AS 5.0.0 Beta 4. I am trying to expose simple EJB3 as Jax-WS based webservice by using annotation, but the ear file is failing to deploy. Following is the error stack that I am seeing:
anonymous wrote : 16:56:18,691 INFO [ServerImpl] JBoss (Microcontainer) [5.0.0.Beta4 (build: SVNTag=JBoss_5_0_0_Beta4 date=200802091115)] Started in 35s:752ms
| 16:59:11,203 INFO [MCKernelAbstraction] installing bean: jboss.j2ee:ear=JBossWSTest.ear,jar=JBossEJB3.jar,name=JBossEJB3HelloWorld,service=EJB3 with dependencies:
| 16:59:11,203 INFO [MCKernelAbstraction] and demands:
| 16:59:11,203 INFO [MCKernelAbstraction] jboss.ejb:service=EJBTimerService
| 16:59:11,203 INFO [MCKernelAbstraction] and supplies:
| 16:59:11,203 INFO [MCKernelAbstraction] Class:sample.ejb.JBossEJB3HelloWorldRemoteInterface
| 16:59:11,874 INFO [EJBContainer] STARTED EJB: sample.ejb.JBossEJB3HelloWorld ejbName: JBossEJB3HelloWorld
| 16:59:12,015 INFO [DefaultEndpointRegistry] register: jboss.ws:context=JBossEJB3HelloWorld,endpoint=JBossEJB3HelloWorld
| 16:59:14,031 INFO [WSDLFilePublisher] WSDL published to: file:/C:/jboss-5.0.0.Beta4/server/default/data/wsdl/JBossWSTest.ear/JBossEJB3.jar/JBossEJB3HelloWorldService45127.wsdl
| 16:59:35,063 INFO [MCKernelAbstraction] uninstalling bean: jboss.j2ee:ear=JBossWSTest.ear,jar=JBossEJB3.jar,name=JBossEJB3HelloWorld,service=EJB3
| 16:59:35,079 INFO [EJBContainer] STOPPED EJB: sample.ejb.JBossEJB3HelloWorld ejbName: JBossEJB3HelloWorld
| 16:59:35,095 ERROR [AbstractKernelController] Error installing to Real: name=vfsfile:/C:/jboss-5.0.0.Beta4/server/default/deploy/JBossWSTest.ear state=PostClassLoader mode=Manual requiredState=Real
| org.jboss.deployers.spi.DeploymentException: Error during deploy: vfsfile:/C:/jboss-5.0.0.Beta4/server/default/deploy/JBossWSTest.ear/JBossEJB3.jar
| at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
| at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:175)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:853)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:906)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:794)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327)
| at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309)
| at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862)
| at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622)
| at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411)
| at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:498)
| at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:506)
| at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:290)
| at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
| at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
| at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)
| at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
| at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Unknown Source)
| at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Unknown Source)
| at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
| at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
| at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
| at java.lang.Thread.run(Unknown Source)
| Caused by: org.jboss.wsf.spi.deployment.WSFDeploymentException: javax.xml.ws.WebServiceException: org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection timed out: connect
| at org.jboss.wsf.spi.deployment.WSFDeploymentException.rethrow(WSFDeploymentException.java:54)
| at org.jboss.wsf.container.jboss50.WebAppDeploymentAspect.create(WebAppDeploymentAspect.java:87)
| at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.deploy(DeploymentAspectManagerImpl.java:118)
| at org.jboss.wsf.container.jboss50.ArchiveDeployerHook.deploy(ArchiveDeployerHook.java:95)
| at org.jboss.wsf.container.jboss50.AbstractWebServiceDeployer.internalDeploy(AbstractWebServiceDeployer.java:63)
| at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
| at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169)
| ... 23 more
| Caused by: javax.xml.ws.WebServiceException: org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection timed out: connect
| at org.jboss.wsf.container.jboss50.WebXMLRewriterImpl.rewriteWebXml(WebXMLRewriterImpl.java:92)
| at org.jboss.wsf.container.jboss50.WebAppDeploymentAspect.create(WebAppDeploymentAspect.java:74)
| ... 28 more
| Caused by: org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection timed out: connect
| at org.dom4j.io.SAXReader.read(SAXReader.java:484)
| at org.dom4j.io.SAXReader.read(SAXReader.java:343)
| at org.jboss.wsf.container.jboss50.WebXMLRewriterImpl.rewriteWebXml(WebXMLRewriterImpl.java:111)
| at org.jboss.wsf.container.jboss50.WebXMLRewriterImpl.rewriteWebXml(WebXMLRewriterImpl.java:84)
| ... 29 more
| 16:59:35,110 WARN [HDScanner] Failed to process changes
| org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):
|
| *** CONTEXTS IN ERROR: Name -> Error
|
| vfsfile:/C:/jboss-5.0.0.Beta4/server/default/deploy/JBossWSTest.ear -> org.dom4j.DocumentException: Connection timed out: connect Nested exception: Connection timed out: connect
|
|
| at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:576)
| at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:559)
| at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDScanner.java:291)
| at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDScanner.java:221)
| at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
| at java.util.concurrent.FutureTask$Sync.innerRunAndReset(Unknown Source)
| at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
| at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(Unknown Source)
| at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(Unknown Source)
| at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
| at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
| at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
| at java.lang.Thread.run(Unknown Source)
Here are all other details:
Code for Sample EJB3 class - JBossEJB3HelloWorld.java:
package sample.ejb;
|
| import javax.ejb.Stateless;
| import javax.jws.WebMethod;
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
|
| import org.jboss.wsf.spi.annotation.WebContext;
|
| @Stateless
| @WebService
| @WebContext(contextRoot="/JBossEJB3HelloWorld", urlPattern="/JBossEJB3HelloWorld")
| @SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
| public class JBossEJB3HelloWorld implements JBossEJB3HelloWorldRemoteInterface
| {
| @WebMethod
| public String sayHello(String input)
| {
| return "Hello " + input;
| }
| }
-------
Code for Sample EJB3 remote interface - JBossEJB3HelloWorldRemoteInterface.java:
package sample.ejb;
|
| import javax.ejb.Remote;
|
| @Remote
| public interface JBossEJB3HelloWorldRemoteInterface
| {
| String sayHello(String input);
| }
----
Packaged as JBossWSTest.ear file with following application.xml
<?xml version="1.0" encoding="UTF-8"?>
| <application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:application="http://java.sun.com/xml/ns/javaee/application_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_5.xsd" id="Application_ID" version="5">
| <module>
| <ejb>JBossEJB3.jar</ejb>
| </module>
| </application>
I appreciate any help or pointers for resolving this issue.
-Ashish
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4144999#4144999
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4144999
16 years, 8 months
[JBossWS] - Re: Customizing XJC invocation?
by jyrinx
"richard.opalka(a)jboss.com" wrote : "jyrinx" wrote : Is it possible to use XJC plugins with JBoss WS? No :(
Hrm ... that's saddening. Can anyone think of a good hack here?
Well, let me explain the problem: We have a Web service that returns objects of an abstract class. So long as we put @XmlSeeAlso on the superclass, the WSDL comes out fine, and the XML elements have xsi:type attributes, and all is well on the server side. (We're using JBoss WS on both the client and server.)
But then we try out our test client, and we keep getting InstantiationExceptions when JAXB fails to resolve the entities to their concrete subclass and tries to instantiate the abstract superclass. We realized that if we modified the generated code to include @XmlSeeAlso annotations mirroring those on the server side, everything worked. So the question is one of getting those annotations into the client code.
(We could put dummy methods with the concrete subclasses as argument types into the Web service just to force all the subclasses into the JAXBContext, but we'd rather not ...)
So this is all quite solvable with an XJC plugin: It has all the information it needs to write the annotations, and the ideal interface to add them to the generated classes. (The plugin class is about 30 LOC.) If there's some way to get that to work, that would be best. Otherwise, we're going to have to resort to much cruder means of post-processing (or the aforementioned dummy methods).
(There's also this <xjc:substitutable/> thing, but honestly I'm not sure how we'd make use of it: it has to go in the generated schema somehow?)
And besides, there are other very useful XJC plugins - the one that adds toString() methods, for instance, would be very convenient.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4144985#4144985
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4144985
16 years, 8 months