[jboss-dev-forums] [EJB3 Development] - Jboss5.1 Migration to JBoss7.1 Custom-JNDI-Handling
Gary Dux
do-not-reply at jboss.com
Wed Apr 10 07:28:15 EDT 2013
Gary Dux [https://community.jboss.org/people/garydux] created the discussion
"Jboss5.1 Migration to JBoss7.1 Custom-JNDI-Handling"
To view the discussion, visit: https://community.jboss.org/message/807407#807407
--------------------------------------------------------------
| |
| Hello together,
in our applications we used to define jndi-mappings in jboss.xml:
<?xml version="1.0" encoding="UTF-8"?>
<jboss (http://www.coderanch.com/forums/f-63/JBoss)>
<enterprise-beans>
<session>
<ejb-name>ContractPortfolioProcessServiceBean</ejb-name>
<jndi-name>com/fja/ipl/customer/ilis/contractportfolio/ContractPortfolioProcessService</jndi-name>
</session>
</enterprise-beans>
</jboss>
ithis jboss.xml was placed then in META-INF of that ejb-jar
So it was easy to lookup for that bean like:
public static ContractPortfolioProcessService lookupContractPortfolioProcessService()
throws NamingException (http://docs.oracle.com/javase/7/docs/api/javax/naming/NamingException.html) {
final Context context = new InitialContext (http://docs.oracle.com/javase/7/docs/api/javax/naming/InitialContext.html)();
return (ContractPortfolioProcessService ) context.lookup("com/fja/ipl/customer/ilis/contractportfolio/ContractPortfolioProcessService");
}
jndi.properties{
#JBoss
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=jnp://localhost:1099
java.naming.factory.url.pkgs=org.jboss.naming http://cache-www.coderanch.com/images/smilies/jr-redface.gif (http://cache-www.coderanch.com/images/smilies/jr-redface.gif)rg.jnp.interfaces
}
How can it be made on JBOSS7?
Due ejb3-spec in JBOSS7 they can also define jboss-ejb3.xml like this:
<jboss:ejb-jar xmlns:jboss="http://www.jboss.com/xml/ns/javaee"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:iiop="urn:iiop"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-2_0.xsd
http://java.sun.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-spec-2_0.xsd
urn:iiop jboss-ejb-iiop_1_0.xsd"
version="3.1"
impl-version="2.0">
<enterprise-beans>
<session>
<ejb-name>CounterBean</ejb-name>
<mapped-name>org/jboss/as/quickstarts/ejb/remote/stateful/CounterBean</mapped-name>
</session>
</enterprise-beans>
<assembly-descriptor>
<iiop:iiop>
<ejb-name>CounterBean</ejb-name>
<iiop:binding-name>org/jboss/as/quickstarts/ejb/remote/stateful/CounterBean</iiop:binding-name>
</iiop:iiop>
</assembly-descriptor>
</jboss:ejb-jar>
It deploys also errorless. But i did not find any dokumentation to lookup my ejb like in example above.
Who can help me giving a hint in this case?
How is the jndi.properties-Configuration would be in this case? |
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/807407#807407]
Start a new discussion in EJB3 Development at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2030]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-dev-forums/attachments/20130410/733a78d4/attachment-0001.html
More information about the jboss-dev-forums
mailing list