0

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?

1 Answers1

1

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.

Christian Schneider
  • 19,420
  • 2
  • 39
  • 64
  • I understand what you mean. The problem that using your variant I came across with serious problem that I up to now can't solve. Maybe you can take a look http://stackoverflow.com/questions/23174582/arraylist-classloader-issue-in-osgi-client-javaeeejb-server That's why I am looking for alternative solution –  Apr 22 '14 at 23:31
  • The cariant you try here can not work. You have to get the variant from your other question working. THe answers there point into the right direction I think. – Christian Schneider Apr 23 '14 at 06:56