[Datasource Configuration] - Data source configuration during runtime
by Grzegorz Gwoźdź
Grzegorz Gwoźdź [http://community.jboss.org/people/gwozdziu] created the discussion
"Data source configuration during runtime"
To view the discussion, visit: http://community.jboss.org/message/571285#571285
--------------------------------------------------------------
Hi everyone. I need to implement a solution that would enable me to change data source configuration during runtime. There is a system A that admins have access to and whre they put configuration for stuff, including db configuration. You can think of it as "Configuration Central".
Component in another system - lets call it B - periodically reads that configuration. When configuration in A changes, system B detects that change and updets itself. I need to implement a solution that would enable me to change datasource configuration on the fly to use new configuration from system A without a need to restart the jboss.
*Conenction URL change*
I am able to change the connection url infollowing way...
1. DataSource has few underlying components (MBeans). One of them is ManagedConnectionFactory.
2. I do a JNDI lookup on this one, then cast it to org.jboss.resource.connectionmanager.RARDeploymentMBean to have access to properties
3. I use RARDeploymentMBean#setManagedConnectionFactoryAttribute(arg0, arg1, arg2) to set the url
Looks good so far.
*Credentials switch*
Then I need to update the the credentials - username and password. There is a component named org.jboss.security.auth.login.DynamicLoginConfig with a parameter AuthConfig that points to a file that stores various policies conatining username and password. Here is an abstract from this file:
<application-policy name="MyName_LoginDomain">
<authentication>
<login-module code="org.jboss.resource.security.SecureIdentityLoginModule" flag="required">
<module-option name="username">username</module-option>
<module-option name="password">password</module-option>
<module-option name="managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MyName_DS</module-option>
</login-module>
</authentication>
</application-policy>
I also found that each datasource has a ConnectionManager attribute, and this connection manager could also be found using JNDI lookup. It has an attribute called SecurityDomainJndiName with value of MyName_LoginDomain. Using this one I could switch between predefined LoginDomain as I like to call them. Those are in fact instances of org.jboss.security.plugins.SecurityDomainContext.
*Problem*
Admins switch data base to which in system A to which system B should connect. I change te url, then I switch to correct SecurityDomainContext and that is fine. However when database username or password changes I have no idea what to do other than updating the file pointed by DynamicLoginConfig.AuthConfig and restarting jboss after it. Is there any way to change username and password associated with given SecurityDomainContext during runtime?
Sorry for such a large post, but I wanted to describe the whole problem to be clear. If you need any addtional information so that we could think it out together just let me know. Thanks a lot for any help!
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/571285#571285]
Start a new discussion in Datasource Configuration at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 6 months
[JBoss Messaging] - Message Groups without HornetQ
by Sebastian Koske
Sebastian Koske [http://community.jboss.org/people/sebastian.koske] created the discussion
"Message Groups without HornetQ"
To view the discussion, visit: http://community.jboss.org/message/571429#571429
--------------------------------------------------------------
Hi,
I'm facing the problem to implement the following feature under JBoss Messaging 1.4: In a cluster, all messages with a distinct property must be processed serially. I know that this feature is provided with HornetQ (Clustered Groups), but in it's current version, we cannot you HornetQ since it's failover is not yet good enough to use in production. So far I see these alternatives to get this done in JBoss Messaging 1.4:
1.) Use a DB Lock - if the lock for this property is already aquired by another consumer in the cluster, rollback or re-add the message to to queue again.
2.) Use some kind of distributed in-memory locking (e.g. Hazelcast) to do the same.
Does anyone see a different, more lightweight approach to coordinate all consumers in a cluster? It's important that none of the consumers are blocked and that the property values are created dynamically at runtime (so static message selection is not possible).
Thanx.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/571429#571429]
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] - How to set mutiple process variables in jpdl.xml file?
by w d
w d [http://community.jboss.org/people/wd_shuang] created the discussion
"How to set mutiple process variables in jpdl.xml file?"
To view the discussion, visit: http://community.jboss.org/message/571357#571357
--------------------------------------------------------------
I definited a process,then I use script to set process variables.
<process name="JBPM_VM" xmlns=" http://jbpm.org/4.0/jpdl http://jbpm.org/4.0/jpdl">
<start g="147,21,48,48" name="start">
<transition g="8,-9" name="to_jingban" to="jingban"/>
</start>
<task assignee="#{user}" g="124,122,92,52" name="jingban">
<transition g="11,-10" name="to_set_funID" to="Set fuhe FunctionID"/>
</task>
<script name="Set fuhe FunctionID"
expr = "F05030700651"
var = "FUNC">
<transition g="11,-10" name="to_fuhe" to="fuhe"/>
</script>
<task assignee="teacher" g="125,218,92,52" name="fuhe">
<transition name="to_end" to="end" g="436,263:-59,-17"/>
</task>
<end g="39,442,48,48" name="end"/>
</process>
If I want to set more variables in script name="Set fuhe FunctionID",then.....how to do ?
Anybody can help me ?
thanks all!
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/571357#571357]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 6 months
[JBoss Tools] - BPEL editor - INVOKE problem
by Igor JStarter
Igor JStarter [http://community.jboss.org/people/izgur] created the discussion
"BPEL editor - INVOKE problem"
To view the discussion, visit: http://community.jboss.org/message/570235#570235
--------------------------------------------------------------
I'm using Jboss AS 5.1, ESB 4,8 and RiftSaw 2.1 in eclipse iwth JbossTools...
When I try to change code by hand, the bpel suddenly doesn't know what my external web services methods and its parameters are...
The partner role deletes or something like that. And I'm in a circle no matter where I change anything...
I'M TRYING DO TO THIS GRAFICALLY..
When i add the invoke element to my bpel, add 2 assign, now it always messes up my artifacts.wsdl. Can somebody tell me why the INVOKE element in BPEL change my artifacts WSDL from:
<?xml version="1.0"?>
<definitions name="bpellGlassPojo"
targetNamespace=" http://samples/bpellGlassPojo http://samples/bpellGlassPojo"
xmlns:tns=" http://samples/bpellGlassPojo http://samples/bpellGlassPojo"
xmlns:plnk=" http://docs.oasis-open.org/wsbpel/2.0/plnktype http://docs.oasis-open.org/wsbpel/2.0/plnktype"
xmlns=" http://schemas.xmlsoap.org/wsdl/ http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdl=" http://glasspojo.si/ http://glasspojo.si"
>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TYPE DEFINITION - List of types participating in this BPEL process
The BPEL Designer will generate default request and response types
but you can define or import any XML Schema type and use them as part
of the message types.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<plnk:partnerLinkType name="GlassFishLinkType">
<plnk:role name="GlassFishProvider" portType="wsdl:GlassPojoWS"/>
</plnk:partnerLinkType>
<import location="GlassPojoWSService.wsdl" namespace=" http://glasspojo.si/ http://glasspojo.si/"/>
<types>
<schema attributeFormDefault="unqualified" elementFormDefault="qualified"
targetNamespace=" http://samples/bpellGlassPojo http://samples/bpellGlassPojo"
xmlns=" http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema">
<element name="bpellGlassPojoRequest">
<complexType>
<sequence>
<element name="ServiceID" type="int" />
<element name="sUserName" type="string"></element>
<element name="sPassword" type="string"></element>
</sequence>
</complexType>
</element>
<element name="bpellGlassPojoResponse">
<complexType>
<sequence>
<element name="result" type="string"/>
</sequence>
</complexType>
</element>
</schema>
</types>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MESSAGE TYPE DEFINITION - Definition of the message types used as
part of the port type defintions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<message name="bpellGlassPojoRequestMessage">
<part name="payload" element="tns:bpellGlassPojoRequest"/>
</message>
<message name="bpellGlassPojoResponseMessage">
<part name="payload" element="tns:bpellGlassPojoResponse"/>
</message>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PORT TYPE DEFINITION - A port type groups a set of operations into
a logical service unit.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- portType implemented by the bpellGlassPojo BPEL process -->
<portType name="bpellGlassPojo">
<operation name="process">
<input message="tns:bpellGlassPojoRequestMessage" />
<output message="tns:bpellGlassPojoResponseMessage"/>
</operation>
</portType>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PARTNER LINK TYPE DEFINITION
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<plnk:partnerLinkType name="bpellGlassPojo">
<plnk:role name="bpellGlassPojoProvider" portType="tns:bpellGlassPojo"/>
</plnk:partnerLinkType>
</definitions>
TO...
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<definitions xmlns=" http://schemas.xmlsoap.org/wsdl/ http://schemas.xmlsoap.org/wsdl/" xmlns:plnk=" http://docs.oasis-open.org/wsbpel/2.0/plnktype http://docs.oasis-open.org/wsbpel/2.0/plnktype" xmlns:tns=" http://samples/bpellGlassPojo http://samples/bpellGlassPojo" xmlns:vprop=" http://docs.oasis-open.org/wsbpel/2.0/varprop http://docs.oasis-open.org/wsbpel/2.0/varprop" xmlns:wsdl=" http://glasspojo.si/ http://glasspojo.si" xmlns:wsdl1=" http://glasspojo.si/ http://glasspojo.si/" name="bpellGlassPojo" targetNamespace=" http://samples/bpellGlassPojo http://samples/bpellGlassPojo">
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TYPE DEFINITION - List of types participating in this BPEL process
The BPEL Designer will generate default request and response types
but you can define or import any XML Schema type and use them as part
of the message types.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<plnk:partnerLinkType name="GlassFishLinkType">
<plnk:role name="GlassFishProvider" portType="wsdl:GlassPojoWS"/>
</plnk:partnerLinkType>
<plnk:partnerLinkType name="SecondGlassFishType">
<plnk:role name="GlassFishProv" portType="wsdl1:GlassPojoWS"/>
</plnk:partnerLinkType>
<import location="GlassPojoWSService.wsdl" namespace=" http://glasspojo.si/ http://glasspojo.si/"/>
<types>
<schema xmlns=" http://www.w3.org/2001/XMLSchema http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace=" http://samples/bpellGlassPojo http://samples/bpellGlassPojo">
<element name="bpellGlassPojoRequest">
<complexType>
<sequence>
<element name="ServiceID" type="int"/>
<element name="sUserName" type="string"/>
<element name="sPassword" type="string"/>
</sequence>
</complexType>
</element>
<element name="bpellGlassPojoResponse">
<complexType>
<sequence>
<element name="result" type="string"/>
</sequence>
</complexType>
</element>
</schema>
</types>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MESSAGE TYPE DEFINITION - Definition of the message types used as
part of the port type defintions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<message name="bpellGlassPojoRequestMessage">
<part element="tns:bpellGlassPojoRequest" name="payload"/>
</message>
<message name="bpellGlassPojoResponseMessage">
<part element="tns:bpellGlassPojoResponse" name="payload"/>
</message>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PORT TYPE DEFINITION - A port type groups a set of operations into
a logical service unit.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- portType implemented by the bpellGlassPojo BPEL process -->
<portType name="bpellGlassPojo">
<operation name="process">
<input message="tns:bpellGlassPojoRequestMessage"/>
<output message="tns:bpellGlassPojoResponseMessage"/>
</operation>
</portType>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PARTNER LINK TYPE DEFINITION
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<plnk:partnerLinkType name="bpellGlassPojo">
<plnk:role name="bpellGlassPojoProvider" portType="tns:bpellGlassPojo"/>
</plnk:partnerLinkType>
</definitions>
And suddently my Projects doesn't know that the input for my main artifacts wsdl in myprojectrequest with 2 strings and the response myprojectresponse with one string. Instead I get just ... *element or type undefined*
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/570235#570235]
Start a new discussion in JBoss Tools at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 6 months
[Beginner's Corner] - jboss Message queue
by Chammi Prasad
Chammi Prasad [http://community.jboss.org/people/chammi] created the discussion
"jboss Message queue"
To view the discussion, visit: http://community.jboss.org/message/571347#571347
--------------------------------------------------------------
Hi,
I am using JBOSS Message Queue and I have found following error. Please help me to find this out.
Jboss version : jboss-4.2.3.
Thanks
02:50:20,060 INFO [JmsActivation] Attempting to reconnect mailto:org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@f9aa66(ra=org.jboss.resource.adapter.jms.J org.jboss.resource.adapter.jms.inflow.JmsActivationSpec(a)f9aa66(ra=org.jboss.resource.adapter.jms.J
http://community.jboss.org/mailto:msResourceAdapter@c33893 msResourceAdapter@c33893 destination=queue/MCB isTopic=false tx=true durable=false reconnect=10 provider=java:/DefaultJMSProvider user=null maxMessages=1 min
Session=1 maxSession=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null
DLQMaxResent=5)
02:50:20,085 ERROR [JmsActivation] Unable to reconnect mailto:org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@f9aa66(ra=org.jboss.resource.adapter.jms.JmsRe org.jboss.resource.adapter.jms.inflow.JmsActivationSpec(a)f9aa66(ra=org.jboss.resource.adapter.jms.JmsRe
http://community.jboss.org/mailto:sourceAdapter@c33893 sourceAdapter@c33893 destination=queue/MCB isTopic=false tx=true durable=false reconnect=10 provider=java:/DefaultJMSProvider user=null maxMessages=1 minSess
ion=1 maxSession=15 keepAlive=60000 useDLQ=true DLQHandler=org.jboss.resource.adapter.jms.inflow.dlq.GenericDLQHandler DLQJndiName=queue/DLQ DLQUser=null DLQ
MaxResent=5)
org.jboss.mq.SpyJMSException: Could not update the message in the database: update affected 0 rows
at org.jboss.mq.pm.jdbc2.PersistenceManager.update(PersistenceManager.java:1331)
at org.jboss.mq.server.BasicQueue.updateRedeliveryFlags(BasicQueue.java:1212)
at org.jboss.mq.server.BasicQueue.addReceiver(BasicQueue.java:250)
at org.jboss.mq.server.JMSQueue.addReceiver(JMSQueue.java:122)
at org.jboss.mq.server.ClientConsumer.setEnabled(ClientConsumer.java:107)
at org.jboss.mq.server.JMSDestinationManager.setEnabled(JMSDestinationManager.java:150)
at org.jboss.mq.server.JMSServerInterceptorSupport.setEnabled(JMSServerInterceptorSupport.java:146)
at org.jboss.mq.server.TracingInterceptor.setEnabled(TracingInterceptor.java:482)
at org.jboss.mq.server.JMSServerInvoker.setEnabled(JMSServerInvoker.java:152)
at org.jboss.mq.il.jvm.JVMServerIL.setEnabled(JVMServerIL.java:76)
at org.jboss.mq.Connection.start(Connection.java:657)
at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupSessionPool(JmsActivation.java:589)
at org.jboss.resource.adapter.jms.inflow.JmsActivation.setup(JmsActivation.java:323)
at org.jboss.resource.adapter.jms.inflow.JmsActivation.handleFailure(JmsActivation.java:259)
at org.jboss.resource.adapter.jms.inflow.JmsActivation.onException(JmsActivation.java:278)
at org.jboss.mq.Connection$ExceptionListenerRunnable.run(Connection.java:1356)
at java.lang.Thread.run(Thread.java:619)
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/571347#571347]
Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 6 months