[JBoss Messaging Development] New message: "How to use Java to connect to JBossMQ server by JNP Protocal?"
by Teeradej Dumrongtrakuncharoen
JBoss development,
A new message was posted in the thread "How to use Java to connect to JBossMQ server by JNP Protocal?":
http://community.jboss.org/message/519976#519976
Author : Teeradej Dumrongtrakuncharoen
Profile : http://community.jboss.org/people/teradath
Message:
--------------------------------------------------------------
I would like to create java client project to connect to JBossMQ server by use JNP Protocal. but It have error "org.jboss.jms.exception.MessagingNetworkFailureException " when it start to create connection.
JBoss Version : jboss-5.1.0.GA
server : default
Could you help me by give any suggestion or guide me to any resource? I think it has some point I'm missing but I can't recognize.
/*===================================== My code =====================================*/
package examplejboss;
import java.util.Hashtable;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.jms.*;
import javax.naming.*;
/**
*
* @author HuHOo
*/
public class Producer {
/**
* simple Producer
*/
public Producer() throws NamingException {
try {
Hashtable env;
Context ctx = null;
env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099");
env.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
try {
// Create the initial context.
ctx = new InitialContext(env);
} catch (NamingException ex) {
ex.printStackTrace();
System.exit(-1);
}
ConnectionFactory cf = (javax.jms.ConnectionFactory) ctx.lookup("ConnectionFactory");
Connection connection = cf.createConnection();
Session session = connection.createSession(false /* not transacted */, Session.AUTO_ACKNOWLEDGE);
Queue queue = (Queue)ctx.lookup("queue/A");
MessageProducer producer = session.createProducer(queue);
TextMessage outMsg = session.createTextMessage("40");
System.out.println("Sending message: " + outMsg.getText());
producer.send(outMsg);
// now that everything is ready to go, start the connection
connection.start();
producer.close();
session.close();
connection.close();
} catch (JMSException ex) {
System.out.println("Error running program");
ex.printStackTrace();
}
}
/**
* main method
*/
public static void main(String args[]) {
try {
new Producer();
} catch (NamingException ex) {
Logger.getLogger(Producer.class.getName()).log(Level.SEVERE, null, ex);
}
}
}
/*===================================== Server Error =====================================*/
16:27:33,324 ERROR [BisocketServerInvoker] received new control socket for unrecognized listenerId: 5c4o1n-miiolb-g4fc7go7-1-g4fc7i6o-9
/*===================================== Client Error =====================================*/
log4j:WARN No appenders could be found for logger (org.jnp.interfaces.TimedSocketFactory).
log4j:WARN Please initialize the log4j system properly.
Error running program
org.jboss.jms.exception.MessagingNetworkFailureException
at org.jboss.jms.client.delegate.DelegateSupport.handleThrowable(DelegateSupport.java:245)
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:187)
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
at org.jboss.jms.client.container.StateCreationAspect.handleCreateConnectionDelegate(StateCreationAspect.java:83)
at org.jboss.aop.advice.org.jboss.jms.client.container.StateCreationAspect_z_handleCreateConnectionDelegate_27553328.invoke(StateCreationAspect_z_handleCreateConnectionDelegate_27553328.java)
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.invokeNext(ClientConnectionFactoryDelegate$createConnectionDelegate_N3019492359065420858.java)
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createConnectionDelegate(ClientConnectionFactoryDelegate.java)
at org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:205)
at org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:87)
at org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:82)
at examplejboss.Producer.<init>(Producer.java:42)
at examplejboss.Producer.main(Producer.java:78)
Caused by: org.jboss.remoting.ConnectionFailedException: Timed out trying to create control socket
at org.jboss.remoting.transport.bisocket.BisocketClientInvoker.handleConnect(BisocketClientInvoker.java:273)
at org.jboss.remoting.MicroRemoteClientInvoker.connect(MicroRemoteClientInvoker.java:294)
at org.jboss.remoting.Client.connect(Client.java:1596)
at org.jboss.remoting.Client.connect(Client.java:498)
at org.jboss.remoting.callback.ServerInvokerCallbackHandler.connect(ServerInvokerCallbackHandler.java:166)
at org.jboss.remoting.ServerInvoker.getCallbackHandler(ServerInvoker.java:2047)
at org.jboss.remoting.ServerInvoker.handleInternalInvocation(ServerInvoker.java:1663)
at org.jboss.remoting.transport.bisocket.BisocketServerInvoker.handleInternalInvocation(BisocketServerInvoker.java:863)
at org.jboss.remoting.ServerInvoker.invoke(ServerInvoker.java:895)
at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(ServerThread.java:742)
at org.jboss.remoting.transport.socket.ServerThread.processInvocation(ServerThread.java:695)
at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.java:549)
at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.java:230)
at org.jboss.remoting.MicroRemoteClientInvoker.invoke(MicroRemoteClientInvoker.java:163)
at org.jboss.remoting.Client.invoke(Client.java:1544)
at org.jboss.remoting.Client.addCallbackListener(Client.java:1613)
at org.jboss.remoting.Client.addListener(Client.java:907)
at org.jboss.jms.client.remoting.JMSRemotingConnection.addInvokerCallbackHandler(JMSRemotingConnection.java:230)
at org.jboss.jms.client.remoting.JMSRemotingConnection.start(JMSRemotingConnection.java:340)
at org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.org$jboss$jms$client$delegate$ClientConnectionFactoryDelegate$createConnectionDelegate$aop(ClientConnectionFactoryDelegate.java:154)
... 10 more
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/519976#519976
16 years, 2 months
[JBoss ESB Development] New message: "Re: Smooks problem"
by Maurice Zeijen
JBoss development,
A new message was posted in the thread "Smooks problem":
http://community.jboss.org/message/519957#519957
Author : Maurice Zeijen
Profile : http://community.jboss.org/people/mzeijen
Message:
--------------------------------------------------------------
I see that you are using the Persistence cartridge to persist the PersonAge pojo into the database using JPA.The problem is probably that persistence cartridge doesn't know how to insert it. Normally, in a non ESB environment, you would register a EntityManagerRegister object using the PersistenceUtil#setDAORegister() method. The EntityManagerRegister provides the persistence cartridge with the EntityManagerDaoAdapter. The EntityManagerDaoAdapter is the object that uses the EntityManager to actually persist the PersonAge pojo. Because you are in a ESB enviroment things are a bit different, because you have no way to set the EntityManagerRegister via the PersistenceUtil#setDAORegister() method before Smooks is executed. At the moment there is no standard way to do this from within Smooks so you will have to provide your own.
I propose that you write a simple visitor object that is executed on the document start (selector: #document). On the visitBefore method of that visitor you create a EntityManagerRegister, providing it your EntityContext (you could retrieve that via JNDI maybe) and use the PersistenceUtil#setDAORegister() to register the EntityManagerRegister. Then your problem should be solved.
I must say that the persistence cartridge should provide you with a decent exception when no DaoRegister object is available. I will look into that.
I hope I provided you with enough an clear enough information to solve your problem.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/519957#519957
16 years, 2 months
[EJB 3.0 Development] New message: "Re: EJB3 Version Targets for AS 6.0 M3"
by jaikiran pai
JBoss development,
A new message was posted in the thread "EJB3 Version Targets for AS 6.0 M3":
http://community.jboss.org/message/519940#519940
Author : jaikiran pai
Profile : http://community.jboss.org/people/jaikiran
Message:
--------------------------------------------------------------
For AS trunk, the module which integrates with the AS is the ejb3_1 (available at EJB3_Trunk/ejb3_1). This week we'll be releasing 1.0.1 version of that module into AS for 6.0.0.M2. (most of the) other sub-modules are EJB3 are pulled in as transitive dependencies from this module. So the appropriate versions of the other sub-modules are listed in the EJB3_trunk/ejb3_1/pom.xml.
Which sub-modules have changed in EJB3, for VFS? If for example, it's the "core" module which has changed, then usually it would mean bumping the version of core appropriately and then updating the ejb3_1/pom.xml dependency to pull in this new version.
Once M2 is out, we plan to continue our regular release cycles (twice a month). So the latest released EJB3 version, at that point in time, will be integrated in M3.
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/519940#519940
16 years, 2 months
[JBoss Portal Development] New message: "Portlet Definition in one WAR portlet-instance in another"
by Michael Helfer
JBoss development,
A new message was posted in the thread "Portlet Definition in one WAR portlet-instance in another":
http://community.jboss.org/message/519833#519833
Author : Michael Helfer
Profile : http://community.jboss.org/people/mhelfer
Message:
--------------------------------------------------------------
I am trying to create a generic portlet in my content management project. Anybody that wants to retrieve content from my cms project will then create an instance of that portlet in their individual consumer projects. However, all projects cms/consumers will live on the same server. When I set all this up and login to the admin portal, I see the cms-portlet listed in the portlet-definition tab, however I don't see any of the consumer instances listed in the portlet-instances tab.
My question is, without setting up WSRP is there a way to reference a portlet definition contained within a separate war?
Thanks in advance
--------------------------------------------------------------
To reply to this message visit the message page: http://community.jboss.org/message/519833#519833
16 years, 2 months