[Beginner's Corner] - Resolution should not happen via injection container-jboss 5 for ejb3
by Shalini U
Shalini U [http://community.jboss.org/people/Shalini_Cool] created the discussion
"Resolution should not happen via injection container-jboss 5 for ejb3"
To view the discussion, visit: http://community.jboss.org/message/547548#547548
--------------------------------------------------------------
Hi!
I'm trying to implement stateless session bean in ejb 3 by using the editor netbeans6.8. It was working fine with Glassfish server version2. But, When I try to deploy the same in jboss 5.1.0, I'm getting the exception as follows:
2010-06-07 10:48:59,483 ERROR [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (main) ENC setup failed java.lang.IllegalStateException: Resolution should not happen via injection container at org.jboss.web.tomcat.service.TomcatInjectionContainer.getEjbJndiName(TomcatInjectionContainer.java:640) at org.jboss.injection.EjbEncInjector.inject(EjbEncInjector.java:80) at org.jboss.web.tomcat.service.TomcatInjectionContainer.populateEnc(TomcatInjectionContainer.java:482) at org.jboss.web.tomcat.service.deployers.TomcatDeployment$EncListener.lifecycleEvent(TomcatDeployment.java:471) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4388) at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:310) at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:142) at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461) at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118) at org.jboss.web.deployers.WebModule.start(WebModule.java:97) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at.........
What Changes I need to do to make it run through jboss 5.1.0? I'm new to ejb 3
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/547548#547548]
Start a new discussion in Beginner's Corner at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years
[JNDI and Naming] - $Proxy60 - returned by JBOSS JNDI Context
by Anand Krishnan
Anand Krishnan [http://community.jboss.org/people/anandhakrishnank] created the discussion
"$Proxy60 - returned by JBOSS JNDI Context"
To view the discussion, visit: http://community.jboss.org/message/547544#547544
--------------------------------------------------------------
Hi All,
I am facing a strange ERROR, infact it is not an error thats how
the jboss returns the object. JBOSS returns $Proxy60, when i try to
retrieve object from Context. Please find the details below.
MBEAN DEFN:
<server>
<mbean code="org.jboss.naming.ExternalContext"
name="jboss.jndi:service=ExternalContext,jndiName=external/ldap/jboss">
<attribute name="JndiName">java:external/ldap/jboss</attribute>
<attribute name="Properties">
java.naming.factory.initial=org.jnp.interfaces.LocalOnlyContextFactory
</attribute>
<attribute
name="InitialContext">javax.naming.ldap.InitialLdapContext</attribute>
<attribute name="RemoteAccess">false</attribute>
</mbean>
</server>
The Mbean is JBOSS Class, I am testing this with JBoss standards and not
with my customClass.
[step A]Context envContext = (Context)ctx.lookup("java:");
[step B]Object ldapCtx = (Object)envContext.lookup("jndi/externalLDAP");
In step A, I could retieve the Initial Context.
But, in step B, It returns me $Proxy60 and I am unable to typecast this
object.
Here s my code again:
[1]Context ctx = new InitialContext();
[2]Context envContext = (Context)ctx.lookup("java:");
[3]Object ldapCtx = (Object)envContext.lookup("jndi/externalLDAP");
[4]System.out.println("Class name:- "+ldapCtx .getClass().getName());
[5]System.out.println("Object value:- "+ldapCtx.toString());
The output is as follows
[line 4: prints this value] Class name:- $Proxy60
[line 5: prints this value] Object value:-
javax.naming.InitialContext@b3826f
IF I type caste to InitialContext, it gives me ClassCastException.
Any suggestion, how to use this object?
Thanks,
Anand
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/547544#547544]
Start a new discussion in JNDI and Naming at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
16 years