Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-07-2008, 12:25 PM
Member
 
Join Date: May 2008
Posts: 2
mohiit is on a distinguished road
EJB 3 Stateful Application
Hi all,

I am having EJB 3 stateful application. Code is shown below

try {
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
props.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.namingrg.jnp.interfaces");
props.put(Context.PROVIDER_URL, "jnp://localhost:1099");
InitialContext ic = new InitialContext(props);
//InitialContext ic = new InitialContext();
System.out.println("JSP INIT Befor lookup=============");
//Object obj = (Object) ic.lookup("StatefulCode/AccountBean/remote");
account = (AccountRemote) ic.lookup("StatefulCode_1/AccountBean/remote");

//account = (AccountRemote)javax.rmi.PortableRemoteObject.narr ow(obj,AccountBean.class);

System.out.println("JSP INIT After lookup=============");
//System.out.println("JSP INIT After lookup test============="+obj.getClass().getName());
System.out.println("Loaded Account Bean");

} catch (Exception ex) {
ex.printStackTrace();
}

When I run the application, I am facing

java.lang.ClassCastException: $Proxy72
ERROR [STDERR] at org.apache.jsp.ejb3.WebClient_jsp.jspInit(WebClien t_jsp.java:28)
ERROR [STDERR] at org.apache.jasper.runtime.HttpJspBase.init(HttpJsp Base.java:51)
ERROR [STDERR] at org.apache.jasper.servlet.JspServletWrapper.getSer vlet(JspServletWrapper.java:158)


In JBoss, in Global JNDI Namespace it is showing

+- StatefulCode_1 (class: org.jnp.interfaces.NamingContext)
| +- AccountBean (class: org.jnp.interfaces.NamingContext)
| | +- remote (class: java.lang.Object)
| | +- remoteStatefulProxyFactory (proxy: $Proxy73 implements interface org.jboss.ejb3.ProxyFactory)

I was not able to solve. Can anyone suggest what can be the possible remedy for this ?
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-09-2008, 12:25 PM
Member
 
Join Date: May 2008
Posts: 2
mohiit is on a distinguished road
Please reply of the above question
hi,

Any one can give the answer of above question?
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 05-11-2008, 03:44 AM
danielstoner's Avatar
Senior Member
 
Join Date: Apr 2008
Location: Canada
Posts: 117
danielstoner is on a distinguished road
You have to structure your question in such a way people are able to respond without a huge effort. Put the code between code marks so it is displayed properly. Explain what you want to do. Explain how it fails. Give all the details. Provide compilable code not only a random piece. Doing things this way will improve your chances to get an answer and also maybe to find the answer yourself.

By the way you have lots of commented lines there. Why? Also you have a smilie in an URL.
__________________
Daniel @ [www.littletutorials.com]
Language is froth on the surface of thought
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Invoking a Stateful Session Bean as Stateless JThangiah Enterprise JavaBeans 0 04-14-2008 10:48 PM
Launching an application from another application dynamically Java Tip Java Tips 0 02-16-2008 10:31 PM
Stateful Session Bean Java Tip Java Tips 0 11-29-2007 01:39 PM
Calling a Stateful Session bean in NetBeans JavaForums NetBeans 0 07-31-2007 10:21 AM
Introduction to Stateful Session Bean In NetBeans JavaForums NetBeans 0 07-31-2007 10:21 AM


All times are GMT +3. The time now is 11:24 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org