From do-not-reply at jboss.com Wed Apr 8 21:49:01 2009 Content-Type: multipart/mixed; boundary="===============2347644779006905556==" MIME-Version: 1.0 From: sun-certified To: jbossws-metro-users at lists.jboss.org Subject: [jbossws-metro-users] [JBossWS-Metro] - Re: RealmAuthenticator is not a valid RealmAuthenticationPro Date: Wed, 08 Apr 2009 21:49:01 -0400 Message-ID: <3100550.1239241741153.JavaMail.jboss@colo-br-02.atl.jboss.com> --===============2347644779006905556== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable thanks richard for your very helpful and informative reply. sincerely appre= ciated. i've implemented javax.security.auth.callback.CallbackHandler like you said= . but i still get the same error. i've removed META-INF/services/com.sun.xml.xwss.RealmAuthenticator from my = war in order to shut it up. now i'm getting a whole new set of problems! please, can you help me figure this out? thanks again richard for your help. = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D | package net.javafreelancer.tutorials.jboss; | = | import javax.servlet.http.HttpServlet; | = | import java.io.IOException; | import java.io.PrintWriter; | import java.net.URL; | = | import javax.servlet.ServletException; | import javax.servlet.http.*; | import javax.xml.ws.WebServiceRef; | = | public class MutualCertTestClientServlet extends HttpServlet { | = | /** | * = | */ | private static final long serialVersionUID =3D -8952375438224208530L; | = | @WebServiceRef(wsdlLocation =3D "http://localhost:6060/MutualCertTestA= pp/MutualCertTestService?wsdl") | private MutualCertTestServiceService service; | = | = | = | public MutualCertTestClientServlet() { | } | = | protected void processRequest(HttpServletRequest request, | HttpServletResponse response) throws ServletException, IOException { | service =3D new MutualCertTestServiceService(); | PrintWriter out; | response.setContentType("text/html;charset=3DUTF-8"); | out =3D response.getWriter(); | try { | out.println(""); | out.println(""); | out.println("Servlet MutualCertTestClientServlet"); | out.println(""); | out.println(""); | out.println((new StringBuilder()).append( | "

Servlet MutualCertTestClientServlet at ").append( | request.getContextPath()).append("

").toString()); | try { | MutualCertTestService port =3D service.getMutualCertTestPort(); | String result =3D port.testGetUserPrincipal(); | out.println((new StringBuilder()) | .append("

User Principal =3D ").append(result) | .toString()); | = | } catch (Exception ex) { | out.println((new StringBuilder()).append("

Exception =3D ") | .append(ex).toString()); | } | out.println(""); | out.println(""); | out.close(); | } finally { | out.close(); | } | } | = | protected void doGet(HttpServletRequest request, | HttpServletResponse response) throws ServletException, IOException { | processRequest(request, response); | } | = | protected void doPost(HttpServletRequest request, | HttpServletResponse response) throws ServletException, IOException { | processRequest(request, response); | } | = | public String getServletInfo() { | return "Short description"; | } | = | } | = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D package net.javafreelancer.tutorials.jboss; | = | import java.security.Principal; | = | import javax.annotation.Resource; | import javax.jws.WebMethod; | import javax.jws.WebParam; | import javax.jws.WebService; | import javax.xml.bind.annotation.XmlSeeAlso; | import javax.xml.ws.WebServiceContext; | = | = | //@XmlSeeAlso(com.sun.xml.ws.security.opt.crypto.dsig.SignedInfo.class) | @WebService( | name=3D"MutualCertTestService", | portName =3D "MutualCertTestPort" | ) | public class MutualCertTestService { | = | @Resource | WebServiceContext wsCtx; | = | @WebMethod(operationName=3D"testGetUserPrincipal",action=3D"testGetUse= rPrincipal") | public String testGetUserPrincipal() | { | Principal principal =3D wsCtx.getUserPrincipal(); | String name =3D null; | if(principal !=3D null) | name =3D principal.getName(); | return name; | } | @WebMethod(operationName=3D"testIsUserInRole",action=3D"testIsUserInRo= le") | public boolean testIsUserInRole(@WebParam(name=3D"role") String rol= e) | { | return wsCtx.isUserInRole(role); | } | = | } | = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D | /* | * JBoss, Home of Professional Open Source. | * Copyright 2006, Red Hat Middleware LLC, and individual contributors | * as indicated by the @author tags. See the copyright.txt file in the | * distribution for a full listing of individual contributors. | * | * This is free software; you can redistribute it and/or modify it | * under the terms of the GNU Lesser General Public License as | * published by the Free Software Foundation; either version 2.1 of | * the License, or (at your option) any later version. | * | * This software is distributed in the hope that it will be useful, | * but WITHOUT ANY WARRANTY; without even the implied warranty of | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | * Lesser General Public License for more details. | * | * You should have received a copy of the GNU Lesser General Public | * License along with this software; if not, write to the Free | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | */ | package org.jboss.test.ws.jaxws.samples.wsse; | = | import java.io.IOException; | = | import javax.security.auth.Subject; | import javax.security.auth.callback.Callback; | import javax.security.auth.callback.UnsupportedCallbackException; | = | import com.sun.xml.wss.RealmAuthenticationAdapter; | import com.sun.xml.wss.XWSSecurityException; | = | /** | * A simple realm authenticator showing how to override the WSIT defaul= t (which | * is based on tomcat-users.xml when not running on Glassfish) | * = | * @author alessio.soldano(a)jboss.com | * @since 25-Apr-2008 | * = | */ | public class RealmAuthenticator extends RealmAuthenticationAdapter impl= ements | javax.security.auth.callback.CallbackHandler { | = | @Override | public boolean authenticate(Subject callerSubject, String username, | String password) throws XWSSecurityException { | System.out.println("Custom realm authenticator called: username=3D" | + username + ", password=3D" + password); | return (username.equals("kermit") && password.equals("thefrog")); | } | = | @Override | public void handle(Callback[] callbacks) throws IOException, | UnsupportedCallbackException { | // TODO Auto-generated method stub | = | } | } | = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D | ... | 2009-04-09 01:45:31,781 DEBUG [org.jboss.wsf.framework.deployment.Deplo= ymentAspectManagerImpl] (HDScanner) EndpointMetricsDeploymentAspect:Destroy | 2009-04-09 01:45:31,781 ERROR [org.jboss.kernel.plugins.dependency.Abst= ractKernelController] (HDScanner) Error installing to Real: name=3Dvfszip:/= C:/development/jboss-5.0.1.GA-jdk6/server/default/deploy/MutualCertTestApp.= war/ state=3DPreReal mode=3DManual requiredState=3DReal | org.jboss.deployers.spi.DeploymentException: Error during deploy: vfszi= p:/C:/development/jboss-5.0.1.GA-jdk6/server/default/deploy/MutualCertTestA= pp.war/ | at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentExce= ption(DeploymentException.java:49) | at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(Deploy= erWrapper.java:177) | at org.jboss.deployers.plugins.deployers.DeployersImpl.doDeploy(Deploy= ersImpl.java:1439) | at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParent= First(DeployersImpl.java:1157) | at org.jboss.deployers.plugins.deployers.DeployersImpl.install(Deploye= rsImpl.java:1098) | at org.jboss.dependency.plugins.AbstractControllerContext.install(Abst= ractControllerContext.java:348) | at org.jboss.dependency.plugins.AbstractController.install(AbstractCon= troller.java:1598) | at org.jboss.dependency.plugins.AbstractController.incrementState(Abst= ractController.java:934) | at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abs= tractController.java:1062) | at org.jboss.dependency.plugins.AbstractController.resolveContexts(Abs= tractController.java:984) | at org.jboss.dependency.plugins.AbstractController.change(AbstractCont= roller.java:822) | at org.jboss.dependency.plugins.AbstractController.change(AbstractCont= roller.java:553) | at org.jboss.deployers.plugins.deployers.DeployersImpl.process(Deploye= rsImpl.java:781) | at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeplo= yerImpl.java:698) | at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDS= canner.java:290) | at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDSc= anner.java:221) | at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:= 441) | at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.ja= va:317) | at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) | at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTas= k.access$101(ScheduledThreadPoolExecutor.java:98) | at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTas= k.runPeriodic(ScheduledThreadPoolExecutor.java:181) | at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTas= k.run(ScheduledThreadPoolExecutor.java:205) | at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolEx= ecutor.java:886) | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecut= or.java:908) | at java.lang.Thread.run(Thread.java:619) | Caused by: javax.xml.ws.WebServiceException: Failed to build METRO runt= ime model | at org.jboss.wsf.stack.metro.metadata.RuntimeModelDeploymentAspect.sta= rt(RuntimeModelDeploymentAspect.java:133) | at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.depl= oy(DeploymentAspectManagerImpl.java:129) | at org.jboss.wsf.container.jboss50.deployer.ArchiveDeployerHook.deploy= (ArchiveDeployerHook.java:75) | at org.jboss.wsf.container.jboss50.deployer.AbstractWebServiceDeployer= .internalDeploy(AbstractWebServiceDeployer.java:60) | at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deplo= y(AbstractRealDeployer.java:50) | at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(Deploy= erWrapper.java:171) | ... 23 more | Caused by: java.lang.RuntimeException: WSSTUBE0028: Error in creating n= ew instance of SecurityServerTube | at com.sun.xml.wss.jaxws.impl.SecurityServerTube.(SecurityServer= Tube.java:155) | at com.sun.xml.wss.provider.wsit.SecurityTubeAppender.appendTube(Secur= ityTubeAppender.java:129) | at com.sun.xml.ws.assembler.TubelineAssemblerFactoryImpl$WsitTubelineA= ssembler.createServer(TubelineAssemblerFactoryImpl.java:101) | at com.sun.xml.ws.server.WSEndpointImpl.(WSEndpointImpl.java:152) | at com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactor= y.java:217) | at com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:467) | at org.jboss.wsf.stack.metro.DeploymentDescriptorParserExt.parseAdapte= rs(DeploymentDescriptorParserExt.java:295) | at org.jboss.wsf.stack.metro.DeploymentDescriptorParserExt.parse(Deplo= ymentDescriptorParserExt.java:171) | at org.jboss.wsf.stack.metro.metadata.RuntimeModelDeploymentAspect.sta= rt(RuntimeModelDeploymentAspect.java:109) | ... 28 more | Caused by: java.lang.RuntimeException: WSSTUBE0027: Error in configurin= g Server Security Callback Handler. | at com.sun.xml.wss.jaxws.impl.SecurityServerTube.configureServerHandle= r(SecurityServerTube.java:739) | at com.sun.xml.wss.jaxws.impl.SecurityServerTube.(SecurityServer= Tube.java:150) | ... 36 more | Caused by: com.sun.xml.wss.impl.XWSSecurityRuntimeException: Class :org= .jboss.test.ws.jaxws.samples.wsse.RealmAuthenticator is not a valid RealmAu= thenticationProvider | at com.sun.xml.wss.RealmAuthenticationAdapter.newInstance(RealmAuthent= icationAdapter.java:109) | at com.sun.xml.wss.jaxws.impl.SecurityServerTube.getRealmAuthenticatio= nAdapter(SecurityServerTube.java:767) | at com.sun.xml.wss.jaxws.impl.SecurityServerTube.configureServerHandle= r(SecurityServerTube.java:733) | ... 37 more | 2009-04-09 01:45:31,781 DEBUG [org.jboss.classloader.spi.base.BaseClass= LoaderDomain] (HDScanner) ClassLoaderDomain(a)1916b85{vfszip:/C:/developmen= t/jboss-5.0.1.GA-jdk6/server/default/deploy/MutualCertTestApp.war/} unregis= terClassLoader BaseClassLoader(a)29fe15{vfszip:/C:/development/jboss-5.0.1.= GA-jdk6/server/default/deploy/MutualCertTestApp.war/} | 2009-04-09 01:45:31,781 DEBUG [org.jboss.mx.loading.UnifiedLoaderReposi= tory3] (HDScanner) UnifiedLoaderRepository removed(false) null | 2009-04-09 01:45:31,781 DEBUG [org.jboss.classloader.spi.base.BaseClass= LoaderPolicy] (HDScanner) VFSClassLoaderPolicy(a)e819e9{vfszip:/C:/developm= ent/jboss-5.0.1.GA-jdk6/server/default/deploy/MutualCertTestApp.war/} shutd= own! | 2009-04-09 01:45:31,781 DEBUG [org.jboss.classloader.spi.base.BaseClass= Loader] (HDScanner) BaseClassLoader(a)29fe15{vfszip:/C:/development/jboss-5= .0.1.GA-jdk6/server/default/deploy/MutualCertTestApp.war/} shutdown! | 2009-04-09 01:45:31,781 DEBUG [org.jboss.classloader.spi.base.BaseClass= LoaderDomain] (HDScanner) ClassLoaderDomain(a)1916b85{vfszip:/C:/developmen= t/jboss-5.0.1.GA-jdk6/server/default/deploy/MutualCertTestApp.war/} shutdow= n! | 2009-04-09 01:45:31,781 DEBUG [org.jboss.classloader.spi.ClassLoaderSys= tem] (HDScanner) DefaultClassLoaderSystem(a)24de7d unregistered domain=3DCl= assLoaderDomain(a)1916b85{name=3Dvfszip:/C:/development/jboss-5.0.1.GA-jdk6= /server/default/deploy/MutualCertTestApp.war/ parentPolicy=3DAFTER_BUT_JAVA= _BEFORE parent=3DClassLoaderDomain(a)8b058b{DefaultDomain}} | 2009-04-09 01:45:31,781 DEBUG [org.jboss.classloading.spi.dependency.Do= main] (HDScanner) org.jboss.classloading.spi.dependency.Domain(a)10f14ba{vf= szip:/C:/development/jboss-5.0.1.GA-jdk6/server/default/deploy/MutualCertTe= stApp.war/} remove module VFSDeploymentClassLoaderPolicyModule vfszip:/C:/d= evelopment/jboss-5.0.1.GA-jdk6/server/default/deploy/MutualCertTestApp.war/= :0.0.0 | 2009-04-09 01:45:31,781 DEBUG [org.jboss.deployers.vfs.plugins.classloa= der.InMemoryClassesDeployer] (HDScanner) Removing dynamic class root for vf= szip:/C:/development/jboss-5.0.1.GA-jdk6/server/default/deploy/MutualCertTe= stApp.war/ | 2009-04-09 01:45:31,781 WARN [org.jboss.system.server.profileservice.h= otdeploy.HDScanner] (HDScanner) Failed to process changes | org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary o= f incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS): | = | DEPLOYMENTS IN ERROR: | Deployment "vfszip:/C:/development/jboss-5.0.1.GA-jdk6/server/default= /deploy/MutualCertTestApp.war/" is in error due to the following reason(s):= com.sun.xml.wss.impl.XWSSecurityRuntimeException: Class :org.jboss.test.ws= .jaxws.samples.wsse.RealmAuthenticator is not a valid RealmAuthenticationPr= ovider | = | at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(D= eployersImpl.java:863) | at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(Mai= nDeployerImpl.java:806) | at org.jboss.system.server.profileservice.hotdeploy.HDScanner.scan(HDS= canner.java:293) | at org.jboss.system.server.profileservice.hotdeploy.HDScanner.run(HDSc= anner.java:221) | at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:= 441) | at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.ja= va:317) | at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:150) | at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTas= k.access$101(ScheduledThreadPoolExecutor.java:98) | at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTas= k.runPeriodic(ScheduledThreadPoolExecutor.java:181) | at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTas= k.run(ScheduledThreadPoolExecutor.java:205) | at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolEx= ecutor.java:886) | at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecut= or.java:908) | at java.lang.Thread.run(Thread.java:619) | ... | = View the original post : http://www.jboss.org/index.html?module=3Dbb&op=3Dv= iewtopic&p=3D4224523#4224523 Reply to the post : http://www.jboss.org/index.html?module=3Dbb&op=3Dpostin= g&mode=3Dreply&p=3D4224523 --===============2347644779006905556==--