2 Replies Latest reply on Apr 5, 2011 1:03 PM by sridhar18

    JBoss 5.1 @WebContext custom auth-method failure

    sridhar18

      Issue: Web Services application failing to deploy. I'm using a custom auth-method and jboss 5.1 AS doesn't like it. I'm trying to migrate from JBoss 4.2.3.GA to JBoss 5.1.0.GA. The custom auth-method stuff works fine on 4.2.3.GA.

       

      Related JIRA: https://issues.jboss.org/browse/JBWS-2762 - (Relax restriction on @WebContext(authMethod). Does this mean I can't use JBoss 5.1 in it's current state?

       

      I'd appreciate if there are any workaround suggestions. Thanks

       

      Stack Trace:

              at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:317)

              at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150)

              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:98)

              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.runPeriodic(ScheduledThreadPoolExecutor.java:180)

              at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:204)

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

              at java.lang.Thread.run(Thread.java:662)

      Caused by: java.lang.IllegalArgumentException: Illegal auth method value: MY-AUTH-METHOD

              at org.jboss.wsf.spi.annotation.AuthMethod.valueOf(AuthMethod.java:75)

              at org.jboss.wsf.framework.deployment.ContextRootDeploymentAspect.validateSecuritySettings(ContextRootDeploymentAspect.java:116)

              at org.jboss.wsf.framework.deployment.ContextRootDeploymentAspect.getExplicitContextRoot(ContextRootDeploymentAspect.java:76)

              at org.jboss.wsf.framework.deployment.BackwardCompatibleContextRootDeploymentAspect.getExplicitContextRoot(BackwardCompatibleContextRootDeploymentAspect.java:45)

              at org.jboss.wsf.framework.deployment.ContextRootDeploymentAspect.create(ContextRootDeploymentAspect.java:48)

        • 1. JBoss 5.1 @WebContext custom auth-method failure
          ropalka

          Unfortunately JBWS-2762 fix isn't available on JBossAS 5.x series

          Your only options are either use JBossAS 6.0.0 or JBoss EAP 5x.

          • 2. Re: JBoss 5.1 @WebContext custom auth-method failure
            sridhar18

            I found a work around for this.

             

            Use jboss.xml to specify the web context instead of the @WebContext annotation that's faulty. It should be placed inside the META-INF directory of the ejb jar file.

             

            Sample:

            <jboss>

                <security-domain>java:/jaas/MyDomain</security-domain>

                 <webservices>

                    <context-root>/my-context</context-root>

                </webservices>

                 <enterprise-beans>

                    <session>

                        <ejb-name>MyBean_v1</ejb-name>

                        <port-component>

                            <port-component-name>MyWS</port-component-name>

                            <port-component-uri>/MyService</port-component-uri>

                            <auth-method>MY-AUTH-METHOD</auth-method>

                        </port-component>

                    </session>

                </enterprise-beans>

            </jboss>