[jboss-jira] [JBoss JIRA] (AS7-5860) lookup jndi ejb3
Nhat Nguyen (JIRA)
jira-events at lists.jboss.org
Wed Oct 31 23:03:17 EDT 2012
[ https://issues.jboss.org/browse/AS7-5860?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nhat Nguyen updated AS7-5860:
-----------------------------
Description:
Hi,
I just deployed a sample ejb3 in jboss 7.1.1
Name of module is ejb3.jar, i see on the log server follow :
"
java:global/ejb3/CalculatorEJB!org.begonia.calculator.CalculatorRemote
java:app/ejb3/CalculatorEJB!org.begonia.calculator.CalculatorRemote
java:module/CalculatorEJB!org.begonia.calculator.CalculatorRemote
java:jboss/exported/ejb3/CalculatorEJB!org.begonia.calculator.CalculatorRemote
java:global/ejb3/CalculatorEJB!org.begonia.calculator.CalculatorLocal
java:app/ejb3/CalculatorEJB!org.begonia.calculator.CalculatorLocal
java:module/CalculatorEJB!org.begonia.calculator.CalculatorLocal
"
My client
public class CalculatorTest {
public static Context getContext() throws NamingException {
Properties properties = new Properties();
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.jboss.naming.remote.client.InitialContextFactory");
properties.setProperty(Context.URL_PKG_PREFIXES,
"org.jboss.ejb.client.naming");
properties.setProperty(Context.PROVIDER_URL,
"remote://127.0.0.1:4447");
properties.put(Context.SECURITY_PRINCIPAL,"jbossclient");
properties.put(Context.SECURITY_CREDENTIALS,"0123456789");
return new InitialContext(properties);
}
public static void test() throws NamingException, InterruptedException {
Context iContext = getContext();
Object c =
iContext.lookup("ejb:/ejb3//CalculatorEJB!org.begonia.calculator.CalculatorRemote"
);
System.out.println(((CalculatorRemote)c).sum(1,2));
}
public static void main(String[] args) throws NamingException, RemoteException, CreateException, InterruptedException {
CalculatorTest.test();
}
}
When i run client, catch exception
Exception in thread "main" java.lang.IllegalStateException: No EJB receiver available for handling [appName:,modulename:ejb3,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext at 10da5eb
When i hide the line
/*properties.setProperty(Context.URL_PKG_PREFIXES,
"org.jboss.ejb.client.naming");*/
run the client i catch exception
javax.naming.NameNotFoundException: ejb:/ejb3//CalculatorEJB!org.begonia.calculator.CalculatorRemote -- service jboss.naming.context.java.jboss.exported.ejb:.ejb3."CalculatorEJB!org.begonia.calculator.CalculatorRemote"
Who can help me fix this bug?
thanks.
was:
Hi,
I just deployed a sample ejb3 in jboss 7.1.1
Name of module is ejb3.jar, i see on the log server follow :
"
java:global/ejb3/CalculatorEJB!org.begonia.calculator.CalculatorRemote
java:app/ejb3/CalculatorEJB!org.begonia.calculator.CalculatorRemote
java:module/CalculatorEJB!org.begonia.calculator.CalculatorRemote
java:jboss/exported/ejb3/CalculatorEJB!org.begonia.calculator.CalculatorRemote
java:global/ejb3/CalculatorEJB!org.begonia.calculator.CalculatorLocal
java:app/ejb3/CalculatorEJB!org.begonia.calculator.CalculatorLocal
java:module/CalculatorEJB!org.begonia.calculator.CalculatorLocal
"
My client
public class CalculatorTest {
public static Context getContext() throws NamingException {
Properties properties = new Properties();
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
"org.jboss.naming.remote.client.InitialContextFactory");
properties.setProperty(Context.URL_PKG_PREFIXES,
"org.jboss.ejb.client.naming");
properties.setProperty(Context.PROVIDER_URL,
"remote://127.0.0.1:4447");
properties.put(Context.SECURITY_PRINCIPAL,"jbossclient");
properties.put(Context.SECURITY_CREDENTIALS,"0123456789");
return new InitialContext(properties);
}
public static void test() throws NamingException, InterruptedException {
Context iContext = getContext();
Object c =
iContext.lookup("ejb:/ejb3//CalculatorEJB!org.begonia.calculator.CalculatorRemote"
);
System.out.println(((CalculatorRemote)c).sum(1,2));
}
public static void main(String[] args) throws NamingException, RemoteException, CreateException, InterruptedException {
CalculatorTest.test();
}
}
> lookup jndi ejb3
> ----------------
>
> Key: AS7-5860
> URL: https://issues.jboss.org/browse/AS7-5860
> Project: Application Server 7
> Issue Type: Task
> Components: EJB
> Affects Versions: 7.1.1.Final
> Reporter: Nhat Nguyen
> Assignee: jaikiran pai
>
> Hi,
> I just deployed a sample ejb3 in jboss 7.1.1
> Name of module is ejb3.jar, i see on the log server follow :
> "
> java:global/ejb3/CalculatorEJB!org.begonia.calculator.CalculatorRemote
> java:app/ejb3/CalculatorEJB!org.begonia.calculator.CalculatorRemote
> java:module/CalculatorEJB!org.begonia.calculator.CalculatorRemote
> java:jboss/exported/ejb3/CalculatorEJB!org.begonia.calculator.CalculatorRemote
> java:global/ejb3/CalculatorEJB!org.begonia.calculator.CalculatorLocal
> java:app/ejb3/CalculatorEJB!org.begonia.calculator.CalculatorLocal
> java:module/CalculatorEJB!org.begonia.calculator.CalculatorLocal
> "
> My client
> public class CalculatorTest {
> public static Context getContext() throws NamingException {
> Properties properties = new Properties();
> properties.setProperty(Context.INITIAL_CONTEXT_FACTORY,
> "org.jboss.naming.remote.client.InitialContextFactory");
> properties.setProperty(Context.URL_PKG_PREFIXES,
> "org.jboss.ejb.client.naming");
> properties.setProperty(Context.PROVIDER_URL,
> "remote://127.0.0.1:4447");
> properties.put(Context.SECURITY_PRINCIPAL,"jbossclient");
> properties.put(Context.SECURITY_CREDENTIALS,"0123456789");
> return new InitialContext(properties);
> }
> public static void test() throws NamingException, InterruptedException {
> Context iContext = getContext();
> Object c =
> iContext.lookup("ejb:/ejb3//CalculatorEJB!org.begonia.calculator.CalculatorRemote"
> );
> System.out.println(((CalculatorRemote)c).sum(1,2));
> }
> public static void main(String[] args) throws NamingException, RemoteException, CreateException, InterruptedException {
> CalculatorTest.test();
> }
> }
> When i run client, catch exception
> Exception in thread "main" java.lang.IllegalStateException: No EJB receiver available for handling [appName:,modulename:ejb3,distinctname:] combination for invocation context org.jboss.ejb.client.EJBClientInvocationContext at 10da5eb
> When i hide the line
> /*properties.setProperty(Context.URL_PKG_PREFIXES,
> "org.jboss.ejb.client.naming");*/
> run the client i catch exception
> javax.naming.NameNotFoundException: ejb:/ejb3//CalculatorEJB!org.begonia.calculator.CalculatorRemote -- service jboss.naming.context.java.jboss.exported.ejb:.ejb3."CalculatorEJB!org.begonia.calculator.CalculatorRemote"
> Who can help me fix this bug?
> thanks.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list