[JNDI/Naming/Network] - Re: PortableRemoteObject.narrow() returns null
by info@connext.co.za
Good Day,
Does anyone know how to fix this problem of the PortableRemoteObject.narrow() from returning null when using the Corba IIOP transport?
I have commented out the CorbaTransactionService mbean from the iiop-service.xml but still it does not work.
Hashtable<String, String> env = new Hashtable<String, String>();
env.put("java.naming.factory.initial", "com.sun.jndi.cosnaming.CNCtxFactory");
env.put(Context.PROVIDER_URL, "corbaloc::marka:3528/JBoss/Naming/root");
InitialContext context = new InitialContext(env);
Object ref = context.lookup("ejb/Test");
TestHome home = (TestHome) PortableRemoteObject.narrow(ref, TestHome.class);
System.out.println(home);
I am using 4.0.4 GA and the all server configuration.
12:29:07,446 INFO [EjbModule] Deploying Test
12:29:08,102 INFO [ejb/Test] EJBHome reference for ejb/Test:
IOR:000000000000003D524D493A636F6D2E6369626563732E6272732E746573742E696E74657266616365732E54657374486F6D653A30303030303030303030303030303030000000000000000200000000000000C0000102000000000E3139322E3136382E302E313235000DC80000001E4A426F73732F454A42486F6D652625656A622625546573742FACED0005700000000000050000000000000008000000004A414300000000010000001C00000000000100010000000105010001000101090000000105010001000000190000002B0000000000000023687474703A2F2F6D61726B613A383038332F576562434C5B656A622F546573745D2F00000000002000000004000000000000001F000000040000000300000001000000540000000000000003000000190000002B0000000000000023687474703A2F2F6D61726B613A383038332F576562434C5B656A622F546573745D2F00000000002000000004000000000000001F0000000400000003
12:29:08,133 INFO [ejb/Test] Home IOR for Test bound to iiop/ejb/Test in JNP naming service
12:29:08,321 INFO [ejb/Test] Home IOR for Test bound to ejb/Test in CORBA naming service
12:29:08,414 INFO [ProxyFactory] Bound EJB Home 'Test' to jndi 'ejb/Test'
12:29:08,414 INFO [EJBDeployer] Deployed: file:/D:/programs/jboss-4.0.4.GA/server/all/deploy/TestEJB.jar/
Not sure how to proceed.
As a side note, if anyone knows how to get Kerberos, GSS and CSIv2 working in the JBoss/IIOP.
Regards,
Mark P Ashworth
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3967440#3967440
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3967440
19 years, 8 months
[EJB 3.0] - Re: java.lang.ClassCastException
by tornadojava
"tornadojava" wrote : MyAccount.class
| package test.four;
|
| import java.io.Serializable;
|
| public interface MyAccount extends Serializable{
| public int add(int i,int j) throws Exception;
| public int getResult() throws Exception;
| }
| MyAccountBean.class
| package test.four;
| import javax.ejb.Local;
| import javax.ejb.Stateful;
|
| import org.jboss.annotation.ejb.LocalBinding;
|
|
| @SuppressWarnings("serial")
| @Stateful
| @Local({MyAccount.class})
| @LocalBinding(jndiBinding="test/MyAccountBean")
| public class MyAccountBean implements MyAccount {
| private int add_falg=0;
| private int total_flag=0;
| public int add(int i, int j) throws Exception {
| this.add_falg=i+j;
| this.total_flag+=this.add_falg;
| return this.add_falg;
| }
|
| public int getResult() throws Exception{
| return this.total_flag;
| }
|
| }
| jsp client
| <%@ page contentType="text/html; charset=iso"%>
| <%@ page import="test.four.MyAccount,javax.naming.*"%>
| <%
| Properties props = new Properties();
| props.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
| props.setProperty("java.naming.provider.url", "localhost:1099");
| props.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");
|
| InitialContext ctx = new InitialContext(props);
| try {
| MyAccount A = ctx.lookup("test/MyAccountBean");
| out.println("A.Add() Result is?"+ A.add(1,1));
| out.println("A.getResult() result is?"+ A.getResult());
| } catch (Exception e) {
| e.printStackTrace();
| out.println(e.getMessage());
| }
| %>
|
| code end
|
| when I visit website http://localhst:8080/test/four.jsp,java.lang.ClassCastException was threw.
| this exception detail:
| java.lang.ClassCastException: $Proxy157
| 17:33:13,447 ERROR [STDERR] at org.apache.jsp.four_jsp._jspService(four_jsp.java:69)
| 17:33:13,447 ERROR [STDERR] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
| 17:33:13,447 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| 17:33:13,447 ERROR [STDERR] at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
| 17:33:13,457 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
| 17:33:13,457 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
| 17:33:13,457 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| 17:33:13,457 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| 17:33:13,457 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| 17:33:13,457 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| 17:33:13,457 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| 17:33:13,457 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| 17:33:13,457 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| 17:33:13,457 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| 17:33:13,457 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| 17:33:13,457 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| 17:33:13,457 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| 17:33:13,457 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| 17:33:13,457 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| 17:33:13,457 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| 17:33:13,457 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| 17:33:13,457 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| 17:33:13,457 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| 17:33:13,457 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| 17:33:13,457 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
|
|
| pls help me
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3967435#3967435
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3967435
19 years, 8 months
[EJB 3.0] - java.lang.ClassCastException
by tornadojava
MyAccount.class
package test.four;
import java.io.Serializable;
public interface MyAccount extends Serializable{
public int add(int i,int j) throws Exception;
public int getResult() throws Exception;
}
MyAccountBean.class
package test.four;
import javax.ejb.Local;
import javax.ejb.Stateful;
import org.jboss.annotation.ejb.LocalBinding;
@SuppressWarnings("serial")
@Stateful
@Local({MyAccount.class})
@LocalBinding(jndiBinding="test/MyAccountBean")
public class MyAccountBean implements MyAccount {
private int add_falg=0;
private int total_flag=0;
public int add(int i, int j) throws Exception {
this.add_falg=i+j;
this.total_flag+=this.add_falg;
return this.add_falg;
}
public int getResult() throws Exception{
return this.total_flag;
}
}
jsp client
<%@ page contentType="text/html; charset=iso"%>
<%@ page import="test.four.MyAccount,javax.naming.*"%>
<%
Properties props = new Properties();
props.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
props.setProperty("java.naming.provider.url", "localhost:1099");
props.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming");
InitialContext ctx = new InitialContext(props);
try {
MyAccount A = ctx.lookup("MyAccountBean/local");
out.println("A.Add() Result is?"+ A.add(1,1));
out.println("A.getResult() result is?"+ A.getResult());
} catch (Exception e) {
e.printStackTrace();
out.println(e.getMessage());
}
%>
code end
when I visit website http://localhst:8080/test/four.jsp,java.lang.ClassCastException was threw.
this exception detail:
java.lang.ClassCastException: $Proxy157
17:33:13,447 ERROR [STDERR] at org.apache.jsp.four_jsp._jspService(four_jsp.java:69)
17:33:13,447 ERROR [STDERR] at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
17:33:13,447 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
17:33:13,447 ERROR [STDERR] at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:332)
17:33:13,457 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
17:33:13,457 ERROR [STDERR] at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
17:33:13,457 ERROR [STDERR] at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
17:33:13,457 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
17:33:13,457 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
17:33:13,457 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
17:33:13,457 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
17:33:13,457 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
17:33:13,457 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
17:33:13,457 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
17:33:13,457 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
17:33:13,457 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
17:33:13,457 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
17:33:13,457 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
17:33:13,457 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
17:33:13,457 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
17:33:13,457 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
17:33:13,457 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
17:33:13,457 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
17:33:13,457 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
17:33:13,457 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
pls help me
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3967434#3967434
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3967434
19 years, 8 months