Glassfish V3.x and Remote Standalone Client

It is absolutely impossible to connect to ActiveMQ as a standalone client. The only thing you need is to add activeemq-all-5.4.1.jar and there you are ...

... prop.put(Context.SECURITY_AUTHENTICATION , "system"); prop.put(Context.SECURITY_CREDENTIALS,"manager"); prop.put(Context.INITIAL_CONTEXT_FACTORY,"org.apache.activemq.jndi.ActiveMQInitialContextFactory"); prop.put(Context.PROVIDER_URL,"tcp://localhost:61616"); prop.put("connectionFactoryNames", "TopicCF"); prop.put("topic.topic1", "topic1"); InitialContext ctx = new InitialContext(prop); ... 

Now you want to connect to Glassfish V3.x , and it seems impossible to get the right libraries and classes to connect. Although it was still possible with Glassfish V2.x, I have not yet been able to get the equivalent code above for Glassfish!

 ... Properties properties = new Properties(); properties.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.appserv.naming.S1ASCtxFactory"); properties.put(Context.PROVIDER_URL, "iiop://localhost:3700"); InitialContext context = new InitialContext(properties) ... 

Does anyone have an answer to this? No, I do not want to deploy a read-only corporate application client from the Glassfish queue. There are similar topics here, but nowhere else.

Thanks for any advice.

Sven

+3
source share
3 answers

This is a complete list of client glass fish cans 3:

 auto-depends.jar deployment-common.jar glassfish-corba-internal-api.jar internal-api.jar management-api.jar bean-validator.jar dol.jar glassfish-corba-newtimer.jar javax.ejb.jar orb-connector.jar common-util.jar ejb-container.jar glassfish-corba-omgapi.jar javax.jms.jar orb-iiop.jar config-api.jar ejb.security.jar glassfish-corba-orb.jar javax.resource.jar security.jar config-types.jar glassfish-api.jar glassfish-corba-orbgeneric.jar javax.servlet.jar ssl-impl.jar config.jar glassfish-corba-asm.jar glassfish-naming.jar javax.transaction.jar transaction-internal-api.jar connectors-internal-api.jar glassfish-corba-codegen.jar gmbal.jar jta.jar container-common.jar glassfish-corba-csiv2-idl.jar hk2-core.jar kernel.jar 
+3
source

When connected to Glassfish V3, there is no need to add any properties to the InitialContext constructor. You can simply use the no-arg constructor. To specify the server name and port, set the properties -Dorg.omg.CORBA.ORBInitialHost and -Dorg.omg.CORBA.ORBInitialPort to the JVM, respectively.

As for libraries, all you need to include is the gf-client.jar file. It can be found in $ GLASSFISH_HOME / lib. This jar file will automatically include any other libraries.

For more information see http://glassfish.java.net/javaee5/ejb/EJB_FAQ.html#StandaloneRemoteEJB . Although this document is about using EJB in a standalone client, the same solutions apply to using JMS.

+3
source

You can see the solution that I found when faced with the same problem: What maven dependencies can I create a standalone JMS client for Glassfish with?

0
source

Source: https://habr.com/ru/post/1489005/


All Articles