3 Replies Latest reply on Mar 19, 2005 12:16 AM by Jason Greene

    The access URL to web service

    Hans Shi Newbie

      Hi, there

      I encounter a proble about accessing web service URL, the formal access address to deployed web service is http://host/ws4ee/services/..., but there is another addess we can get to which like this: http://host/{ejb_jar}/services/... (ejb_jar is the EJB jar file name). In this cause, the address will conflict with my other applications which address is also http://host/{ejb_jar}/...

      I looked into this problem and found that a war application for ejb application has been built for web service accessing. The war application is hot deployed under D:\av.6.0\av.home\jboss-4.0.0\server\av.web\tmp\deploy\security.jar6044.war\, from its web.xml, we could get the root cause, see web.xml snippet below:

      <web-app>

      <servlet-name>ejb/security/AuthenticationEJB</servlet-name>
      <servlet-class>org.jboss.webservice.server.ServiceEndpointServletEJB</servlet-class>
      <init-param>
      <param-name>ws4ee-service-name</param-name>
      <param-value>AuthenticationService4WS</param-value>
      </init-param>

      <servlet-mapping>
      <servlet-name>ejb/security/AuthenticationEJB</servlet-name>
      <url-pattern>/*</url-pattern>
      </servlet-mapping>
      </web-app>


      So, this is auto deployed by JBoss, my question is how can I change the web service access URL that I expect?

      Thank you in advance!

        • 1. Re: The access URL to web service
          Jason Greene Master

          In your jboss.xml file you can add a port component block in each session bean block that defines the url that looks like this:

          <session>
           <ejb-name>Authentication</ejb-name>
           <port-component>
           <port-component-name>Authentication</port-component-name>
           <port-component-uri>/mywebserivcelocation/Authentication</port-component-name>
           </port-component>
          </session>
          



          -Jason

          • 2. Re: The access URL to web service
            Hans Shi Newbie

            Hi jasong, thanks for the quickly response!

            I added jboss.xml to ejb package, but when I start jboss server, an exception is throw as below:

            jvm 1 | 14:27:58,718 INFO [EJBDeployer] Deployed: file:/D:/av.6.0/av.home/jboss-4.0.0/server/av.
            web/deploy/security.jar
            jvm 1 | [GC 26920K->25014K(32576K), 0.0075619 secs]
            jvm 1 | [GC 27062K->25288K(32576K), 0.0092570 secs]
            jvm 1 | [GC 27336K->25338K(32576K), 0.0076672 secs]
            jvm 1 | 14:27:59,640 INFO [WSDLFilePublisher] WSDL published to: file:/D:/av.6.0/av.home/jboss-4
            .0.0/server/av.web/data/wsdl/security.jar/sso.wsdl
            jvm 1 | [GC 27386K->25442K(32576K), 0.0070506 secs]
            jvm 1 | [GC 27490K->25996K(32576K), 0.0112411 secs]
            jvm 1 | [GC 28044K->25923K(32576K), 0.0067587 secs]
            jvm 1 | [GC 27971K->25967K(32576K), 0.0056747 secs]
            jvm 1 | [GC 28015K->26041K(32576K), 0.0067676 secs]
            jvm 1 | 14:28:00,718 INFO [AxisService] WSDD published to: D:\av.6.0\av.home\jboss-4.0.0\server\
            av.web\data\wsdl\security.jar\AuthenticationService4WS.wsdd
            jvm 1 | [GC 28089K->26251K(32576K), 0.0077362 secs]
            jvm 1 | [GC 28299K->26385K(32576K), 0.0100214 secs]
            jvm 1 | [GC 28433K->26585K(32576K), 0.0095789 secs]
            jvm 1 | [GC 28633K->26665K(32576K), 0.0087575 secs]
            jvm 1 | [GC 28713K->26743K(32576K), 0.0080899 secs]
            jvm 1 | 14:28:02,390 INFO [AxisService] Web Service deployed: http://localhost:80/security/Authe
            nticationService4WS
            jvm 1 | 14:28:02,421 ERROR [ServiceDeployer] Cannot startup webservice for: security.jar
            jvm 1 | java.lang.NullPointerException
            jvm 1 | at org.jboss.webservice.ServiceDeployerEJB.createWebXML(ServiceDeployerEJB.java:265)

            jvm 1 | at org.jboss.webservice.ServiceDeployerEJB.deployWebservices(ServiceDeployerEJB.java
            :103)
            jvm 1 | at org.jboss.webservice.ServiceDeployer.startWebservice(ServiceDeployer.java:203)
            jvm 1 | at org.jboss.webservice.ServiceDeployer.handleNotification(ServiceDeployer.java:113)

            jvm 1 | at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
            jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java
            :25)
            jvm 1 | at java.lang.reflect.Method.invoke(Method.java:324)
            jvm 1 | at org.jboss.mx.notification.NotificationListenerProxy.invoke(NotificationListenerPr
            oxy.java:138)
            jvm 1 | at $Proxy20.handleNotification(Unknown Source)
            jvm 1 | at javax.management.NotificationBroadcasterSupport.handleNotification(NotificationBr
            oadcasterSupport.java:104)
            jvm 1 | at javax.management.NotificationBroadcasterSupport.sendNotification(NotificationBroa
            dcasterSupport.java:87)
            jvm 1 | at org.jboss.deployment.SubDeployerSupport.start(SubDeployerSupport.java:178)
            jvm 1 | at org.jboss.ejb.EJBDeployer.start(EJBDeployer.java:620)
            jvm 1 | at org.jboss.deployment.MainDeployer.start(MainDeployer.java:935)
            jvm 1 | at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:746)
            jvm 1 | at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
            jvm 1 | at sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source)
            jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java
            :25)
            jvm 1 | at java.lang.reflect.Method.invoke(Method.java:324)
            jvm 1 | at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)

            jvm 1 | at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
            jvm 1 | at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)

            jvm 1 | at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
            jvm 1 | at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperatio
            nInterceptor.java:131)
            jvm 1 | at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
            jvm 1 | at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
            jvm 1 | at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
            jvm 1 | at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
            jvm 1 | at $Proxy8.deploy(Unknown Source)
            jvm 1 | at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.jav
            a:305)
            jvm 1 | at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:
            481)
            jvm 1 | at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(Abstr
            actDeploymentScanner.java:204)
            jvm 1 | at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeplo
            ymentScanner.java:277)
            jvm 1 | at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:
            271)
            jvm 1 | at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.j
            ava:221)
            jvm 1 | at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
            jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java
            :25)
            jvm 1 | at java.lang.reflect.Method.invoke(Method.java:324)
            jvm 1 | at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)

            jvm 1 | at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
            jvm 1 | at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
            jvm 1 | at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
            jvm 1 | at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
            jvm 1 | at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:891
            )
            jvm 1 | at $Proxy0.start(Unknown Source)
            jvm 1 | at org.jboss.system.ServiceController.start(ServiceController.java:416)
            jvm 1 | at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
            jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java
            :25)
            jvm 1 | at java.lang.reflect.Method.invoke(Method.java:324)
            jvm 1 | at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)

            jvm 1 | at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
            jvm 1 | at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
            jvm 1 | at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
            jvm 1 | at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
            jvm 1 | at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
            jvm 1 | at $Proxy4.start(Unknown Source)
            jvm 1 | at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
            jvm 1 | at org.jboss.deployment.MainDeployer.start(MainDeployer.java:935)
            jvm 1 | at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:746)
            jvm 1 | at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
            jvm 1 | at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:693)
            jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            jvm 1 | at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            jvm 1 | at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java
            :25)
            jvm 1 | at java.lang.reflect.Method.invoke(Method.java:324)
            jvm 1 | at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)

            jvm 1 | at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
            jvm 1 | at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)

            jvm 1 | at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
            jvm 1 | at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperatio
            nInterceptor.java:131)
            jvm 1 | at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
            jvm 1 | at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:242)
            jvm 1 | at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
            jvm 1 | at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
            jvm 1 | at $Proxy5.deploy(Unknown Source)
            jvm 1 | at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:396)
            jvm 1 | at org.jboss.system.server.ServerImpl.start(ServerImpl.java:293)
            jvm 1 | at org.jboss.Main.boot(Main.java:151)
            jvm 1 | at org.jboss.Main$1.run(Main.java:405)
            jvm 1 | at java.lang.Thread.run(Thread.java:534)
            jvm 1 | [GC 28791K->26838K(32576K), 0.0087455 secs]


            However, I still can access to the web service though this address: http://host/ws4ee/security....

            So, is there anything i missed in deploying the ejb package?

            • 3. Re: The access URL to web service
              Jason Greene Master

              You must be running 4.0.0, upgrade your jboss to 4.0.1.

              -Jason