[Security & JAAS/JBoss] - Re: Simple JAAS authentication not working....
by j0llyr0g3r
Thx very much, that was indeed missing!
Now i am one step further, Jboss gives me no more errors when i try to access my EJB-application, but unfortunately the (stand-alone & remote) RMI-client does:
ERROR [SocketClientInvoker.handleException]: Got marshalling exception, exiting
| java.lang.ClassNotFoundException: javax.ejb.EJBAccessException
| at org.jboss.remoting.serialization.ClassLoaderUtility.loadClass(ClassLoaderUtility.java:82)
| at org.jboss.remoting.loading.RemotingClassLoader.loadClass(RemotingClassLoader.java:76)
| at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
| at java.lang.Class.forName0(Native Method)
| at java.lang.Class.forName(Class.java:247)
| at org.jboss.remoting.loading.ObjectInputStreamWithClassLoader.resolveClass(ObjectInputStreamWithClassLoader.java:174)
| at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)
| at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
| at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
| at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
| at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
| at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1871)
| at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
| at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
| at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
| at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObjectVersion2_2(JavaSerializationManager.java:239)
|
* Googling for this error messages i found - literally - nothing.
* If I remove all stuff which deals with authentification from client + Jboss + EAR everything works fine again, so this error is definitely caused by something which is related to JAAS
* I have the jar "jbossall-client.jar" in my clients classpath, i thought this should be enough, but this jar does not contain the mentioned "java.lang.ClassNotFoundException: javax.ejb.EJBAccessException" the only thing i find is "javax/ejb/AccessLocalException.class" (in the unpacked jar)
I try to connect to the server like that:
| Hashtable<String, String> props = new Hashtable<String, String>();
| props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
| props.put(Context.PROVIDER_URL,"jnp://" + "myhost");
| props.put(Context.SECURITY_PRINCIPAL, "myuser");
| props.put(Context.SECURITY_CREDENTIALS, "mypassword");
| Context ctx = new InitialContext(props);
| // get RMI stub
| ISendCommand sendCommand = (ISendCommand) ctx.lookup(myjndiname);
| String result = sendCommand.sendCommand(myArgs);
|
Does anybody know what i am doing wrong / in which jar this class is located?
#####################################
For readers which are as unexperienced as i am in JAAS, here is a quick summary what i have done so far (hopefully it helps you):
* Create the file users.properties under /$PROJECT-ROOT/META-INF:
admin=secretadminpassword
| user=secretuserpassword
* Create the file roles.properties under /$PROJECT-ROOT/META-INF:
admin=adminRole
| user=userRole
* Add a ejb-jar.xml to the ejb-jar subproject under the directory META-INF:
<ejb-jar>
| <assembly-descriptor>
| <security-role>
| <description>admin: only allowed users</description>
| <role-name>adminRole</role-name>
| </security-role>
| <security-role>
| <description>users: the rest</description>
| <role-name>userRole</role-name>
| </security-role>
| <method-permission>
| <role-name>admin</role-name>
| <method>
| <ejb-name>SendCommand</ejb-name>
| <method-name>*</method-name>
| </method>
| </method-permission>
| </assembly-descriptor>
| </ejb-jar>
|
* Add the file jboss.xml under the directory /$PROJECT-ROOT/META-INF
<jboss>
| <security-domain>java:/jaas/esf</security-domain>
| <enterprise-beans>
| <session>
| <ejb-name>SendCommand</ejb-name>
| <jndi-name>SendCommand</jndi-name>
| </session>
| </enterprise-beans>
| </jboss>
|
* Adjust the file login-config.xml under the directory $JBOSS_HOME/server/$PROFILE/conf/
<application-policy name = "esf">
| <authentication>
| <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag = "required">
| <module-option
| name="usersProperties">
| META-INF/users.properties
| </module-option>
| <module-option
| name="rolesProperties">
| META-INF/roles.properties
| </module-option>
| </login-module>
| </authentication>
| </application-policy>
|
* Add annotations to the EJB
@SecurityDomain("esf")
| .....
| public class SendCommand....
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4158034#4158034
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4158034
17 years, 10 months
[JBoss jBPM] - Re: Mail Node
by Fornachari
Yes, I have the same doubt.
I know that I am asking too much, but I did understand how to configure JBoss jBPM to use the mail-node.
I am trying to follow this guide http://docs.jboss.org/jbpm/v3/userguide/mail.html but It is a little confuse.
Inside my jBPM project in eclipse there is a configuration file called jbpm.cfg.xml. By default it came empty. Inside the file there are only some informations, not very clear, about how customize the jbpm.cfg.xml's values.
I configured the jbpm.cfg.xml file like below:
| <jbpm-configuration>
|
| <jbpm-context>
| <service name="persistence">
| <factory>
| <bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory">
| <field name="isTransactionEnabled"><false/></field>
| </bean>
| </factory>
| </service>
| <service name="tx" factory="org.jbpm.tx.TxServiceFactory" />
| <service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" />
| <service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" />
| <service name="logging" factory="org.jbpm.logging.db.DbLoggingServiceFactory" />
| <service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" />
| </jbpm-context>
|
| <string name="resource.hibernate.cfg.xml" value="jbpm.hibernate.cfg.xml" />
|
| <string name="resource.parsers" value="org/jbpm/jpdl/par/jbpm.parsers.xml" />
|
| <string name="jbpm.mail.templates" value="jbpm.mail.templates.xml" />
| <string name="resource.mail.properties" value="jbpm.mail.properties" />
|
| <string name="jbpm.mail.smtp.host" value="MySMTPServer" />
| <bean name="jbpm.mail.address.resolver" class="org.jbpm.identity.mail.IdentityAddressResolver" singleton="true" />
| <string name="jbpm.mail.from.address" value="wf(a)test.com" />
|
| </jbpm-configuration>
|
Then I tried to send an email using a email-node. I filled the form "Mail Info" in eclipse, with the subject, "to" and the message, then I deployed my process and start it from the jBPM Adm Console. In my process there is a form with a "SEND" button, when I click in SEND, my process should go to the mail-node and send the email. But when I did that I received the error below in jBPM Adm Console:
Error completing task: An exception of type "org.jbpm.JbpmException" was thrown. The message is: couldn't send email
The complete error is below:
| 12:02:49,539 WARN [ProxyWarnLog] Narrowing proxy to class org.jbpm.graph.node.StartState - this operation breaks ==
| 12:02:49,555 ERROR [GraphElement] action threw exception: couldn't send email
| org.jbpm.JbpmException: couldn't send email
| at org.jbpm.mail.Mail.send(Mail.java:152)
| at org.jbpm.mail.Mail.send(Mail.java:116)
| at org.jbpm.mail.Mail.execute(Mail.java:63)
| at org.jbpm.graph.def.Action.execute(Action.java:122)
| at org.jbpm.graph.def.Action$$FastClassByCGLIB$$7876e90e.invoke(<generated>)
| at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
| at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
| at org.jbpm.graph.def.Action$$EnhancerByCGLIB$$9969df7d.execute(<generated>)
| at org.jbpm.graph.def.GraphElement.executeAction(GraphElement.java:264)
| at org.jbpm.graph.node.MailNode.execute(MailNode.java:29)
| at org.jbpm.graph.def.Node.enter(Node.java:319)
| at org.jbpm.graph.def.Node$$FastClassByCGLIB$$d187eeda.invoke(<generated>)
| at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
| at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
| at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$9fffe621.enter(<generated>)
| at org.jbpm.graph.def.Transition.take(Transition.java:151)
| at org.jbpm.graph.def.Node.leave(Node.java:394)
| at org.jbpm.graph.node.StartState.leave(StartState.java:70)
| at org.jbpm.graph.def.Node$$FastClassByCGLIB$$d187eeda.invoke(<generated>)
| at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
| at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
| at org.jbpm.graph.def.Node$$EnhancerByCGLIB$$9fffe621.leave(<generated>)
| at org.jbpm.graph.exe.Token.signal(Token.java:195)
| at org.jbpm.graph.exe.Token.signal(Token.java:166)
| at org.jbpm.graph.exe.Token$$FastClassByCGLIB$$74df1c6e.invoke(<generated>)
| at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
| at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitializer.intercept(CGLIBLazyInitializer.java:163)
| at org.jbpm.graph.exe.Token$$EnhancerByCGLIB$$cf59539d.signal(<generated>)
| at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:488)
| at org.jbpm.taskmgmt.exe.TaskInstance.end(TaskInstance.java:427)
| at org.jbpm.jsf.core.action.CompleteTaskActionListener.handleAction(CompleteTaskActionListener.java:52)
| at org.jbpm.jsf.core.impl.JbpmActionListenerWrapper.processAction(JbpmActionListenerWrapper.java:82)
| at javax.faces.event.ActionEvent.processListener(ActionEvent.java:77)
| at javax.faces.component.UIComponentBase.broadcast(UIComponentBase.java:758)
| at javax.faces.component.UICommand.broadcast(UICommand.java:368)
| at org.jbpm.jsf.taskform.ui.UITaskFormButtonBase.broadcast(UITaskFormButtonBase.java:56)
| at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:448)
| at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:752)
| at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:97)
| at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:248)
| at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:117)
| at javax.faces.webapp.FacesServlet.service(FacesServlet.java:244)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| 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.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
| 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(Unknown Source)
| Caused by: javax.mail.SendFailedException: Sending failed;
| nested exception is:
| class javax.mail.SendFailedException: Invalid Addresses;
| nested exception is:
| class javax.mail.SendFailedException: 550 5.7.1 Unable to relay for MyName(a)MyCompany.com
|
| at javax.mail.Transport.send0(Transport.java:218)
| at javax.mail.Transport.send(Transport.java:80)
| at org.jbpm.mail.Mail.send(Mail.java:150)
| ... 60 more
|
Probably I did not do the correct configurations to use email-node in jBPM.
Any body could help me?
Any help would be appreciated!
Thanks very much!
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4158033#4158033
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4158033
17 years, 10 months