[JBossMQ] - Connecting a remote queue (oc4j server) in JBoss
by romain3396
Dear all,
I've created a queue in oc4j, I can post and read messages and receive it via a Java Client.
Now I want to create a MDB in Jboss to consume these messages.
I've followed this Jboss tutorial
http://www.jboss.org/community/docs/DOC-9893/version/5
All is deployed, but the messages are not consumed : no logs, no exceptions...
I don't understand 1 thing : in these examples, I've not documented the JNDI of the oc4j queue, how can I set it ? (queue/myqueue)
In the jms.ds-xml of Jboss, I've created
<mbean code="org.jboss.jms.jndi.JMSProviderLoader"
| name="jboss.mq:service=JMSProviderLoader,name=RemoteJBossMQProvider">
| <attribute name="ProviderName">RosyStatJMSProvider</attribute>
| <attribute name="ProviderAdapterClass">
| org.jboss.jms.jndi.JNDIProviderAdapter
| </attribute>
| <attribute name="FactoryRef">XAConnectionFactory</attribute>
| <attribute name="QueueFactoryRef">XAConnectionFactory</attribute>
| <attribute name="TopicFactoryRef">XAConnectionFactory</attribute>
| <attribute name="Properties">
| java.naming.factory.initial=com.evermind.server.rmi.RMIInitialContextFactory
| java.naming.provider.url=ormi://myoc4jserver:12502/
| java.naming.security.principal=login
| java.naming.security.credentials=password
| </attribute>
| </mbean>
|
And this is the Jboss.xml of my MDB
<?xml version="1.0" encoding="UTF-8"?>
| <jboss>
| <enterprise-beans>
| <message-driven>
| <ejb-name>MyMDB</ejb-name>
| <destination-jndi-name>queue/MDBReceiveQueue</destination-jndi-name>
| <invoker-bindings>
| <invoker>
| <invoker-proxy-binding-name>whatever-message-driven-bean</invoker-proxy-binding-name>
| </invoker>
| </invoker-bindings>
| </message-driven>
| </enterprise-beans>
|
| <invoker-proxy-bindings>
| <name>whatever-message-driven-bean</name>
| <proxy-factory-config>
| <JMSProviderAdapterJNDI>java://RosyStatJMSProvider</JMSProviderAdapterJNDI>
| <ServerSessionPoolFactoryJNDI>StdJMSPool</ServerSessionPoolFactoryJNDI>
| <MaximumSize>15</MaximumSize>
| <MaxMessages>1</MaxMessages>
| <MDBConfig>
| <ReconnectIntervalSec>10</ReconnectIntervalSec>
| <DLQConfig>
| <DestinationQueue>queue/DLQ</DestinationQueue>
| <MaxTimesRedelivered>10</MaxTimesRedelivered>
| <TimeToLive>0</TimeToLive>
| </DLQConfig>
| </MDBConfig>
| </proxy-factory-config>
|
| </invoker-proxy-bindings>
| </jboss>
Here is my client which connects to the oc4j server (and works)
Properties properties = new Properties();
| try {
| properties.load(new FileInputStream(config));
| } catch (Exception e) {
| throw new RuntimeException("Error while reading property file.", e);
| }
| Context ctx;
|
| try {
| Properties parm = new Properties();
|
| parm.setProperty("java.naming.factory.initial",
| "com.evermind.server.rmi.RMIInitialContextFactory");
| parm.setProperty("java.naming.provider.url", "ormi://myoc4jserver:12502");
| parm.setProperty("java.naming.security.principal", "login");
| parm.setProperty("java.naming.security.credentials", "password");
|
| ctx = new InitialContext(parm);
|
| QueueConnectionFactory connectionFactory = (QueueConnectionFactory) ctx
| .lookup("jms/QueueConnectionFactory");
|
| connection = connectionFactory.createQueueConnection();
| connection.start();
| session = connection.createQueueSession(false,
| Session.AUTO_ACKNOWLEDGE);
| queue = (Queue) ctx.lookup(properties.getProperty("queue/myqueue"));
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215481#4215481
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215481
15 years, 11 months
[JBoss Portal] - Programmatically Create Portal Pages
by analyzediz
Hi all --
I was wondering if anyone know of a good approach to programmatically create a portal page from a preexisting template page. Essentially, I have a requirement to be able to clone a template page with portlets in a specific layout etc. The user will be able to, at the click of a button on a management portlet, create a clone of the template portal page. The clone will contain a copy of each portlet that exist on the template page as well.
Does anyone out there know of a systematic way of doing this? I presume as a last resort I might have to go to the database layer to make copies of each of the database records that represent each of the portal objects (template page, template portlets etc.) and link them together.
Any pointers will be greatly appreciated.
Thanks!
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215470#4215470
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215470
15 years, 11 months
[JBoss Cache: Core Edition] - Re: on child insert parent, child collection updated in DB b
by bstansberry@jboss.com
"dukehoops" wrote : Ok, I was able to create a multithreaded JUnit test to fail (with just 4 threads).
Great! Can you send me that? My address is to the left.
anonymous wrote :
| I guess the problem lies either with versioning (either Hibernate versioning or MVCC versioning) or (insufficient?) locking.
I've think you've exposed a logical flaw with the locking -- either in the hibernate-jbc integration or with the basic design in hibernate core itself. With an entity this kind of thing would not be a problem because a database lock on the record would either 1) block b2 updating the entity until a's tx is done 2) block a1's read until b's tx is done. But with a collection there is no single database record that both tx's need to lock on.
anonymous wrote :
| You said previously that assumptions around synchronization ordering were fixed for JBossTS and JBC specifically. Was the fix to order synchronizations in TX manager impl?
Yes.
anonymous wrote :
| The reason I ask is that Spring seems to use a Synchronization to close Hibernate Sessions. Is there an expectation that *that* syncrhonization fire *before* JBC's synchronization?
If you could give me a link to the Spring code, that would be good. This doesn't sound like a problem though; the key thing is that the session is flushed to the database before JBC's Synchronization's beforeCompletion() is called. Hibernate's own CacheSynchroniztion handles that. Sounds like Spring is calling Session.close() which is a housekeeping operation that would come *after* the above.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4215469#4215469
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4215469
15 years, 11 months