Shawn Clark

Greenhorn
+ Follow
since Aug 03, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Shawn Clark

I had a similar problem with this on an Oracle OC4J instance connecting to Oracle databases. I ended up changing my JDBC driver class and it fixed the problem. I am guessing that you are trying to do something that your current JDBC driver can't handle properly so it is causing the VM to crash.
18 years ago
You need to pass them as parameters to the bean remote methods. A lot of this depends on how you are designing your servlets and beans. You could make it so that you have setter and getter methods in your bean or you can do it as one method that loads whatever values you want the bean to have.

The first step is creating an RMI connection between the servlet and bean. Once that is established you can run any remote methods on the bean as if the bean was a local object. One thing you have to remember is that any objects you pass between the servlet and bean will need to be serializable.

--
Shawn
18 years ago
Tried doing what you suggested and the same error occured. Here was the new modified code:



The log file had this in it:



and the error message was:



As you can see the log file shows that it made it to line 145 in the code but didn't make it to line 147 which is the final log message of the EJB object being retrieved properly. The stack trace shows that it errored on line 146 of the TOP.java when trying to do the getEJBObject().

So if I can't even get it back during the same request then what is happening? I am wondering if it might be something that is Oracle OC4J specific or if it is a J2EE problem.

Any other troubleshooting suggestions or assistance?

--
Shawn Clark
18 years ago
Hi Ranchers,

I have posted a topic in the Servlet forum about having problems retrieving an EJB reference / handle from a HttpSession. So far haven't been able to get any help so I thought I would see if anyone in this forum could help me. Here is a link to the original topic.

EJB Handle from HttpSession

--
Shawn Clark
18 years ago
Hi Ranchers,

I have posted a topic in the Servlet forum about having problems retrieving an EJB reference / handle from a HttpSession. So far haven't been able to get any help so I thought I would see if anyone in this forum could help me. Here is a link to the original topic.

EJB Handle from HttpSession

--
Shawn Clark
I was wondering that as well but I did try the code without the narrow as well. I originally had that line as:

synopsis = (SyNOPsisEJB) synopsisHandle.getEJBObject();

Both cases cause it to give the EJBHome error.

Any onther suggestions?
18 years ago
I have searched around and haven't found any good documented code on how to set and then retrieve EJB handles through the HttpSession. Most of the stuff I have read so far is more discussions between if people should be using HttpSession and when to use that compared to using a SFSB. We have already decided on the design of our application and we are going to be using the SFSB to store state for a user. This allows us the freedom from moving our view from a web page to some other application at any time without having to re-code all the session stuff that might have been stored in a HttpSession. So please don't start up another discussion on using HttpSession over SFSB and the like.

The problem I am having is in my servlet. I am able to store the handle to the EJBs remote reference in the HttpSession. I am then able to get that handle from the HttpSession on a subsequent call to the servlet. The error occurs when I am trying to do a synopsisHandle.getEJBObject() where synopsisHandle is a Handle that I got from the HttpSession. The error that I get is:



This error leads me to believe that somewhere in the Handle object there is a reference to a JNDI name of 'SyNOPsisEJB' which would be right but I am getting a reference to the 'SyNOPsisEJB' by first doing a RMI call to another machine. Here is the code that gets the initial SyNOPsisEJB remote reference:



The last line is where I set the EJB handle in the HttpSession. Now the code that retrieves the handle is as follows:



The line of "synopsis = (SyNOPsisEJB) javax.rmi.PortableRemoteObject.narrow(synopsisHandle.getEJBObject(), SyNOPsisEJB.class);" is line 131 in the TOP.java code that is being referenced by the error message.

What am I doing wrong? Should I still be needing to make a connection to the SyNOPsisEJBHome when trying to connect to the same SFSB? Any and all suggestions are welcome as I am at a loss right now.

--
Shawn Clark
18 years ago