Results 1 to 3 of 3
Thread: EJB 3 Stateful Application
- 05-07-2008, 11:25 AM #1
Member
- Join Date
- May 2008
- Posts
- 3
- Rep Power
- 0
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.naming:org.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 ?
- 05-09-2008, 11:25 AM #2
Member
- Join Date
- May 2008
- Posts
- 3
- Rep Power
- 0
Please reply of the above question
hi,
Any one can give the answer of above question?
- 05-11-2008, 02:44 AM #3
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
Similar Threads
-
[SOLVED] Invoking a Stateful Session Bean as Stateless
By JThangiah in forum Enterprise JavaBeans (EJB)Replies: 3Last Post: 07-17-2008, 09:35 AM -
Launching an application from another application dynamically
By Java Tip in forum Java TipReplies: 0Last Post: 02-16-2008, 09:31 PM -
Stateful Session Bean
By Java Tip in forum Java TipReplies: 0Last Post: 11-29-2007, 12:39 PM -
Calling a Stateful Session bean in NetBeans
By JavaForums in forum NetBeansReplies: 0Last Post: 07-31-2007, 09:21 AM -
Introduction to Stateful Session Bean In NetBeans
By JavaForums in forum NetBeansReplies: 0Last Post: 07-31-2007, 09:21 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks