-
1. Configuration of JMS on JBOSS
sysuser1 Jun 25, 2004 4:15 AM (in response to sysuser1)Hi,
We are having the following error when we try to communicate to Jboss 4.0 via JNDI to create ConnectionFactory object . Here is my code. Can anybody help me out with this ?
public SimpleSender() {
try {
QueueConnectionFactory myQConnFactory;
Queue myQueue;
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
properties.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
properties.put(Context.PROVIDER_URL,"jnp://localhost:1099");
Context ctx = new InitialContext(properties);
myQConnFactory = (QueueConnectionFactory) ctx.lookup("ConnectionFactory");
myQueue = (Queue) ctx.lookup("queue/testQueue");
ctx.bind("SimpleSender",myQueue);
QueueConnection con = myQConnFactory.createQueueConnection();
QueueSession session = con.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
TextMessage textMessage = session.createTextMessage();
QueueSender sender = session.createSender(myQueue);
con.start();
for(int i=0;i<10;i++){
textMessage.setText("Hello World " + i );
sender.send(textMessage);
}
con.close();
ctx.close();
} catch(Exception ex) {
ex.printStackTrace() ;
}
}
The error that I am getting is as follows
javax.naming.NameNotFoundException: ConnectionFactory not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:529)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:508)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at SimpleSender.(SimpleSender.java:49)
at SimpleSender.main(SimpleSender.java:24)
Is there anything that I missing out.
Jagdish -
2. Re: I need your help !
julien1 Jun 25, 2004 5:09 AM (in response to sysuser1)as a user or programatically in a module you would have developed ?
-
3. Re: I need your help !
sysuser1 Jun 25, 2004 5:42 AM (in response to sysuser1)programatically in a module I would have developed
-
4. Re: I need your help !
julien1 Jun 25, 2004 5:48 AM (in response to sysuser1)look at nukes/nukes/src/main/org/jboss/nukes/core/modules/html/plugins/FilePlugin.java
-
5. Re: I need your help !
sysuser1 Jun 25, 2004 6:09 AM (in response to sysuser1)Already done.
But when I want to retrieve the parameterUploadedFile image = page.getParameterAsFile("content");
image returns null and I don't understand why !!
If I retrieve my parameter as a stringString stringVal = page.getParameter("content");
image returns the right thing = "C:\Documents and Settings\sandra.c\Mes documents\Mes images\image.gif".
I despair... :-(
I hope you can help me. -
6. Re: I need your help !
julien1 Jun 25, 2004 7:55 AM (in response to sysuser1)did your declare your form as such ?
<form action="index.html" method="post" enctype="multipart/form-data"> ... <input type="hidden" name="MAX_FILE_SIZE" value="100000"/> <input type="file" size="32" name="content" value=""/> ... </form>