tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From MMA_EDFX <madhava.ma...@edifixio.com>
Subject After Upgrading to TomEE 7.0.0 from TomEE 1.7.2 JNDI lookup does not work
Date Fri, 10 Jun 2016 13:27:33 GMT
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.

Mime
View raw message