You can try to add system property com.sun.jersey.server.impl.cdi.lookupExtensionInBeanManager set to true to your JBoss EAP configuration file (standalone-*.xml/domain.xml)
<property name="com.sun.jersey.server.impl.cdi.lookupExtensionInBeanManager" value="true" />
Not work. I have added this system properties to my server.
<system-properties> <property name="com.sun.jersey.server.impl.cdi.lookupExtensionInBeanManager" value="true"/> </system-properties>
What is jersey? Is it included in jboss eap 7? I did not explicitly use it.
Are you trying to create the InitialContext locally on the application server, or from a remote client? If you are doing it locally, you should just be able to instantiate the context without specifying the "java.naming.factory.initial" parameter. If you are doing it remotely, the properties that you showed are outdated. For example, the initial factory class is "org.jboss.naming.remote.client.InitialContextFactory".
it is server side. Ok now I understand without specifying the "java.naming.factory.initial" parameter. Do you know how to do jndi binding programmatically instead of the xml descriptor?
I tried the following but not work.
Are you getting the same error, even without the "factory.initial" parameter, or is it something else? Are you using annotations or deployment descriptors to declare your class as an EJB? If you are using annotations, you can use the "mappedName" parameter to force a specific lookup name. Something like:
If I use deployment descriptors, it works. but I just want to confirm that on the server side, in the program, naming context is read only, i.e. method bind() cannot be used (even with java:global)