Re: Embedded server URL

Tim Anderson <[email protected]> Thu, 20 Mar 2008 12:55:07 +1100
Newsgroups gmane.comp.java.openjms.user
Message-ID <[email protected]>
--===============0501924981==
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Yep. Just hasn't been updated to the latest API.<br>
<br>
aslam wrote:
<blockquote cite="mid:[email protected]" type="cite">
  <pre wrap="">Thanks, Tim.

EmbeddedServerAdapter uses EmbeddedJmsServer, which is deprecated, according
to the JavaDoc, and it says that JmsServer is to be used instead. Does what
you said also apply to JmsServer?

--aslam

Tim Anderson wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">You need to configure the server with as per: 
&amp;nbsp;&amp;nbsp;&amp;nbsp; <a class="moz-txt-link-freetext" href="http://openjms.sourceforge.net/config/embedded.html">http://openjms.sourceforge.net/config/embedded.html</a> 

You also need to start the server in the same JVM as your client. 
As the server takes time to start, initial attempts to connect may
fail. 
You may need to retry several times before the connection succeeds. 

If you want an example of how to do this, have a look at the
EmbeddedServerAdapter and 
RemoteServerAdapter classes at: 
<a class="moz-txt-link-freetext" href="http://jmscts.cvs.sourceforge.net/jmscts/jmscts/src/providers/openjms/org/exolab/jmscts/openjms/">http://jmscts.cvs.sourceforge.net/jmscts/jmscts/src/providers/openjms/org/exolab/jmscts/openjms/</a> 

-Tim 


aslam wrote:

  I need to use the embedded scheme, because I'm implementing (automated)
unit
tests for JMS listeners &amp;amp; producers. Here's what's happening:

<a class="moz-txt-link-freetext" href="http://www.nabble.com/file/p16131044/openjms.xml">http://www.nabble.com/file/p16131044/openjms.xml</a>  openjms.xml 

Statement: Context context = new InitialContext(props) ...where props are:
java.naming.factory.initial=org.exolab.jms.jndi.InitialContextFactory
java.naming.provider.url=embedded://
java.naming.security.principal=admin
java.naming.security.credentials=openjms

Provider URL "embedded://"
...causes the following exception:
javax.naming.CommunicationException: Failed to get registry service for
URL:
embedded:// [Root exception is java.rmi.ConnectIOException: Failed to
create
connection; nested exception is: 
	org.exolab.jms.net.connector.ConnectException: Connection refused,
URI=vm://openjms/]

The same exception is thrown if I use "vm://openjms/" as the provider URL.

With provider URL "vm:openjms", the above statement results in the
following
exception:

javax.naming.CommunicationException: Failed to lookup JNDI provider for
URL:
vm:openjms [Root exception is java.rmi.RemoteException: -1; nested
exception
is: 
	java.lang.ArrayIndexOutOfBoundsException: -1]

Anyone know what might be wrong?

--aslam


a k'wala wrote:
  
  
    Looks like the URL for an embedded server is "vm:openjms", based on
org.exolab.jms.jndi.InitialContextFactory.getProviderURI(String)

The doc at <a class="moz-txt-link-freetext" href="http://openjms.sourceforge.net/usersguide/embedded.html">http://openjms.sourceforge.net/usersguide/embedded.html</a>  says
it
is "embedded://".

Can someone confirm this?

Thanks.

--aslam

[truncated]


    </pre>
  </blockquote>
  <pre wrap=""><!---->
  </pre>
</blockquote>
<br>
</body>
</html>


--===============0501924981==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
--===============0501924981==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
openjms-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openjms-user

--===============0501924981==--