  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Struts - A MVC web framework | | Tomcat - JSP/Servlet container | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | | JSP - A mailing list about Java Server Pages specification and reference | |
Struts & Hibernate
|
|
|
  | | | Authentication (login) failure | Authentication (login) failure 2004-07-08 - By Tim Wood
Back This should be obvious, but it isn't.
I have a Web service endpoint deployed as a J2EE stateless session bean (SSB) in J2EE SDK 1.4. I have configured it to perform a Basic login dialogue with connecting SOAP clients. I have registered the users and groups in the admin tool, created the necessary role and mapped it in the deployment descriptor. My client code sets up the stub properties for login per the Tutorial examples. Nevertheless I get the following stack trace and errors in the log. The SOAP call goes through, but the server side sees the user as ANONYMOUS instead of the login user. The "CLIENT CERT" part is puzzling as I've set up login /password. TIA, TW
[#|2004-07-06T00:06:31.236-0700|WARNING|j2ee-appserver1.4|javax.enterprise .system.container.ejb|_ThreadID=11;|CLIENT CERT http header parsing error for ProviderIF|#]
[#|2004-07-06T00:06:31.246-0700|WARNING|j2ee-appserver1.4|javax.enterprise .system.container.ejb|_ThreadID=11;|authentication failed for ProviderIF java.lang.NullPointerException  at com.sun.web.security.RealmAdapter.authenticate(RealmAdapter.java:240) at com.sun.enterprise.webservice.EjbWebServiceValve.doSecurity (EjbWebServiceValve.java:230) at com.sun.enterprise.webservice.EjbWebServiceValve .dispatchToEjbEndpoint(EjbWebServiceValve.java:164) at com.sun.enterprise.webservice.EjbWebServiceValve.invoke (EjbWebServiceValve.java:127) ... at org.apache.coyote.http11.Http11Processor (Http11Processor .java:648) at org.apache.coyote.http11.Http11Protocol $Http11ConnectionHandler .processConnection(Http11Protocol.java:498) at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint .java:575) at org.apache.tomcat.util.threads.ThreadPool $ControlRunnable.run (ThreadPool.java:649) at java.lang.Thread (Thread.java:534)
Deployment descriptor: sun-ejb-jar.xml:
<ejb> <ejb-name>ProviderEJB</ejb-name> <jndi-name>ProviderEJB</jndi-name> <resource-ref> <res-ref-name>jdbc/MyApp-ProviderFacet-pub</res-ref-name> <jndi-name>jdbc/MyApp-ProviderFacet-pub</jndi-name> </resource-ref> <resource-ref> <res-ref-name>jms/QueueConnectionFactory</res-ref-name> <jndi-name>jms/QueueConnectionFactory</jndi-name> </resource-ref> <webservice-endpoint> <port-component-name>ProviderIF</port-component-name> <endpoint-address-uri>OrderServer/Provider</endpoint-address-uri> <login-config> <auth-method>Basic</auth-method> </login-config> </webservice-endpoint> </ejb>
ejb-jar.xml: <enterprise-beans> <session> <ejb-name>ProviderEJB</ejb-name> ... <security-role-ref> <role-name>Provider</role-name> <role-link>Provider</role-link> </security-role-ref> <security-identity> <use-caller-identity> </use-caller-identity> </security-identity> </session> ...
Client-side code: // Get the object that talks to the facet. // This can be used via reflection Method calls, or // cast to the actual interface class type and called // directly. // Get a service reference object Service service = serviceFactory.createService(new URL(URLString), new QName(nameSpaceURI(index), m_svcName));
m_IFProxy = service.getPort( new QName(nameSpaceURI(index), IFName + "Port"), m_IFClass);
// Login with a username to establish artistID ((Stub) m_IFProxy)._setProperty( javax.xml.rpc.Stub , "aUser"); ((Stub) m_IFProxy)._setProperty( javax.xml.rpc.Stub , "changeit"); // This shows the expected URL System.out.println("endpoint " + (String) ((Stub) m_IFProxy)._getProperty( javax.xml.rpc.Stub ));
Server-side code (SSB class):
sessionContext.getCallerPrincipal().getName(); // Always returns ANONYMOUS sessionContext.isCallerInRole("Provider"); // Always FALSE
PS I had to send this message 3 times: first it was rejected because the subject started with "login"; second it was rejected at a different level because the text was the same as the 1st. Here we go again. good night.
=========================================================================== To unsubscribe, send email to listserv@(protected) and include in the body of the message "signoff J2EE-INTEREST". For general help, send email to listserv@(protected) and include in the body of the message "help".
|
|
 |