[EJB/JBoss] - Re: EJB not bound :
by Arvind_MV
Hi All,
I know that many have posted the same query but i followed some steps based on this post. But still i am unable to resolve the issue.
My test program is as shown below:
nitialContext iniCtx= null;
Context ejbCtx = null;
CryptoHome home=null;
Properties props = null;
//MyBeanLocal local = null;
Object ref = null;
CryptoHome cryptoHome=null;
try {
/* iniCtx = new InitialContext();
//ejbCtx = (Context) iniCtx.lookup("java:comp/env/ejb/Crypto");
//home = (CryptoHome) iniCtx.lookup("Crypto"); //java:comp/env/
home = (CryptoHome) new InitialContext().lookup("java:comp/env/ejb/Crypto"); */
props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interface");
props.put(Context.PROVIDER_URL, "jnp://localhost:1099");
// I have tried "localhost:1099", 127.0.0.1, etc as well
Context ctx= new InitialContext(props);
// *never makes it here, exception NameNotFoundException*
//Object ref = ctx.lookup("MyBeanLocal");
cryptoHome = (CryptoHome)ctx.lookup("java:comp/env/Crypto");
//local = cryptoHome.create();
} catch (NamingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
At the crypto home it is throwing the nullpointer exception, is it right way of mentioning the JNDI name. In the Jboss console it shows javax.naming.NameNotFoundException: Crypto not bound
Please let me know the solution.
Thanks,
Arvind
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4162550#4162550
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4162550
17 years, 10 months
[Installation, Configuration & DEPLOYMENT] - Re: Configuring dependencies in Services
by Marcelo.S_
"jaikiran" wrote : "zithuba" wrote : Yes, There is another topic dealing with this deployment problem, where a DS is deployed after the dependent ear or war.
| | http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4162523#4162523
|
| Probably not :)
|
| Marcelo.S_ is using JBoss-4.2.2 GA and not JBoss-5.0 CR1. From what i know, the datasource dependencies work fine in 4.2.2 GA. We just have to figure out the correct "depends" value to use.
|
Was just taking a look at those topics:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=138587
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=138584
It might not be the same cause, however it made me take a look at \server\default\conf\jboss-service.xml:
<!-- The URLComparator can be used to specify a deployment ordering
| for deployments found in a scanned directory. The class specified
| must be an implementation of java.util.Comparator, it must be able
| to compare two URL objects, and it must have a no-arg constructor.
| Two deployment comparators are shipped with JBoss:
| - org.jboss.deployment.DeploymentSorter
| Sorts by file extension, as follows:
| "sar", "service.xml", "rar", "jar", "war", "wsr", "ear", "zip",
| "*"
| - org.jboss.deployment.scanner.PrefixDeploymentSorter
| If the name portion of the url begins with 1 or more digits, those
| digits are converted to an int (ignoring leading zeroes), and
| files are deployed in that order. Files that do not start with
| any digits will be deployed first, and they will be sorted by
| extension as above with DeploymentSorter.
| -->
| <attribute name="URLComparator">org.jboss.deployment.DeploymentSorter</attribute>
|
| <!--
| <attribute name="URLComparator">org.jboss.deployment.scanner.PrefixDeploymentSorter</attribute>
| -->
|
Just renamed hibernate-service.sar to hibernate-service.jar and it worked as a charm. I'm still curious thought, since the dependencies should work and renaming isn't really the best alternative.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4162540#4162540
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4162540
17 years, 10 months