You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by me...@usbank.com on 2005/07/29 18:46:26 UTC

JMS Handler for "jms" protocol

I've just spent several hours tracking down why I could not get pass in an
endpoint starting with "jms", as directed to do in the
org.apache.axis.transport.jms.JMSTransport.setupMessageContextImpl method
comments (which note that using the model outlined in the PDF on setting up
JMS clients is deprecated; i.e. creating a Transport and settings its
properties without benefit of a URL).  I had tracked the code through
JMSURLHelper class, and it certainly appeared as if the url would be fully
supported for all properties I needed, so I assumed at first that the
comments were for some new functionality in Axis 1.2 (as far as I could
tell, the AxisJMSSample.pdf hasn't changed over the past few releases.)

The error I would get, while passing in a URL of type "jms:<destination",
was MalformedURLException: Unknown protocol "jms".

The reason turned out to be deceptively simple, but it required a fair
amount of learning on my part, since I hadn't tried to define a custom
protocol handler in Java before.  I will attempt to document here, using
the key terms I ran into, in hopes that I can save someone else the time
tracking this down...

I learned that to define a custom URL, the system property "
java.protocol.handler.pkgs" must have the appropriate package appended to
it (using the pipe symbol as delimiter:  |).  Axis is doing this from the
static Call.instantiate method, and it appeared to be working perfectly
well on my WebSphere 5.1 server (per a system.out dump of
System.getProperty("java.protocol.handler.pkgs").

java.net.URL requires a specific format to the final package token and the
class name must be "Handler".  (For a nice discussion, see the following
post:  http://lists.samba.org/archive/jcifs/2002-December/001584.html).  In
addition, it will check the System classpath for the Handler files, so that
could require some additional setup on some people's systems.

What I didn't realize for some time, is that while a Handler class exists
in the Axis JAR file for "file", "java", "local", and "mail"... no Handler
exists in the "jms" package.  The comments in the JMSTransport class are
apparently referring to an implementation that was never completed, or
perhaps are assuming that the user has created their own custom Handler
class for JMS and set it up appropriately in the system properties.

So, I'll go back to the "old" method of setting up my JMS client for now,
as outlined in the AxisJMSSample.pdf that comes in the Axis download.
Hopefully this information can help someone else in the future!

Meghan

_________________________________
Meghan Pietila
Java Middleware Architect
Sales & Service Management Program
US Bank
Gold 4
(651) 205-0904
(651) 271-2815 cell
meghan.pietila@usbank.com


------------------------------------------------------------------------------
Electronic Privacy Notice. This e-mail, and any attachments, contains information that is, or may be, covered by electronic communications privacy laws, and is also confidential and proprietary in nature. If you are not the intended recipient, please be advised that you are legally prohibited from retaining, using, copying, distributing, or otherwise disclosing this information in any manner. Instead, please reply to the sender that you have received this communication in error, and then immediately delete it. Thank you in advance for your cooperation.
==============================================================================