[JBoss Messaging] - Switching messaging to ldap
by Nikos Massios
Nikos Massios [http://community.jboss.org/people/massios] created the discussion
"Switching messaging to ldap"
To view the discussion, visit: http://community.jboss.org/message/576600#576600
--------------------------------------------------------------
Hello,
We are trying to switch jboss messaging to use ldap as a user source on a JBoss 5.1 GA.
in the file
\server\nodeX\deploy\messaging\messaging-jboss-beans.xml
There is a part that defines the application-policy and the default is to take the users from the data base
<application-policy xmlns="urn:jboss:security-beans:1.0" name="messaging">
<authentication>
<login-module code="org.jboss.security.auth.spi.DatabaseServerLoginModule" flag="required">
<module-option name="unauthenticatedIdentity">guest</module-option>
<module-option name="dsJndiName">java:/DefaultDS</module-option>
<module-option name="principalsQuery">SELECT PASSWD FROM JBM_USER WHERE USER_ID=?</module-option>
<module-option name="rolesQuery">SELECT ROLE_ID, 'Roles' FROM JBM_ROLE WHERE USER_ID=?</module-option>
</login-module>
</authentication>
</application-policy>
We have tried switching this part of the xml to take the users from the ldap like in here.
<application-policy xmlns="urn:jboss:security-beans:1.0" name="messaging">
<authentication>
<login-module code="org.jboss.security.auth.spi.LdapLoginModule"
flag="required">
<module-option name="unauthenticatedIdentity">guest</module-option>
<module-option name="java.naming.factory.initial">
com.sun.jndi.ldap.LdapCtxFactory
</module-option>
<module-option name="java.naming.provider.url">
ldap://OUR_LDAP_SERVER_NAME/
</module-option>
<module-option name="java.naming.security.authentication">
simple
</module-option>
<!-- Rebind as a user with search priviledges for the role queries cn=Root,dc=jboss,dc=org-->
<module-option name="java.naming.security.principal">CN=OUR_LDAP_BIND_NAME,CN=Users,DC=OUR_LDAP_SERVER_NAME,DC=local</module-option>
<module-option name="java.naming.security.credentials">OUR_LDAP_BIND_PASSWORD</module-option>
<!-- was uid= but we are using CN= -->
<module-option name="principalDNPrefix">CN=</module-option>
<module-option name="principalDNSuffix">,OU=jbossUsers,DC=OUR_LDAP_SERVER_NAME,DC=local</module-option>
<module-option name="rolesCtxDN">OU=jbossRoles,DC=OUR_LDAP_SERVER_NAME,DC=local</module-option>
<module-option name="uidAttributeID">member</module-option>
<module-option name="matchOnUserDN">true</module-option>
<module-option name="roleAttributeID">cn</module-option>
<module-option name="roleAttributeIsDN">false</module-option>
<module-option name="searchTimeLimit">5000</module-option>
<module-option name="searchScope">ONELEVEL_SCOPE</module-option>
</login-module>
</authentication>
</application-policy>
The ldap configuration we are trying works for other appliction-policies we have defined in the login_config.xml of the server so we think that the ldap config is ok. We had to define an unauthenticated identity for the messaging, that we do not normally define, with user name guest, otherwise all sort of things fail when the server boots.
Question number 1.
- Why do we need the unauthenticated identity?
Question number 2.
- The user guest is already defined on our ldap (windows active directory) with a different password. It is not username guest password guest.
Could this be a source of problems?
Question number 3.
- In the default database that comes with jboss messaging there is a bunch of users and roles defined on the tables JBM_USER, JBM_ROLE.
Which of these users and roles are necessary for jboss messaging to work?
Question number 4
- After making this change on the xml, and defining our users on the active directory / ldap the messaging seems not to be working. Saying that
"ouruser is not authenticated". Has anyone tried to switch from database to ldap jboss messaging?
Thanks in advance,
Nikos
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/576600#576600]
Start a new discussion in JBoss Messaging at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 6 months
[jBPM] - Integration with Drools
by Shobhit Tyagi
roxy1987 [http://community.jboss.org/people/roxy1987] created the discussion
"Integration with Drools"
To view the discussion, visit: http://community.jboss.org/message/576585#576585
--------------------------------------------------------------
Hi, I am trying to invoke the rules with jBPM. My class definition is following :
package com.jboss.dvd.seam;
import org.drools.PackageIntegrationException;
import org.drools.RuleBase;
import org.drools.RuleBaseFactory;
import org.drools.RuleIntegrationException;
import org.drools.WorkingMemory;
import org.drools.compiler.DrlParser;
import org.drools.compiler.DroolsParserException;
import org.drools.compiler.PackageBuilder;
import org.drools.lang.descr.PackageDescr;
import org.drools.reteoo.*;
import org.drools.rule.InvalidPatternException;
import org.drools.rule.Package;
import org.jbpm.context.exe.ContextInstance;
import org.jbpm.graph.def.ActionHandler;
import org.jbpm.graph.exe.ExecutionContext;
import java.io.*;
import java.util.Iterator;
import java.util.List;
public class FireRulesActionHandler implements ActionHandler {
private static final long serialVersionUID = 1L;
public List objectNames;
public static String ruleFile;
/**
* The FireRulesActionHandler gets variables from the Instance, and asserts
* them into the Rules Engine and invokes the rules.
*/
public void execute(ExecutionContext executionContext) throws Exception {
// load up the rulebase
RuleBase ruleBase = readRule();
WorkingMemory workingMemory = ruleBase.newWorkingMemory();
// load the data
Object object = null;
System.out.println(objectNames.toString());
Iterator iter = objectNames.iterator();
String objectName = "";
ContextInstance ci = executionContext.getContextInstance();
while (iter.hasNext()) {
objectName = (String) iter.next();
object = ci.getVariable(objectName);
System.out.println("object name is: " + objectName);
// assert the object into the rules engine
workingMemory.assertObject(object);
}
// assert the contextInstance so that it may be used to set results
workingMemory.assertObject(ci);
workingMemory.fireAllRules();
}
/**
* Please note that this is the "low level" rule assembly API.
*/
private static RuleBase readRule() throws IOException, DroolsParserException, RuleIntegrationException, PackageIntegrationException, InvalidPatternException {
// read in the source
Reader reader = new InputStreamReader(FireRulesActionHandler.class.getResourceAsStream(ruleFile));
DrlParser parser = new DrlParser();
PackageDescr packageDescr = parser.parse(reader);
// pre build the package
PackageBuilder builder = new PackageBuilder();
builder.addPackage(packageDescr);
Package pkg = builder.getPackage();
// add the package to a rulebase
RuleBase ruleBase = RuleBaseFactory.newRuleBase();
ruleBase.addPackage(pkg);
return ruleBase;
}
}
1. First thing is that, it is not able to recognize the function newWorkingMemory().
2. Secondly the function assertObject(Object) is also reported undefined.
Please Help.
Thanks
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/576585#576585]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 6 months
[EJB3] - Re: A new EJB 3.1 Standalone Embeddable prototype
by Arulazi Dhesiaseelan
Arulazi Dhesiaseelan [http://community.jboss.org/people/arulazi] created the discussion
"Re: A new EJB 3.1 Standalone Embeddable prototype"
To view the discussion, visit: http://community.jboss.org/message/576546#576546
--------------------------------------------------------------
I tried running the test and ran into a CNFE. Any clues how this dependency is sourced? I could not find this class in jboss-ejb3-embedded-standalone.jar.
javax.ejb.EJBException: java.lang.ClassNotFoundException: org.jboss.ejb3.embedded.sub.JBossSubmersibleEJBContainer
at org.jboss.ejb3.embedded.impl.standalone.JBossStandaloneEJBContainerProvider.createEJBContainer(JBossStandaloneEJBContainerProvider.java:126)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:97)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:79)
at HelloBeanITCase.test1(HelloBeanITCase.java:15)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:94)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:196)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:65)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:115)
Caused by: java.lang.ClassNotFoundException: org.jboss.ejb3.embedded.sub.JBossSubmersibleEJBContainer
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at org.jboss.ejb3.embedded.impl.standalone.JBossStandaloneEJBContainerProvider.createEJBContainer(JBossStandaloneEJBContainerProvider.java:120)
... 29 more
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/576546#576546]
Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 6 months
[JBoss Web Services] - createDispatch with WS-Address
by Gary Brown
Gary Brown [http://community.jboss.org/people/objectiser] created the discussion
"createDispatch with WS-Address"
To view the discussion, visit: http://community.jboss.org/message/575667#575667
--------------------------------------------------------------
Hi
I'm trying to create a Dispatch instance using WS-Addressing endpoint reference.
When I try this from code deployed within the server, both using cxf and native, it results in an exception like:
12:14:48,551 ERROR [STDERR] javax.xml.ws.WebServiceException: Port HelloWorldPort not found.
12:14:48,552 ERROR [STDERR] at org.apache.cxf.jaxws.ServiceImpl.getJaxwsEndpoint(ServiceImpl.java:258)
12:14:48,552 ERROR [STDERR] at org.apache.cxf.jaxws.ServiceImpl.createDispatch(ServiceImpl.java:616)
12:14:48,552 ERROR [STDERR] at org.apache.cxf.jaxws.ServiceImpl.createDispatch(ServiceImpl.java:641)
12:14:48,552 ERROR [STDERR] at javax.xml.ws.Service.createDispatch(Service.java:444)
However when I run the same code in a client app, it works fine - the Dispatch instance is returned.
The code fragment I use is:
try {
URL wsdlUrl=WSClient.class.getClassLoader().getResource("HelloWorldWS.wsdl");
System.out.println("WSDL="+wsdlUrl);
QName serviceName=QName.valueOf("{http://simple_invoke/helloworld}HelloWorldWSService");
Service service = Service.create(wsdlUrl, serviceName);
String text="<EndpointReference xmlns=\"http://www.w3.org/2005/08/addressing\">"+
"<Address>http://localhost:8080/Quickstart_bpel_simple_invoke/HelloWorldWS</Address>"+
"<ReferenceParameters/>"+
"<Metadata>"+
"<wsam:ServiceName xmlns:wsam=\"http://www.w3.org/2007/05/addressing/metadata\" "+
" xmlns:srv=\"http://simple_invoke/helloworld\" EndpointName=\"HelloWorldPort\">srv:HelloWorldWSService</wsam:ServiceName>"+
"</Metadata>"+
"</EndpointReference>";
javax.xml.ws.EndpointReference epr=
javax.xml.ws.wsaddressing.W3CEndpointReference.readFrom(new StreamSource(
new java.io.ByteArrayInputStream(text.getBytes())));
Dispatch dispatcher = service.createDispatch(epr, SOAPMessage.class,
Service.Mode.MESSAGE, new javax.xml.ws.soap.AddressingFeature());
System.out.println("DISPATCHER="+dispatcher);
} catch(Exception e) {
e.printStackTrace();
}
Not sure if the problem is due to the way that the port (or endpoint name) in EPR is being handled. In WS-Addressing meta spec, endpoint name is an NCName attribute on the ServiceName element. However the ServiceMetaData in jbossws-native I believe is expecting it to be a QName with namespace of the service name. This is possibly why it is not locating the port?
I am trying to override the web service address (URL) in the WSDL, and it appears the Service/Dispatch approach only allows WS-Addressing to be used for this. If there is another means of overriding the URL, then I would also be interested in trying that.
Regards
Gary
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/575667#575667]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 6 months