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.inter...
}
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&...]