[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
18 years, 3 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
18 years, 3 months
[JBoss Messaging] - Security issue while connecting MDB to remote Topic
by sappenin
I have two JBoss Instances/servers -- ServerA [10.1.1.101] & ServerB [10.1.1.102].
I have a Topic deployed on ServerA, and an EJB3 MDB on ServerB that is attempting to connect to the remote Topic on ServerA. I have followed all of the directions in the messaging wiki to connect an EJB3 MDB to a remote queue/topic, and everything works fine (see here: http://wiki.jboss.org/wiki/en/HowDoIConfigureAnEJB3MDBToTalkToARemoteQueu...).
However, when I remove the "guest" role from the Topic MBean configuration (see below). then the EJB3 MDB on ServerB is unable to connect to the remote topic. However, I have setup username/password in various places (see below).
Is there a proper way I can subscribe/connect to a remote Topic that is secured?
(By the way, MDB's on ServerA *are* able to connect/subscribe to the Topic on serverA, so I know my security store is setup properly, with the appropriate user/passwords defined).
*** MBEAN Deployed on ServerA to create the Topic ***
| <mbean
| code="org.jboss.jms.server.destination.TopicService"
| name="jboss.messaging.destination:service=Topic,name=CoolTopic"
| xmbean-dd="xmdesc/Topic-xmbean.xml"
| >
| <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
| <depends>jboss.messaging:service=PostOffice</depends>
| <attribute name="JNDIName">topic/coolTopic</attribute>
| <attribute name="SecurityConfig">
| <security>
| <role
| name="system"
| read="true"
| write="true"
| create="true"
| />
| </security>
| </attribute>
| </mbean>
|
*** JMS REMOTE PROVIDER DEPLOYED ON SERVERB, POINTING TO SERVERA ***
<!-- The JMS Remote Provider (used to receive messages from the CoolTopic on ServerA -->
| <mbean
| code="org.jboss.jms.jndi.JMSProviderLoader"
| name="jboss.messaging:service=JMSProviderLoader,name=RemoteJMSProvider,server=remotehost"
| >
| <attribute name="ProviderName">RemoteJMSProvider</attribute>
| <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
| -->
| <!-- The connection factory -->
| <attribute name="FactoryRef">java:/XAConnectionFactory</attribute>
| <!-- The queue connection factory -->
| <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>
| <!-- The topic factory -->
| <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute>
| <!-- Connect to JNDI on the host "the-remote-host-name" port 1099-->
| <attribute name="Properties">
| java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
| java.naming.factory.url.pkgs=org.jnp.interfaces
| java.naming.provider.url=10.1.1.101:1099
| java.naming.security.principal=system
| java.naming.security.credentials=password
| </attribute>
| </mbean>
*** EJB3 MDB DECLARATION FOR MDB ON SERVERB ***
| @MessageDriven(activationConfig = {
| @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
| @ActivationConfigProperty(propertyName = "destination", propertyValue = "topic/coolTopic"),
| @ActivationConfigProperty(propertyName = "providerAdapterJNDI", propertyValue = "java:/RemoteJMSProvider"),
| @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "Durable"),
| @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "AUTO_ACKNOWLEDGE"),
| @ActivationConfigProperty(propertyName = "subscriptionName", propertyValue = "coolSubscription"),
| @ActivationConfigProperty(propertyName = "user", propertyValue = "system"),
| @ActivationConfigProperty(propertyName = "password", propertyValue = "password")
| }, messageListenerInterface = MessageListener.class)
| @TransactionManagement(value = TransactionManagementType.CONTAINER)
| @RunAs("system")
| @RolesAllowed( {
| "admin", "system"
| })
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4144982#4144982
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4144982
18 years, 3 months