Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Tomcat, OpenJMS: java.net.MalformedURLException:

843830Sep 22 2003 — edited Oct 9 2003
Hi,

I'm trying to create a servlet that opens a topic session , but it throws this exception:
----------------------------------------------------------------------
javax.jms.JMSException: Failed to createSession java.rmi.ServerException: RemoteException occurred in server thread; nested exception is:
java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.net.MalformedURLException: no protocol: de
at org.exolab.jms.client.rmi.RmiJmsConnectionStub.createSession(RmiJmsConnectionStub.java:155)
----------------------------------------------------------------------

This is the code:

try {
String factory_name = "JmsTopicConnectionFactory";
Properties props = new Properties();

if (url.startsWith("rmi")) {
props.put(Context.INITIAL_CONTEXT_FACTORY,
"org.exolab.jms.jndi.rmi.RmiJndiInitialContextFactory");
} else {
props.put(Context.INITIAL_CONTEXT_FACTORY,
"org.exolab.jms.jndi.mipc.IpcJndiInitialContextFactory");
}
props.put(Context.PROVIDER_URL, url);

// lookup the connection factory from the context
Context context = new InitialContext(props);
TopicConnectionFactory factory = (TopicConnectionFactory)
context.lookup(factory_name);
// if we can't find the factory then throw an exception
if (factory != null) {
TopicConnection connection = factory.createTopicConnection();
TopicSession session = connection.createTopicSession(
false, Session.AUTO_ACKNOWLEDGE);
Topic topic = session.createTopic(topic_name);

if (topic != null) {
TopicPublisher publisher = session.createPublisher(topic);
if (publisher != null) {
for (int index = 0; index < count; index++) {
publisher.publish(session.createTextMessage(
"publish message " + count));
}
}
}

// close the connction
connection.close();
}
} catch (Exception exception) {
exception.printStackTrace();
throw new ServletException("Exception in processign request " + exception);
-------------------------------------------------------------------

Any idea? Thanks in advance!!!!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 6 2003
Added on Sep 22 2003
1 comment
215 views