Hi EveryOne,

When I'm trying to look up the Local EJB through a Servlet and I'm getting the 
java.lang.ClassCastException.

Here is  my Client Code

  | try {
  |     Context context = new InitialContext();
  |     Object object = context.lookup("LoginSLHome");
  |     logger.info("Object ::: "+object.getClass().getName());                
  |     LoginSLHome home = (LoginSLHome) object;                
  | } catch (Exception exception) {
  |     logger.error("Exception while locating Home Object: ");
  |     logger.error(exception);
  | }
  | 

Output of the above logger statement is
Object ::: $Proxy128
In jboss.xml

<session>
  |     <ejb-name>LoginSLEJB</ejb-name>
  |     <local-jndi-name>LoginSLHome</local-jndi-name>
  | </session>
  | 

In ejb-jar.xml

  | <session>
  |             <ejb-name>LoginSLEJB</ejb-name>
  |             <local-home>beans.LoginSLHome</local-home>
  |             <local>beans.LoginSL</local>
  |             <ejb-class>beans.LoginSLBean</ejb-class>
  |             <session-type>Stateless</session-type>
  |             <transaction-type>Container</transaction-type>
  | </session>
  | 

I have made changes to the followinf files in Jboss i.e.

1) default/conf/jboss-service.xml, changed to true for the following 
CallByValue (JNDI Configuration)
2) default/deploy/ear-deployer.xml,  changed to true for the following 
CallByValue 
3) Edit deploy\jbossweb-tomcat55.sar\META-INF\jboss-service.xml , and changed 
Java2ClassLoadingCompilance and UseJbossWebLoader attributes as true

Please help me to solve this problem.

Thanks and Regards










View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3909770#3909770

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3909770


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to