Hello all, I'm having problems with creating home. Resin Professional
gives me a HessianProtocolException or InstantiationExceptions when I try
to create home. This applies to at least the three latest versions of
Resin: .14, .13 and a snapshot dated to 10th October.
I'm able to deploy this bean on a WLS 8.1 sp3 installation and even use
its methods on my struts app. All I did to port my app was new deployment
descriptor I wrote as well and some small modifications I did to web.xml
in addition to a change of the base class of my session bean that required
to get the code to compile against WebLogic.
In addition to deploying my app to another application server, I've
debugged my code a lot with different IDEs like MyEclipse, JCreator,
IntelliJ IDEA and JSWAT. Actually that's how I'm able to pinpoint the
problematic function call.
I've also tried different runtimes like Sun and JRockit, but I noticed
that the one Sun provides, functions slightly faster than the one shipped
with WLS.
I've also tried many different methods in retrieving the home, but all of
them have failed. Actually I've tried all options Resin supports to my
knowledge: JNDI over Hessian, JNDI over Burlap and native Hessian and
native Burlap.
This all confuses me a lot, because my code is much like the stateless
session bean example app Hello that works OKNP.
This is what the problematic function call looks like:
try {
Context c = (Context)new InitialContext().lookup("java:comp/env/ejb");
this.mailboxHome = (MailboxHome)c.lookup("mailbox");
^
The problem is here. [1]
}
catch(NamingException e) {
throw new ServletException("java:comp/env/ejb",e);
}
[1] Resin gives me a stacktrace like this:
500 Servlet Exception
com.caucho.hessian.io.HessianProtocolException: unknown code:O
com.caucho.hessian.io.HessianProtocolException: unknown code:O
at com.caucho.hessian.io.HessianInput.error(HessianInput.java:1642) at
com.caucho.hessian.io.HessianInput.readObject(HessianInput.java:1143) at
com.caucho.hessian.io.HessianInput.readObject(HessianInput.java) at
com.caucho.hessian.io.HessianInput.readReply(HessianInput.java:285) at
com.caucho.ejb.hessian.MetaStub.call(MetaStub.java:93)
at com.caucho.ejb.hessian.MetaStub.call(MetaStub.java:57)
at
com.caucho.ejb.hessian.HessianClientContainer.getRemoteClassName(HessianClientContainer.java:323)
at
com.caucho.ejb.hessian.HessianClientContainer.getRemoteClass(HessianClientContainer.java:289)
at
com.caucho.ejb.hessian.HessianClientContainer.getRemoteStubClass(HessianClientContainer.java:210)
at
com.caucho.ejb.hessian.HessianClientContainer.<init>(HessianClientContainer.java:83)
at
com.caucho.ejb.hessian.HessianClientContainer.find(HessianClientContainer.java:98)
at com.caucho.ejb.hessian.HessianModel.lookup(HessianModel.java:131) at
com.caucho.naming.ContextImpl.lookupImpl(ContextImpl.java:200)
at com.caucho.naming.ContextImpl.lookup(ContextImpl.java:167)
at fi.nuubia.mailbox.bld.MailboxBLD.open(MailboxBLD.java:85)
at
fi.nuubia.mailbox.bld.MailboxBLD.getMailboxesByName(MailboxBLD.java:183)
at
fi.nuubia.mailbox.ui.action.MailboxAction.performList(MailboxAction.java:135)
at
fi.nuubia.mailbox.ui.action.MailboxAction.execute(MailboxAction.java:72)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:115)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:92)
at
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:99)
at
com.caucho.server.security.SecurityFilterChain.doFilter(SecurityFilterChain.java:135)
at
com.caucho.server.cache.CacheFilterChain.doFilter(CacheFilterChain.java:209)
at
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:163)
at
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:208)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:259)
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:363) at
com.caucho.util.ThreadPool.runTasks(ThreadPool.java:490)
at com.caucho.util.ThreadPool.run(ThreadPool.java:423)
at java.lang.Thread.run(Thread.java:534)
or a stacktrace like this:
java.io.IOException: java.lang.InstantiationException:
fi.nuubia.mailbox.interfaces.MailboxFacade
at
com.caucho.hessian.io.JavaDeserializer.readMap(JavaDeserializer.java:114)
at
com.caucho.hessian.io.AbstractMapDeserializer.readObject(AbstractMapDeserializer.java:81)
at com.caucho.hessian.io.HessianInput.readObject(HessianInput.java) at
com.caucho.hessian.io.HessianInput.readReply(HessianInput.java:285) at
com.caucho.hessian.client.HessianProxy.invoke(HessianProxy.java) at
$Proxy0.create(Unknown Source)
at fi.nuubia.mailbox.bld.MailboxBLD.open(MailboxBLD.java:76)
at
fi.nuubia.mailbox.bld.MailboxBLD.getMailboxesByName(MailboxBLD.java:132)
at
fi.nuubia.mailbox.ui.action.MailboxAction.performList(MailboxAction.java:141)
at
fi.nuubia.mailbox.ui.action.MailboxAction.execute(MailboxAction.java:78)
at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414) at
javax.servlet.http.HttpServlet.service(HttpServlet.java:115)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:92)
at
com.caucho.server.dispatch.ServletFilterChain.doFilter(ServletFilterChain.java:99)
at
com.caucho.server.security.SecurityFilterChain.doFilter(SecurityFilterChain.java:135)
at
com.caucho.server.cache.CacheFilterChain.doFilter(CacheFilterChain.java:209)
at
com.caucho.server.webapp.WebAppFilterChain.doFilter(WebAppFilterChain.java:163)
at
com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:208)
at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:259)
at com.caucho.server.port.TcpConnection.run(TcpConnection.java:363) at
com.caucho.util.ThreadPool.runTasks(ThreadPool.java:490)
at com.caucho.util.ThreadPool.run(ThreadPool.java:423)
at java.lang.Thread.run(Thread.java:534)
And here comes my mailbox.ejb:
<ejb-jar>
<enterprise-beans>
<session>
<ejb-name>mailbox</ejb-name>
<home>fi.nuubia.mailbox.interfaces.MailboxHome</home>
<remote>fi.nuubia.mailbox.interfaces.MailboxFacade</remote>
<ejb-class>fi.nuubia.mailbox.ejb.session.MailboxBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Bean</transaction-type>
</session>
</enterprise-beans>
</ejb-jar
There's only struts and velocity related entries in web.xml so I do not
include the file here. I can post it later if needed.
And here's my resin-web.xml:
<web-app xmlns="http://caucho.com/ns/resin">
<ejb-server config-directory="WEB-INF"/>
<servlet servlet-name='hessian'
servlet-class='com.caucho.hessian.EJBServlet'/>
<servlet-mapping url-pattern='/hessian/*' servlet-name='hessian'/>
<allow-servlet-el/>
<jndi-link jndi-name="java:comp/env/ejb"
factory="com.caucho.hessian.HessianContextFactory">
<init-param
java.naming.provider.url='http://localhost:8080/hallinta/hessian'/>
</jndi-link>
<database>
<jndi-name>jdbc/mhms</jndi-name>
<driver>
<type>org.postgresql.Driver</type>
<url>jdbc:postgresql://127.0.0.1/mydb</url>
<user>myuser</user>
<password>mypasswd</password>
</driver>
</database>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>MHMS-verkkotunnusten
hallintajÀrjestelmÀ</realm-name>
<form-login-config>
<form-login-page>/index.html</form-login-page>
<form-error-page>/login_error.html</form-error-page>
<form-uri-priority>true</form-uri-priority>
</form-login-config>
</login-config>
<authenticator type="com.caucho.server.security.JdbcAuthenticator">
<init>
<data-source>jdbc/mhms</data-source>
<password-query>SELECT password FROM user_account
WHERE user_name=?</password-query>
<role-query>SELECT role FROM user_account WHERE
user_name=?</role-query>
</init>
</authenticator>
<log name='' level='finer' path='stdout:' timestamp="[%H:%M:%S.%s]"
rollover-period='1D'/>
</web-app>
I don't have source of MailboxHome, MailboxFacade or MailboxBean with me
now, but I can paste them later if needed.
MailboxHome class is basically the same as HelloHome in EJB stateless
Hello example:
<http://www.caucho.com/resin-3.0/viewfile/?contextpath=%2Fresin-3.0%2Fejb%2Ftutorial%2Fejb-stateless-hello&servletpath=%2Findex.xtp&file=WEB-INF%2Fclasses%2Fexample%2FHelloHome.java&re-marker=&re-start=&re-end=#code-highlight>.
MailboxFacade corresponds to Hello class in the same example:
<http://www.caucho.com/resin-3.0/viewfile/?contextpath=%2Fresin-3.0%2Fejb%2Ftutorial%2Fejb-stateless-hello&servletpath=%2Findex.xtp&file=WEB-INF%2Fclasses%2Fexample%2FHello.java&re-marker=&re-start=&re-end=#code-highlight>.
And MailboxBean is comparable to Hello examples HelloBean:
<http://www.caucho.com/resin-3.0/viewfile/?contextpath=%2Fresin-3.0%2Fejb%2Ftutorial%2Fejb-stateless-hello&servletpath=%2Findex.xtp&file=WEB-INF%2Fclasses%2Fexample%2FHelloBean.java&re-marker=&re-start=&re-end=#code-highlight>
with the exception that instead of returning a string, it returns a Vector
that contains TOs
Any suggestions or pointers how to fix this?
Regards, Tero
-- Tero RipattilaReceived on Wed 26 Oct 2005 03:56:56 -0700
This archive was generated by hypermail 2.1.8 : Thu Sep 28 2006 - 20:16:41 PDT