문제

I am trying to use aries to connect to my glassfish 4 server. I installed all modules and started org.apache.aries.jndi-1.0.0.jar

I created initial context like this

InitialContext ctx = new InitialContext();

But got such error

Caused by: javax.naming.NoInitialContextException at org.apache.aries.jndi.DelegateContext.getDefaultContext(DelegateContext.java:233)

How to set initial context to connect to GF4? What properties to use to connext to server x.x.x.x to port NN?

도움이 되었습니까?

해결책

Aries is not needed to connect to glassfish. Try to install gf-client-module.jar from the glassfish modules dir into the OSGi container and follow this howto to set up jndi: https://glassfish.java.net/javaee5/ejb/EJB_FAQ.html#StandaloneRemoteEJB

Aries jndi is only needed if you want to access a local OSGi service using jndi. This is for example needed to access a jpa data source using the persistence.xml.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top