[JBoss AS 7 Development] - connecting a remote hornetQ server
by Hans Steiner
Hans Steiner [https://community.jboss.org/people/hans-juergen.stemmer.vkb.de] created the discussion
"connecting a remote hornetQ server"
To view the discussion, visit: https://community.jboss.org/message/729620#729620
--------------------------------------------------------------
Hi out there
I am trying to connect a jboss as 7.1.0 with another jboss that should only act as a hornetQ server (2.2.11).
I see that in the ejb subsystem
<mdb>
<resource-adapter-ref resource-adapter-name="*hornetq-ra"*/>
<bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
</mdb>
is configured.
In the message subsystem I use a connector
<connectors>
<connector name="*netty*">
<factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
<param key="host" value="xxxxx"/>
<param key="port" value="5745"/>
</connector>
</connectors>
that is referenced from the connection pool
<pooled-connection-factory name="*hornetq-ra*">
<transaction mode="xa"/>
<connectors>
<connector-ref connector-name="*netty*"/>
</connectors>
<entries>
<entry name="java:/JmsXA"/>
</entries>
</pooled-connection-factory>
All this works fine, except of an error/warning I receive a few seconds after I have started the server.
> 15:54:20,640 WARN [org.hornetq.jms.server.recovery.HornetQXAResourceWrapper] Can't connect to any hornetq server on recovery [XARecoveryConfig [hornetQConnectionFactory=HornetQConnectionFactory [serverLocator=ServerLocatorImpl [initialConnectors=[org-hornetq-core-remoting-impl-netty-NettyConnectorFactory?port=5745&host=xxxxx], discoveryGroupConfiguration=null], clientID=null, dupsOKBatchSize=1048576, transactionBatchSize=1048576, readOnly=false], *username=null, password=null*]]
> 15:54:20,656 WARN [com.arjuna.ats.jta] ARJUNA016027: Local XARecoveryModule.xaRecovery got XA exception XAException.XAER_RMERR: javax.transaction.xa.XAException: Error trying to connect to any providers for xa recovery
> at org.hornetq.jms.server.recovery.HornetQXAResourceWrapper.getDelegate(HornetQXAResourceWrapper.java:275) [hornetq-jms-2.2.11.Final.jar:]
> at org.hornetq.jms.server.recovery.HornetQXAResourceWrapper.recover(HornetQXAResourceWrapper.java:77) [hornetq-jms-2.2.11.Final.jar:]
> at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.xaRecovery(XARecoveryModule.java:503) [jbossjts-4.16.2.Final.jar:]
> at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.resourceInitiatedRecoveryForRecoveryHelpers(XARecoveryModule.java:471) [jbossjts-4.16.2.Final.jar:]
> at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.bottomUpRecovery(XARecoveryModule.java:385) [jbossjts-4.16.2.Final.jar:]
> at com.arjuna.ats.internal.jta.recovery.arjunacore.XARecoveryModule.periodicWorkSecondPass(XARecoveryModule.java:166) [jbossjts-4.16.2.Final.jar:]
> at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.doWorkInternal(PeriodicRecovery.java:789) [jbossjts-4.16.2.Final.jar:]
> at com.arjuna.ats.internal.arjuna.recovery.PeriodicRecovery.run(PeriodicRecovery.java:371) [jbossjts-4.16.2.Final.jar:]
> Caused by: HornetQException[errorCode=2 message=null]
> at org.hornetq.jms.server.recovery.HornetQXAResourceWrapper.connect(HornetQXAResourceWrapper.java:351) [hornetq-jms-2.2.11.Final.jar:]
> at org.hornetq.jms.server.recovery.HornetQXAResourceWrapper.getDelegate(HornetQXAResourceWrapper.java:251) [hornetq-jms-2.2.11.Final.jar:]
> ... 7 more
>
> 15:54:20,703 WARN [org.hornetq.jms.server.recovery.HornetQXAResourceWrapper] Can't connect to any hornetq server on recovery [XARecoveryConfig [hornetQConnectionFactory=HornetQConnectionFactory [serverLocator=ServerLocatorImpl [initialConnectors=[org-hornetq-core-remoting-impl-netty-NettyConnectorFactory?port=5745&host=xxxxx], discoveryGroupConfiguration=null], clientID=null, dupsOKBatchSize=1048576, transactionBatchSize=1048576, readOnly=false], username=null, password=null]]
The queue is found and I can send and receive messages. I use annotations like this
@MessageDriven(name="MyMDB", activationConfig = {
@ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"),
@ActivationConfigProperty(propertyName = "destination", propertyValue = "global/myQueue"),
@ActivationConfigProperty(propertyName = "user", propertyValue = "guest"),
@ActivationConfigProperty(propertyName = "password", propertyValue = "guest")...
for the mdb.
Can anybody help me with the XA warning? I suppose all I have to do is to configure username and passwort in the right manner. I read something about ra.xml and the resource-adapters subsystem, but I could not find out how to set any properties.
Perhaps there is even a better way to combine a remote hornetQ server with the use of annotations. I am not happy having the messaging subsystem (not present in a standalone.xml without hornetq) in my configuration. Can I delete some portions just leaving the client-part of the jms configuration?
Thx very much for help.
hans
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/729620#729620]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 1 month
[jBPM Development] - why jbpm5.3 usertask support only one incoming connection?
by gao haijun
gao haijun [https://community.jboss.org/people/vavi] created the discussion
"why jbpm5.3 usertask support only one incoming connection?"
To view the discussion, visit: https://community.jboss.org/message/741623#741623
--------------------------------------------------------------
I have a process, contains approve and reject. if reject,the process should return to usertask1.
if I write the process definition file using hand(without the eclipse plugin),it will throw a exception:
*ProcessLoadError: unable to parse xml : Exception class java.lang.IllegalArgumentException : This type of node cannot have more than one incoming connection!*
imo, what I said should be a *common request/case*.
so why jbpm5.3 usertask support only one incoming connection?
Hope someone can answer my question,thx a lot.
PS:the process difinition details:
<itemDefinition id="_conditionWhoItem" structureRef="Object" />
<itemDefinition id="_2-conditionWhoItem" structureRef="Object" />
<itemDefinition id="_4-conditionWhoItem" structureRef="Object" />
<itemDefinition id="_5-conditionWhoItem" structureRef="Object" />
<process processType="Private" isExecutable="true" id="com.sample.bpmn" name="Sample Process" tns:packageName="defaultPackage" >
<!-- process variables -->
<property id="conditionWho" itemSubjectRef="_conditionWhoItem"/>
<!-- nodes -->
<startEvent id="_1" name="StartProcess" />
<userTask id="_2" name="1" >
<ioSpecification>
<inputSet>
</inputSet>
<outputSet>
</outputSet>
</ioSpecification>
<potentialOwner>
<resourceAssignmentExpression>
<formalExpression>FME</formalExpression>
</resourceAssignmentExpression>
</potentialOwner>
</userTask>
<exclusiveGateway id="_3" name="Gateway" gatewayDirection="Diverging" />
<userTask id="_4" name="3" >
<ioSpecification>
<inputSet>
</inputSet>
<outputSet>
</outputSet>
</ioSpecification>
<potentialOwner>
<resourceAssignmentExpression>
<formalExpression>SLE2</formalExpression>
</resourceAssignmentExpression>
</potentialOwner>
</userTask>
<userTask id="_5" name="2" >
<ioSpecification>
<inputSet>
</inputSet>
<outputSet>
</outputSet>
</ioSpecification>
<potentialOwner>
<resourceAssignmentExpression>
<formalExpression>SLE1</formalExpression>
</resourceAssignmentExpression>
</potentialOwner>
</userTask>
<endEvent id="_6" name="End" >
<terminateEventDefinition/>
</endEvent>
<!-- connections -->
<sequenceFlow id="_5-_2" sourceRef="_5" targetRef="_2" />
<sequenceFlow id="_1-_2" sourceRef="_1" targetRef="_2" />
<sequenceFlow id="_2-_3" sourceRef="_2" targetRef="_3" />
<sequenceFlow id="_3-_4" sourceRef="_3" targetRef="_4" name="SLE2" >
<conditionExpression xsi:type="tFormalExpression" >return conditionWho == "SLE2";</conditionExpression>
</sequenceFlow>
<sequenceFlow id="_3-_5" sourceRef="_3" targetRef="_5" name="SLE1" >
<conditionExpression xsi:type="tFormalExpression" >return conditionWho == "SLE1";</conditionExpression>
</sequenceFlow>
<sequenceFlow id="_4-_6" sourceRef="_4" targetRef="_6" />
</process>
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/741623#741623]
Start a new discussion in jBPM Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 2 months
[JBoss AS 7 Development] - Server Instance Work directory
by Bernd Eckenfels
Bernd Eckenfels [https://community.jboss.org/people/b.eckenfels] created the discussion
"Server Instance Work directory"
To view the discussion, visit: https://community.jboss.org/message/751242#751242
--------------------------------------------------------------
Hello,
in domain mode (and standalone mode) the application servers are started in a way, that the base directory of the AS7 is the current working directory. This directory should not be writeable by a runtime user, and it is shared between multiple VMs. Some components (like some malconfigured libraries, native trace files) and even JVM diagnostics (hs_err files), dumps and even operating system (core)dumps are typically generated in this directory. (yes some of them can be configured to be generated somewhere else, on the other hand it would be good to have a sane default for that directory).
This is for 3 reasons a problem:
- no write permissions for runtime user (hopefully)
- shared between multiple vm instances
- not in a directory intended for modifications and high data volumes
- hard to find diagnostic files for a specific server instance
For this reason I see 3 possible methods, personally I typically use the first one:
a) start the application server instance with the server-specific log directory as current directory
b) start the application server instance with the server-specific data (or temp) directory as current directory
c) invent a new instance specific main directory
Using the log directory is most often the most sensible way, as it is sized to hold all kind of dumps+ diagnostics.
What do you think? In my case it is less imporatent for PC and HC, on the other hand it would not hurt to use the respective log firectories for those as well.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/751242#751242]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 2 months
[JBoss AS 7 Development] - ClientLoginModule support
by Tarek Hammoud
Tarek Hammoud [https://community.jboss.org/people/thammoud] created the discussion
"ClientLoginModule support"
To view the discussion, visit: https://community.jboss.org/message/750773#750773
--------------------------------------------------------------
Hello,
We are migrating from JBOSS 4.x to 7.1.1. A client is trying to access a remote EJB. Previously, code like below worked by propogating the credentials to the server:
LoginContext lc = new LoginContext("client-login", new UsernamePasswordHandler(userName, password.toCharArray()));
lc.login();
....
InitialContext ctx = new InitialContext(...);
Server s = ctx.lookup();
s.invoke();
With 7.1.1, we are basically doing the same:
LoginContext lc = new LoginContext("client-login", new UsernamePasswordHandler(userName, password.toCharArray()));
lc.login();
......
jndiProps.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
jndiProps.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_POLICY_NOPLAINTEXT", "false");
jndiProps.put("jboss.naming.client.ejb.context", true);
jndiProps.put("jboss.naming.client.connect.options.org.xnio.Options.SASL_DISALLOWED_MECHANISMS", "JBOSS-LOCAL-USER");
Context ctx = new InitialContext(jndiProps); *<<=== Throws exception*
Caused by: javax.security.sasl.SaslException: Cannot get userid/password [Caused by javax.security.auth.callback.UnsupportedCallbackException]
at com.sun.security.sasl.ClientFactoryImpl.getUserInfo(ClientFactoryImpl.java:157)
at com.sun.security.sasl.ClientFactoryImpl.createSaslClient(ClientFactoryImpl.java:94)
at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities$1.run(ClientConnectionOpenListener.java:352)
at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities$1.run(ClientConnectionOpenListener.java:350)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:350)
at org.jboss.remoting3.remote.ClientConnectionOpenListener$Capabilities.handleEvent(ClientConnectionOpenListener.java:214)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
at org.xnio.channels.TranslatingSuspendableChannel.handleReadable(TranslatingSuspendableChannel.java:189)
at org.xnio.channels.TranslatingSuspendableChannel$1.handleEvent(TranslatingSuspendableChannel.java:103)
at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:72)
at org.xnio.nio.NioHandle.run(NioHandle.java:90)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:184)
at ...asynchronous invocation...(Unknown Source)
at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:270)
at org.jboss.remoting3.EndpointImpl.doConnect(EndpointImpl.java:251)
at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:349)
at org.jboss.remoting3.EndpointImpl.connect(EndpointImpl.java:333)
at org.jboss.naming.remote.client.EndpointCache$EndpointWrapper.connect(EndpointCache.java:105)
at org.jboss.naming.remote.client.NamingStoreCache.getRemoteNamingStore(NamingStoreCache.java:55)
... 8 more
We would like to avoid having to sepcify the credentials as part of the InitialContext properties. Any help will be greatly appreciated.
Thank you
Tarek Hammoud
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/750773#750773]
Start a new discussion in JBoss AS 7 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 2 months