You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by MMA_EDFX <ma...@edifixio.com> on 2016/06/10 13:27:33 UTC

After Upgrading to TomEE 7.0.0 from TomEE 1.7.2 JNDI lookup does not work

I am getting below exception when I upgrade to TomEE 7.0.0 when trying to
lookup jndi.

Exception:

WARNING: RequestFailed{server=http://localhost:9500/tomee/ejb}
JNDI_LOOKUP:/CalculatorService {error=Cannot open input stream to server: }
Exception in thread "main" org.apache.openejb.client.ClientRuntimeException:
Invalid response from server: -1
	at org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:468)
	at javax.naming.InitialContext.lookup(InitialContext.java:411)
	at
com.edifixio.jms.service.CalculatorServiceTest.main(CalculatorServiceTest.java:26)

Java class:

public class CalculatorServiceTest{

	public static void main(String[] args) throws NamingException{
		Hashtable<String,String> env = new Hashtable<String,String>();
	
env.put(Context.INITIAL_CONTEXT_FACTORY,"org.apache.openejb.client.RemoteInitialContextFactory");
		env.put(Context.PROVIDER_URL,"http://localhost:9500/tomee/ejb");
		Context ctx = new InitialContext(env);
		CalculatorService calculatorService =
(CalculatorService)ctx.lookup("CalculatorService");
		System.out.println(calculatorService.add(100,20));
	}
	
}

This works fine if I use TomEE 1.7.2.

How do I make it work with TomEE 7.0.0.




--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/After-Upgrading-to-TomEE-7-0-0-from-TomEE-1-7-2-JNDI-lookup-does-not-work-tp4678844.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: After Upgrading to TomEE 7.0.0 from TomEE 1.7.2 JNDI lookup does not work

Posted by MMA_EDFX <ma...@edifixio.com>.
Thanks.  It worked after un commenting the line * tomee.remote.support =
true.*



--
View this message in context: http://tomee-openejb.979440.n4.nabble.com/TomEE-7-0-0-JNDI-lookup-does-not-work-tp4678844p4678848.html
Sent from the TomEE Users mailing list archive at Nabble.com.

Re: After Upgrading to TomEE 7.0.0 from TomEE 1.7.2 JNDI lookup does not work

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Documentation is there:
http://tomee.apache.org/ng/admin/configuration/server.html

See tomee.remote.support and tomee.serialization*


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<https://blog-rmannibucau.rhcloud.com> | Old Wordpress Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com> | JavaEE Factory
<https://javaeefactory-rmannibucau.rhcloud.com>

2016-06-10 15:27 GMT+02:00 MMA_EDFX <ma...@edifixio.com>:

> I am getting below exception when I upgrade to TomEE 7.0.0 when trying to
> lookup jndi.
>
> Exception:
>
> WARNING: RequestFailed{server=http://localhost:9500/tomee/ejb}
> JNDI_LOOKUP:/CalculatorService {error=Cannot open input stream to server: }
> Exception in thread "main"
> org.apache.openejb.client.ClientRuntimeException:
> Invalid response from server: -1
>         at
> org.apache.openejb.client.JNDIContext.lookup(JNDIContext.java:468)
>         at javax.naming.InitialContext.lookup(InitialContext.java:411)
>         at
>
> com.edifixio.jms.service.CalculatorServiceTest.main(CalculatorServiceTest.java:26)
>
> Java class:
>
> public class CalculatorServiceTest{
>
>         public static void main(String[] args) throws NamingException{
>                 Hashtable<String,String> env = new
> Hashtable<String,String>();
>
>
> env.put(Context.INITIAL_CONTEXT_FACTORY,"org.apache.openejb.client.RemoteInitialContextFactory");
>                 env.put(Context.PROVIDER_URL,"
> http://localhost:9500/tomee/ejb");
>                 Context ctx = new InitialContext(env);
>                 CalculatorService calculatorService =
> (CalculatorService)ctx.lookup("CalculatorService");
>                 System.out.println(calculatorService.add(100,20));
>         }
>
> }
>
> This works fine if I use TomEE 1.7.2.
>
> How do I make it work with TomEE 7.0.0.
>
>
>
>
> --
> View this message in context:
> http://tomee-openejb.979440.n4.nabble.com/After-Upgrading-to-TomEE-7-0-0-from-TomEE-1-7-2-JNDI-lookup-does-not-work-tp4678844.html
> Sent from the TomEE Users mailing list archive at Nabble.com.
>