[JBoss Seam] - Re: Problem with SFSB passivation
by chlabreu
17:56:25,453 ERROR [[Faces Servlet]] Servlet.service() for servlet Faces Servlet threw exception
javax.faces.FacesException: Error calling action method of component with id cadastro:_id21
at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:74)
at javax.faces.component.UICommand.broadcast(UICommand.java:106)
at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:164)
at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:343)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:86)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:106)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:144)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
Caused by: javax.faces.el.EvaluationException: /cep/FormEstado.xhtml @50,48 action="#{estadoAction.cancelar}": java.lang.RuntimeException: j
ava.io.IOException
at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:73)
at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
... 27 more
Caused by: java.lang.RuntimeException: java.io.IOException
at org.jboss.ejb3.stateful.StatefulBeanContext.extractBeanAndInterceptors(StatefulBeanContext.java:365)
at org.jboss.ejb3.stateful.StatefulBeanContext.getInstance(StatefulBeanContext.java:309)
at org.jboss.ejb3.stateful.StatefulInstanceInterceptor.invoke(StatefulInstanceInterceptor.java:75)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:78)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:47)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:106)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at org.jboss.ejb3.stateful.StatefulContainer.localInvoke(StatefulContainer.java:199)
at org.jboss.ejb3.stateful.StatefulLocalProxy.invoke(StatefulLocalProxy.java:98)
at $Proxy132.cancelar(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.el.parser.AstValue.invoke(AstValue.java:130)
at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:274)
at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
at com.sun.facelets.el.LegacyMethodBinding.invoke(LegacyMethodBinding.java:69)
... 28 more
Caused by: java.io.IOException
at org.jboss.serial.persister.RegularObjectPersister.readSlotWithMethod(RegularObjectPersister.java:107)
at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:269)
at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:241)
at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:411)
at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:81)
at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject(DataContainer.java:639)
at org.jboss.serial.persister.ArrayPersister.readObjectArray(ArrayPersister.java:196)
at org.jboss.serial.persister.ArrayPersister.readData(ArrayPersister.java:172)
at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:411)
at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:81)
at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject(DataContainer.java:639)
at org.jboss.serial.io.JBossObjectInputStream.readObjectOverride(JBossObjectInputStream.java:165)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:343)
at org.jboss.serial.io.MarshalledObject.get(MarshalledObject.java:68)
at org.jboss.ejb3.stateful.StatefulBeanContext.extractBeanAndInterceptors(StatefulBeanContext.java:342)
... 48 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.serial.persister.RegularObjectPersister.readSlotWithMethod(RegularObjectPersister.java:103)
... 62 more
Caused by: java.lang.ClassCastException: java.util.ArrayList
at org.jboss.ejb3.stateful.NestedStatefulBeanContext.readExternal(NestedStatefulBeanContext.java:60)
at org.jboss.serial.persister.ExternalizePersister.readData(ExternalizePersister.java:72)
at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:411)
at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:81)
at org.jboss.serial.objectmetamodel.DataContainer$DataContainerDirectInput.readObject(DataContainer.java:639)
at org.jboss.serial.persister.ObjectInputStreamProxy.readObjectOverride(ObjectInputStreamProxy.java:68)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:343)
at java.util.ArrayList.readObject(ArrayList.java:591)
... 67 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3962290#3962290
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3962290
18 years, 5 months
[Installation, Configuration & Deployment] - JBoss Portal LDAP Authentication
by joelryan2k
I have JBoss portal (2.2.1-SP3-bundled) authenticating correctly against an OpenLDAP server. When I login with a *valid* username/password, though, subsequent pages fail with the error listed below.
Is the problem that the user 'jduke' needs to be in JBoss's user database as well as in LDAP? It seems like the LdapExtLoginModule would take care of this automatically. Do I need to write a custom LoginModule?
I've been all over google on this one and would greatly appreciate any help!
Thanks a million!
-- Joel
exception
javax.servlet.ServletException: No such user No such user jduke
org.jboss.portal.server.servlet.PortalServlet.doGet(PortalServlet.java:227)
javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
root cause
org.jboss.portal.core.model.NoSuchUserException: No such user No such user jduke
org.jboss.portal.core.impl.user.UserModuleImpl.findUserByUserName(UserModuleImpl.java:123)
org.jboss.portal.core.aspects.server.UserInterceptor.invoke(UserInterceptor.java:100)
org.jboss.portal.server.ServerInterceptor.invoke(ServerInterceptor.java:38)
...
Here's the login-config.xml:
<application-policy name="portal">
<login-module code="org.jboss.security.auth.spi.LdapExtLoginModule" flag="required" >
<module-option name="java.naming.provider.url">ldap://localhost:389</module-option>
<module-option name="bindDN">cn=Manager,dc=jboss,dc=org</module-option>
<module-option name="bindCredential">secret</module-option>
<module-option name="baseCtxDN">ou=People,dc=jboss,dc=org</module-option>
<module-option name="baseFilter">(uid={0})</module-option>
<module-option name="rolesCtxDN">ou=Roles,dc=jboss,dc=org</module-option>
<module-option name="roleFilter">(member={1})</module-option>
<module-option name="roleAttributeID">cn</module-option>
<module-option name="roleAttributeIsDN">true</module-option>
<module-option name="roleNameAttributeID">cn</module-option>
<module-option name="roleRecursion">-1</module-option>
<module-option name="searchScope">ONELEVEL_SCOPE</module-option>
<module-option name="password-stacking">useFirstPass</module-option>
<module-option name="passwordValidation">remote</module-option>
</login-module>
</application-policy>
And here's what's in the LDAP:
dn: dc=jboss,dc=org
objectclass: top
objectclass: dcObject
objectclass: organization
dc: jboss
o: JBoss
dn: ou=People,dc=jboss,dc=org
objectclass: top
objectclass: organizationalUnit
ou: People
dn: uid=jduke,ou=People,dc=jboss,dc=org
objectclass: top
objectclass: uidObject
objectclass: person
uid: jduke
cn: Java Duke
sn: Duke
userPassword: theduke
dn: ou=Roles,dc=jboss,dc=org
objectclass: top
objectclass: organizationalUnit
ou: Roles
dn: cn=JBossAdmin,ou=Roles,dc=jboss,dc=org
objectclass: top
objectclass: groupOfNames
cn: JBossAdmin
member: uid=jduke,ou=People,dc=jboss,dc=org
description: the JBossAdmin group
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3962288#3962288
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3962288
18 years, 5 months
[EJB 3.0] - Programmatically query @RolesAllowed or if caller can access
by matt10
How do I find out programmatically which other methods can be called on a session bean by an authenticated user from in a bean method?
>From a client I'm trying to query what methods the user can call on the session bean, in order to enable and disable menu items and functionality as appropriate on the client.
On the session bean I have created a method which is supposed to return a list of the methods accessible on the bean (simplified):
@PermitAll
public String[] getAllowedMethods() {
...
}
In this method I'm trying to iterate through the methods on the session bean checking to see if the caller has permission to access each one. I want to return a list of the accessible methods to the client. After a week of exploring, searching on forums and trying out code I cannot find a way to do this.
I could find no methods which give me access to this metadata from the bean so I've tried querying the annotations myself from a static class reference to the actual Session Bean (MySessionBean.class) but the annotations come back as proxies and code reports there are no @Remote, @RolesAllowed etc. annotations on the class I have a reference to, so I presume the ClassLoader is returning me a bean proxy.
I've looked at SessionContext, EJBHome, EJBMetaData seeking this security information about EJB methods but to no avail. All I have is a suspicion that the information I am looking for is available to interceptors.
Anyone know how to query bean methods for roles allowed at runtime?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3962286#3962286
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3962286
18 years, 5 months
[JBossWS] - Re: Using WSSecurityHandlerOutbound in a DII client
by acxjbertr
I got it working. Here is the DII code:
package com.mycompany.client.test.ws;
|
| import java.net.MalformedURLException;
| import java.net.URL;
| import java.rmi.RemoteException;
| import java.util.ArrayList;
| import java.util.List;
|
| import javax.xml.namespace.QName;
| import javax.xml.rpc.ServiceException;
| import javax.xml.rpc.handler.HandlerInfo;
|
| import junit.framework.TestCase;
|
| import org.jboss.ws.jaxrpc.ServiceExt;
| import org.jboss.ws.jaxrpc.ServiceFactoryImpl;
| import org.jboss.ws.jaxrpc.ServiceImpl;
| import org.jboss.ws.wsse.WSSecurityHandlerOutbound;
|
| import ...
|
| public class WSTestCase extends TestCase {
| private static final String SERVICE_NAMESPACE = "http://client.mycompany.com/clientstuff/1.0";
|
| private String testDescription = null;
|
| // Possible Outputs
| private String exceptionThrown = null;
|
| public void testPlanStep1() throws MalformedURLException, ServiceException {
| go(getInput());
| }
|
| private void go(Echo request) throws ServiceException, MalformedURLException {
| System.out.println("\n" + this.testDescription + "\n");
| displayTestInput(request);
|
| String expectedOutput = determineExpectedOutput();
| try {
| ClientServiceEndpoint clientServiceEndpoint = getEndpoint();
| EchoResponse echoResponse = clientServiceEndpoint.echo(request);
|
| ClientServiceReply clientServiceReply = echoResponse.getResult();
| System.out.println(clientServiceReply.getAuditId());
|
| } catch (Exception e) {
| String exceptionThrown = e.getClass().getName();
| displayOutput(expectedOutput, exceptionThrown);
| displayResult(exceptionThrown.equals(expectedOutput));
| e.printStackTrace();
| assertTrue(false);
| }
| }
|
| private ClientServiceEndpoint getEndpoint() throws MalformedURLException, ServiceException, InvalidRequestException, SystemUnavailableException, RemoteException {
| ServiceFactoryImpl factory = new ServiceFactoryImpl();
| ClassLoader cl = Thread.currentThread().getContextClassLoader();
| URL wsdlLocation = new URL("http://localhost:8080/clientService/ClientService?wsdl");
| URL mappingLocation = cl.getResource("client-mapping.xml");
| URL securityLocation = cl.getResource("jboss-wsse-client.xml");
| QName serviceName = new QName(SERVICE_NAMESPACE, "ClientService");
| ServiceImpl service = (ServiceImpl) factory.createService(wsdlLocation, serviceName, mappingLocation, securityLocation);
| setupWSSecurityHandler(service);
| return (ClientServiceEndpoint) service.getPort(ClientServiceEndpoint.class);
| }
|
| private Echo getInput() {
| Echo echoInput = new Echo();
| ClientServiceRequest clientServiceRequest = new ClientServiceRequest();
| clientServiceRequest.setAuditId("eggie");
| echoInput.setClientServiceRequest_1(clientServiceRequest);
|
| return echoInput;
| }
|
| private void setupWSSecurityHandler(ServiceExt service) {
| List<HandlerInfo> clientHandlerChain = new ArrayList<HandlerInfo>();
| HandlerInfo handler = new HandlerInfo();
| handler.setHandlerClass(WSSecurityHandlerOutbound.class);
| clientHandlerChain.add(handler);
| QName securityName = new QName(SERVICE_NAMESPACE, "ClientStuffEndpointPort");
| service.getDynamicHandlerRegistry().setHandlerChain(securityName, clientHandlerChain);
| }
| }
|
|
Notice the use of the jboss-wsse-client.xml file as input to the createService method.
Here is my jboss-wsse-client.xml:
<?xml version="1.0" encoding="UTF-8"?>
| <jboss-ws-security xmlns="http://www.jboss.com/ws-security/config"
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| xsi:schemaLocation="http://www.jboss.com/ws-security/config http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
| <key-store-file>wsse.keystore</key-store-file>
| <key-store-password>jbossws</key-store-password>
| <trust-store-file>wsse.truststore</trust-store-file>
| <trust-store-password>jbossws</trust-store-password>
| <config>
| <sign type="x509v3" alias="wsse" />
| <requires>
| <signature />
| </requires>
| </config>
| </jboss-ws-security>
Of course, I used the keystore and truststore from the JBossWS 1.0.2 sample archive.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3962284#3962284
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3962284
18 years, 5 months
[Tomcat, HTTPD, Servlets & JSP] - Automatic redirect to primary domain name?
by flarosa
Hi,
My customer has registered several different domain names that all point to their web site, and all work interchangeably as far as normal HTTP requests are concerned.
However, their SSL certificate was issued only against one of these names, and if you attempt to hit their site via HTTPS on any of the other names, you get a warning in the browser saying the site name doesn't match the cert.
Fortunately, their home page doesn't need to be secure and users will typically hit the home page using HTTP before they proceed to the secure part of the site. My temporary solution was to insert some scriptlet code into the home page that checks if request.getServerName() equals the primary domain name, and if not, do a redirect to the primary domain name.
Is there a better way to do this without having to insert scriptlet code into the page? I don't like that solution because it hard-codes their domain name in the page, and it also doesn't help if people bypass the home page and link to other pages in the site.
Thanks,
Frank
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3962281#3962281
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3962281
18 years, 5 months