Custom jndi name for ejb3.X with Jboss 7.1 - java

I am migrating one application from weblogic to jboss7.1 and ejb2.0 to ejb3.X. The application is using jndi name for ejb lookup.
Could someone help me to find out how can i configure my custom jndi name with ejb3.0 and jboss 7.1.
I have read on internet that in Jboss 7.1 there is no concept of jndi-name. if it is true. could someone let me know how can i lookup this jndi name, getting registered by jboss for ejbs present in ejb-jar.xml
java:global/pirptfe/RRMSessionFacadeEJB!com.bfm.app.pirptfe.heatmap.ejb.RRMSessionFacadeHome
java:app/pirptfe/RRMSessionFacadeEJB!com.bfm.app.pirptfe.heatmap.ejb.RRMSessionFacadeHome
java:module/RRMSessionFacadeEJB!com.bfm.app.pirptfe.heatmap.ejb.RRMSessionFacadeHome
java:jboss/exported/pirptfe/RRMSessionFacadeEJB!com.bfm.app.pirptfe.heatmap.ejb.RRMSessionFacadeHome
java:global/pirptfe/RRMSessionFacadeEJB!com.bfm.app.pirptfe.heatmap.ejb.RRMSessionFacadeRemote
java:app/pirptfe/RRMSessionFacadeEJB!com.bfm.app.pirptfe.heatmap.ejb.RRMSessionFacadeRemote
java:module/RRMSessionFacadeEJB!com.bfm.app.pirptfe.heatmap.ejb.RRMSessionFacadeRemote
java:jboss/exported/pirptfe/RRMSessionFacadeEJB!com.bfm.app.pirptfe.heatmap.ejb.RRMSessionFacadeRemote

i got the answer of my question. in ejb3.X on jboss7.1 and above there is no concept of custom jndi. you have to call your ejb as below
ctx.lookup("java:global/pirptfe/RRMSessionFacadeEJB!com.bfm.app.pirptfe.heatmap.ejb.RRMSessionFacadeHome");

Related

Portable datasource jndi for JBoss and OC4j

I am new to JBoss development, I am migrating one application from OC4J to JBoss, What i came to know is jndi names are different in OC4J and JBoss Application Server, So i have one jndi datasource named as jdbc/sampleDataSource in OC4J datasource configuration. Similarly I have done a configuration for JBoss named as java:/jdbc/sampleDataSource.
As the ear should be able to deploy on both application server, I am facing issues while making code compatible for JBoss as well OC4j
For e.g
#Resource(mappedName = "jdbc/sampleDataSource")
private sampleDataSource dataSource;
How can i make above parameter compatible for JBoss as well OC4J as the jndi name is different in both Server?
There are also bean level data source injection:
#Resource( name = "jdbc/sampleDataSource", type = javax.sql.DataSource.class, mappedName = "jdbc/sampleDataSource", authenticationType = Resource.AuthenticationType.CONTAINER),
So please let me know what are the changes i need to perform to make the code compatible with JBoss AS7 and OC4J as well.

Jackrabbit on wildfly configured as War appliaction with jndiname

I want a Model 1 like deployment for JackRabbit on Wildfly along with a JNDI name to the resource ( java:/jcr/JcrRepository )
I have configured jackrabbit-webapp-2.6.4.war on Wildlfy.
I have configured my resource.xml, bootstrap.properties and the jackrabbit-webapps/WEB-INF/web.xml contain the correct paths to the resource.xml and the bootstrap.properties.
Also a different web-application accesses this jackrabbit repository and it needs to reference this jack rabbit resource through a JNDI name.
My question is where do I configure the JNDI name for Jackrabbit on Wildfly ?
If I were to configure it as a JCA adapter with Model 2 like deployment, I could have configured it as a JCA subsystem in the standalone-xml, but in this case I want to follow a Model 1 like deployment.
Any help from anybody ?

how to configure #localbinding and #remoteBinding in wildfly

We are migrating from JBOSS6 to wildfly8.2 and as wildfly support EJB3.2 and EJB3.2 does not support #LocalBinding / #RemoteBinding ,so how will I do the same in wildfly using standalone.xml / ejb-jar.xml / any other configuration.
I tried JBoss: Binding values into JNDI in JBoss EAP 6 similar to JNDIBindingServiceMgr thread but could not link where i will map the jndi name to my EJB and how lookup will be happened.
Please help.
Many Thanks.
This information provided into wildfly documents, can be used by others also as I am going to test with it to implement for my question:
https://docs.jboss.org/author/display/WFLY8/JNDI+Reference

Session Count on JBoss AS 7.1

How can I see the http-session count for my JBoss AS 7.1 instance.
I can't find anything on the JBoss Application Server 7.1 Management Console.
Last time I used JBoss AS was version 4.3.
Thanks.
If you are talking about a specific application then you can use 'HttpSessionListener' or using 'HttpSessionBindingListener' http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpSessionBindingListener.html
This would look at the sessions from inside the servlet container.
On the other hand the container should be able to count them as well. Old JBosses were able to disclose the information on a JMX bean
jboss.web:host=localhost,path=/<context-name>,type=Manager
with an attribute named 'activeSessions'.
On recent JBosses, the value is available in a different location, which is best explained here:
https://developer.jboss.org/thread/219739?_sscc=t

How to expose an EJB3.0 session ejb for a desktop app in Weblogic 11g

Since:
the #EJB doesn't work on desktop apps, because there's no container,
Weblogic doesn't expose through JNDI the names of the EJB's (3.0),
I didn't find anything about it in the official documentation for a few days now,
does anyone know how I could consume an EJB from a desktop app?
I got hints that i have to modify web.xml... but then what web.xml, there's more of them and at least some of them break my app.
Clarification:
I have a WebLogic server running, NOT exposing some EJB's inside an EAR hosted on that server. Specifically, the server is not exposing the names of EJB3.0 Session beans, while it DOES expose the names of some other EJB2.1 names.
How do i get a reference to the EJB3.0 objects, hosted on my server, from my desktop app?
FURTHER Clarification:
Weblogic Specifically does not expose the names of EJB3.0 within the JNDI, because the specifications of EJB3.0 don't require it.
To answer my own question (got it after some effort), to expose an EJB3.0 object through a remote interface, in the Weblogic 11g server, these steps must be taken:
This is what my ejb-jar.xml says about the bean RolyBean:
<enterprise-beans>
<session id="Session_Roly">
<display-name>Roly</display-name>
<ejb-name>Roly</ejb-name>
<remote>com.medicon.server.RolyRemote</remote>
<ejb-class>com.medicon.server.RolyBean</ejb-class>
<session-type>Stateless</session-type>
</session>
</enterprise-beans>
This is what the weblogic-ejb-jar.xml (in the same dir) says:
<wls:weblogic-enterprise-bean>
<wls:ejb-name>Roly</wls:ejb-name>
<wls:jndi-name>Roly</wls:jndi-name>
</wls:weblogic-enterprise-bean>
These 2 deployment descriptors seem to be the only 2 places where it's required to specify exposure of the EJB through JNDI.

Categories

Resources