Problem while deploying a stateless Session bean
hi,
I am a beginner in J2EE. Please help..
I have encountered an error while i am deploying a session bean in IBM Webspere App Servere
the eroor is
D:\Program Files\WebSphere\AppServer\deploytool\itp>ejbdeploy.bat c:\account\dep
loy\account.jar c:\account\deploy c:\account\deploy\account-ejb.jar
Starting workbench.
Creating the project.
Validating
Generating deployment code
Refreshing: /account.jar/ejbModule.
Building: /account.jar.
Invoking RMIC.
error: Invalid class file format in C:\account\deploy\account.jar(com/fl/ac/Acco
unt.class). The major.minor version '49.0' is too recent for this tool to under
stand.
error: Class com.fl.ac.Account not found in class com.fl.ac.EJSRemoteStatelessAc
countEJB_ca490e54.
error: Invalid class file format in C:\account\deploy\account.jar(com/fl/ac/Acco
untHome.class). The major.minor version '49.0' is too recent for this tool to u
nderstand.
error: Class com.fl.ac.AccountHome not found in class com.fl.ac.EJSRemoteStatele
ssAccountEJBHome_ca490e54.
4 errors
[*Error] An unexpected exception was thrown. Halting execution.
Shutting down workbench.
Error generating RMI code: RMIC Command returns RC = 1. The problems which stopp
ed RMIC are displayed, and have also been recorded in the .log file in c:\accoun
t\deploy\account-ejb._\.metadata.
RMIC command was:
-extdirs D:\Program Files\WebSphere\AppServer\java\jre\lib\core.jar;D:\Program F
iles\WebSphere\AppServer\java\jre\lib\graphics.jar;D:\Program Files\WebSphere\Ap
pServer\java\jre\lib\security.jar;D:\Program Files\WebSphere\AppServer\java\jre\
lib\server.jar;D:\Program Files\WebSphere\AppServer\java\jre\lib\xml.jar;D:\Prog
ram Files\WebSphere\AppServer\java\jre\lib\charsets.jar;D:\Program Files\WebSphe
re\AppServer\java\jre\lib\ext;D:\Program Files\WebSphere\AppServer\java\lib;D:\P
rogram Files\WebSphere\AppServer\classes;D:\Program Files\WebSphere\AppServer\li
b;D:\Program Files\WebSphere\AppServer\lib\ext;D:\Program Files\WebSphere\AppSer
ver\web\help;D:\Program Files\WebSphere\AppServer\deploytool\itp\plugins\com.ibm
.etools.ejbdeploy\runtime;D:\Program Files\ibm\WebSphere MQ\Java\lib; -classpath
c:\account\deploy\account-ejb._\account.jar\ejbModule;C:\account\deploy\account
.jar -iiop -always -keep -d c:\account\deploy\account-ejb._\account.jar\ejbModul
e -sourcepath c:\account\deploy\account-ejb._\account.jar\ejbModule com.fl.ac.EJ
SRemoteStatelessAccountEJBHome_ca490e54 com.fl.ac.EJSRemoteStatelessAccountEJB_c
a490e54
BEAN SOURCE CODE IS
------------------Remote Interface -------------------------------
package com.fl.ac;
import java.rmi.*;
import javax.ejb.*;
public interface Account extends EJBObject {
public double withdraw(double balance,double amount) throws RemoteException;
public double deposite(double balance,double amount) throws RemoteException;
------------------------ Home Interface -----------------------------------
package com.fl.ac;
import java.rmi.*;
import javax.ejb.*;
public interface AccountHome extends EJBHome {
public Account create() throws CreateException,RemoteException;
------------------------- Bean Class -----------------------------------------------
package com.fl.ac;
import java.rmi.*;
import javax.ejb.*;
public class AccountEJB implements SessionBean {
public void setSessionContext(SessionContext ctx) { }
public void unsetSessionContext() { }
public void ejbCreate() { }
public void ejbActivate() { }
public void ejbPassivate() { }
public void ejbRemove() { }
public double withdraw(double balance,double amount){
return (balance - amount);
public double deposite(double balance,double amount){
return (balance+amount);
------------------------------ ejb-jar.xml --------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar id="ejb-jar_ID">
<display-name>Account EJB</display-name>
<enterprise-beans>
<session>
<ejb-name>AccountEJB</ejb-name>
<home>com.fl.ac.AccountHome</home>
<remote>com.fl.ac.Account</remote>
<ejb-class>com.fl.ac.AccountEJB</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
</enterprise-beans>
</ejb-jar>
PLZ HELP ME......
francis
Hi Gauarv,
Did you not see my reply in the following post?
Re: 502 service temporarily unavailable
If I'm not mistaken, this is exactly the same question as you asked
there.
By the way, is there some reason you are still using OC4J version
1.0.2.2? Is there something stopping you from upgrading to the later
versions (9.0.2 and 9.0.3)?
Good Luck,
Avi.
Similar Messages
-
Problem while invoking a Stateless Session bean from another bean
Hi,
I have a peculiar problem while coding with Stateless Session beans. Maybe you guys can help me out over here. The scenario is as follows
There are 3 Stateless Session beans. Let Us say Bean A, B and C. There are three methods, method1, method2, and method3 inside A, B and C respectively.
From A.method1(), B.method2(), and C.method3() are being invoked sequentially. Each of these methods does some JDBC operation and then returns.
The problem is this, if C.method3() throws and exception, then I am unable to rollback the changes made by B.method2(). Those changes get "Committed" to the database.
All the 3 beans have Bean managed persistence property set. I am using WebSphere 6.1.
Any insight on why this is happening would be greatly appreciated.
Thanks In Advance
Amardeep VermaHi,
This is a matter of calling all three methods in the same transaction context. Most easy way of doing this is having a 4th session bean containing a method calling the other 3. Make sure that the Transaction Attributes are REQUIRED, which is the default.
If the calls a to different backends/databases, you need global transactions and therefor XA complient database and drivers.
HTH Robert -
Problem Deploying EJB3 Stateless session bean in Jboss4.0.3
Hi All,
I have developed an EJB 3 Stateless session bean and tried to deploy in JBoss 4.0.3 , But i get the following Exception.
javax.naming.NameNotFoundException: ejb not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
at org.jnp.server.NamingServer.lookup(NamingServer.java:249)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at org.apache.jsp.session_jsp._jspService(org.apache.jsp.session_jsp:69)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:157)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
I am sorry if the question is silly..... My Remote Interface will be one like this
import javax.ejb.Remote;
@Remote
public interface CityService {
public String getCity();
And My Bean Class will be
import javax.ejb.EJB;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.EntityTransaction;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;
@EJB
@Remote(CityService.class)
@Stateless(mappedName="ejb/CityService")
public class CityServiceBean implements CityService {
public String getCity(){
return "Chennai Metropolitan";
And the client which invokes the bean will be
InitialContext ctx = new InitialContext();
CityService c = (CityService)ctx.lookup("ejb/CityService");
System.out.println("Msg from Bean"+c.getCity());
please help me out of this issue....
Thanks in advanceford wrote:
If you deploy your application in a .ear, you also can use this:
You have to set a name to your EJBBean -> @Stateless(name = "XXX")
The client for remote interface -> cxt.lookup(Name_of_your_own_ear_without_extension + "/XXX/Remote");
The client for local interface -> cxt.lookup(Name_of_your_own_ear_without_extension + "/XXX/Local");the problem with this approach is that if you version your ears, the version numbers show up in the jndi names, and your client code will be hard coded to specific server versions. -
Prolem in deploying a stateless session bean
Hi all,
I am new to EJB programming... I am using EJB3.0.
1. In my EJB project I have a persistence.xml file which specifies a data source.
2. In the deploy dir of JBoss I have a '-DS' file.
3. in the bean itself I use the annotation @PersistenceContext(unit="unitname");
4 this unit name is the same as the unit name in the persistence.xml
However when I create the jar and deploy it - it gives an error
--- MBeans waiting for other MBeans ---
ObjectName: jboss.j2ee:jar=abc.jar,name=abcBean,service=EJB3
State: NOTYETINSTALLED
I Depend On:
persistence.units:unitName=first
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: persistence.units:unitName=first
State: NOTYETINSTALLED
Depends On Me:
jboss.j2ee:jar=abc.jar,name=abcBean,service=EJB3
Does anyone know what could be the problem? Any help would be greatly appreciated.
Thanks.i believe calling a remote entity bean from the same machine will not generate network traffic.
Anyway you can. take a look here:
http://developer.java.sun.com/developer/onlineTraining/J2EE/Intro2/session_bean/session.html#Local_Interfaces -
Not be able to obtain a transacted session within stateless session bean
I need some assistance on creating a transacted session. For some reason while within a stateless session bean, I am unable to create a transacted session even though I'm specifying to create the transacted queue session. Can anyone provide any assistance to me on this? It would be much appreciated.
Here is the code snippets involved with the problem:
Code snipet from ejb-jar.xml:
<session>
<display-name>Initial Request</display-name>
<ejb-name>InitialRequestBean</ejb-name>
<ejb-class>com.raytheon.rds.jms.InitialRequestBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
</session>
Code from stateless session bean:
static Logger logger;
private QueueConnectionFactory connectionFactory;
private SessionContext sc;
private Queue requestQueue;
public String processRequest(String msgBody)
logger.log(Level.INFO, "In processRequest(String).", msgBody);
QueueConnection con = null;
QueueSession session = null;
QueueSender sender = null;
TextMessage message = null;
String messageID = null;
QueueReceiver receiver = null;
TemporaryQueue replyQueue = null;
boolean transacted = false;
try
//Create the infrastructure (ie. The connection & the session)
logger.log(Level.FINE, "Creating connection");
con = connectionFactory.createQueueConnection();
logger.log(Level.FINE, "Creating session");
session = con.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
//Note: This line above was changed in all possible permutation and still didn't work such as using Session.SESSION_TRANSACTED
transacted = session.getTransacted();
logger.log(Level.FINE, "Is session transacted? : " + transacted);
//Note: This line above is constantly saying false
//Now first, setup the temporary reply queue and its listener
replyQueue = session.createTemporaryQueue();
logger.log(Level.FINE, "Creating receiver/consumer");
receiver = session.createReceiver(replyQueue);
con.start();
//Now create the requestor that will make the request message and put it on the request queue
logger.log(Level.FINE, "Creating Requestor/Producer");
sender = session.createSender(requestQueue);
//Now create the message and make sure that you put the "JMSReplyTo" property to the temporary response queue we just created
message = session.createTextMessage();
message.setJMSReplyTo(replyQueue);
logger.log(Level.FINE, "Created message: " + message.getJMSMessageID());
//Now add the actual info you want to send
message.setText(msgBody);
//Now send the message
logger.log(Level.INFO, "Sending message: " + message.getText());
sender.send(message);
//Now wait until we get a response
logger.log(Level.FINE, "Waiting for the response message");
Message responseMsg = receiver.receive(20000); //Toggle the "0" to specify timeout in millisectionds
//Process the message
logger.log(Level.FINE, "Processing the response message");
if(null != responseMsg)
logger.log(Level.FINE, "responseMsg is : " + responseMsg.toString());
messageID = processMessage(responseMsg);
logger.log(Level.FINE, "Response is : " + messageID);
//close the connection
logger.log(Level.FINE, "Stopping the connection");
con.stop();
catch (Throwable t)
// JMSException could be thrown
logger.log(Level.SEVERE, "Exception Thrown in sendRequest: ", t);
sc.setRollbackOnly();
finally
//Close the sender
if (sender != null)
try
logger.log(Level.FINE, "Closing the sender");
sender.close();
catch (JMSException e)
logger.log(Level.WARNING, "JMSException Thrown when trying to close the sender to the request queue: ", e);
else
logger.log(Level.FINE, "Sender is already closed.");
//Close the receiver
if (receiver != null)
try
logger.log(Level.FINE, "Closing the receiver");
receiver.close();
catch (JMSException e)
logger.log(Level.WARNING, "JMSException Thrown when trying to close the receiver to the request queue: ", e);
else
logger.log(Level.FINE, "Receiver is already closed.");
//Close the session
if (session != null)
try
logger.log(Level.FINE, "Closing the session");
session.close();
catch (JMSException e)
logger.log(Level.WARNING, "JMSException Thrown when trying to close the session to the request queue: ", e);
else
logger.log(Level.FINE, "Session is already closed.");
//Close the connection
if (con != null)
try
logger.log(Level.FINE, "Closing the connection");
con.close();
catch (JMSException e)
logger.log(Level.WARNING, "JMSException Thrown when trying to close the connection to the reply queue: ", e);
else
logger.log(Level.FINE, "Connection is already closed.");
return messageID;
}I found the answer through lots of painful searching.
http://blogs.sun.com/fkieviet/entry/request_reply_from_an_ejb
This weblog from Frank Kieviet from a sun blog explains what's happening behind the scenes.
Then I proceeded to create a Bean-Managed Transaction out of my EJB, which is using EJB 3.0. This requires the tag:
@TransactionManagement(value= TransactionManagementType.BEAN)
Note: I got this information from http://download.oracle.com/docs/cd/B31017_01/web.1013/b28221/servtran001.htm#BAJIBAFF
Then I just added the code specified in Frank's blog and everything is working now. The main portion of the code looks like this now:
//begin the user transaction
ctx.getUserTransaction().begin();
//Create the infrastructure (ie. The connection & the session)
logger.log(Level.FINE, "Creating connection");
con = connectionFactory.createQueueConnection();
//Create the session
logger.log(Level.FINE, "Creating session");
session = con.createQueueSession(false, Session.SESSION_TRANSACTED);
transacted = session.getTransacted();
logger.log(Level.FINE, "Is session transacted? : " + transacted);
//Now create the sender that will make the request message and put it on the request queue
logger.log(Level.FINE, "Creating Sender");
sender = session.createSender(requestQueue);
//Now create the message
message = session.createTextMessage();
//Now add the actual info you want to send
message.setText(msgBody);
logger.log(Level.FINE, "Created message: " + message.getJMSMessageID());
//Now first, setup the temporary reply queue and its listener
replyQueue = session.createTemporaryQueue();
if(null != replyQueue)
logger.log(Level.FINE, "Created temporary queue: " + replyQueue.getQueueName());
else
logger.log(Level.FINE, "Temporary Queue could not be created.");
//make sure that you put the "JMSReplyTo" property to the temporary response queue we just created
message.setJMSReplyTo(replyQueue);
//Now send the message
logger.log(Level.INFO, "Sending message: " + message.getText());
sender.send(message);
//Now start the connection
logger.log(Level.FINE, "Starting the connection");
con.start();
//commit the changes
ctx.getUserTransaction().commit();
ctx.getUserTransaction().begin();
//Create the receiver
logger.log(Level.FINE, "Creating Receiver");
receiver = session.createReceiver(replyQueue);
//Now wait until we get a response
logger.log(Level.FINE, "Waiting for the response message");
Message responseMsg = receiver.receive(20000); //Toggle the "0" to specify timeout in millisectionds
//Process the message
logger.log(Level.FINE, "Processing the response message");
if(null != responseMsg)
logger.log(Level.FINE, "responseMsg is : " + responseMsg.toString());
else
logger.log(Level.FINE, "No response came back.");
messageID = processMessage(responseMsg);
logger.log(Level.FINE, "Response is : " + messageID);
logger.log(Level.FINE, "Transaction is complete");
//commit the changes
ctx.getUserTransaction().commit(); -
Hello,
we're using iAS SP3.
We deployed a stateless session bean that has a business methods with a Vector as argument (put (vector, String)).
If we call it from a servlet, it works fine. But when we try to call it from a thread, started in a standalone java client program, we obtain a java.rmi.MarshalException.
We tried to use Vector and HashSet objects as arguments, but we always obtain this kind of exception. It seems strange because a similar
method that returns a Collection of objects (getAll) works fine. This is the our bean Remote Interface:
public interface Receive extends EJBObject {
public void putMessage(Message message, java.lang.String la) throws RemoteException; // it works fine!!!
public void putMessages(java.util.Vector messages, java.lang.String la) throws RemoteException; // it doesn't work!!!
Collection getAll (java.lang.String la) throws RemoteException, EJBException; // it works fine!!!!
This is the java client stack trace:
java.rmi.MarshalException: CORBA MARSHAL 0 No; nested exception is:
org.omg.CORBA.MARSHAL: minor code: 0 completed: No
org.omg.CORBA.MARSHAL: minor code: 0 completed: No
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Class.java:241)
at com.sun.corba.ee.internal.iiop.ReplyMessage.getSystemException(ReplyMessage.java:93)
at com.sun.corba.ee.internal.iiop.ClientResponseImpl.getSystemException(ClientResponseImpl.java:82)
at com.sun.corba.ee.internal.corba.ClientDelegate.invoke(ClientDelegate.java:199)
at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:248)
at ejb._Receive_Stub.putMessages(_Receive_Stub.java:731)
at commlayer.Receiver.run(Receiver.java:67)
Does anyone know how to solve this problem?
Thank you in advance,
MaurizioThis is big bug!
This seems to occur when you try to return complex objects (e.g. a vector of classes or even the Date class).
As a workaround you can add this Ejb or module to the iPlanet Classpath (NT via kregedit, Sun via iasenv skript.).
This helps but i really don't know why.
It should be fixed in 6.5, maybe. We'll see.
Regards -
Error during deployment of stateless session EJB using EJB 3.0
having trouble deploying a stateless session bean to app server 10.1.3.1 oc4j container.
deceided to go through oracles demo: How-To Develop a Stateless Session EJB using EJB 3.0 (http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-ejb30-stateless-ejb/doc/how-to-ejb30-stateless-ejb.html).
the demo encounters the same issue. so i assume there is something wrong with the app server set up, and not my source code.
here is the deployment log:
[Jul 1, 2009 11:59:25 AM] Application Deployer for test_ws STARTS.
[Jul 1, 2009 11:59:25 AM] Copy the archive to C:\product\10.1.3.1\OracleAS_1\j2ee\home\applications\test_ws.ear
[Jul 1, 2009 11:59:25 AM] Initialize C:\product\10.1.3.1\OracleAS_1\j2ee\home\applications\test_ws.ear begins...
[Jul 1, 2009 11:59:25 AM] Unpacking test_ws.ear
[Jul 1, 2009 11:59:25 AM] Done unpacking test_ws.ear
[Jul 1, 2009 11:59:25 AM] Initialize C:\product\10.1.3.1\OracleAS_1\j2ee\home\applications\test_ws.ear ends...
[Jul 1, 2009 11:59:25 AM] Starting application : test_ws
[Jul 1, 2009 11:59:25 AM] Initializing ClassLoader(s)
[Jul 1, 2009 11:59:25 AM] Initializing EJB container
[Jul 1, 2009 11:59:25 AM] Loading connector(s)
[Jul 1, 2009 11:59:26 AM] Starting up resource adapters
[Jul 1, 2009 11:59:26 AM] Processing EJB module: ejb30ws-ejb.jar
[Jul 1, 2009 11:59:26 AM] application : test_ws is in failed state
[Jul 1, 2009 11:59:26 AM] Operation failed with error: java.lang.NoClassDefFoundError
the opmn log reveals the same error, but no more detail.
any ideas???
/stuckI am having exactly the same issue. Was this issue resolved? If so, please share the resolution and if not can someone please suggest what could be wrong.
Thanks -
Hot delpoyment with TopLink and Stateless Session Beans
What is the recommended procedure for making hot deployment of Stateless session beans work with toplink in WLS 7.0sp1 and oc4j (9.0.3)
My current setup is as follows using WLS 7.0sp1:
A stateless session bean is accessing toplink enabled persistent java classes via the SessionManager. I'm currently using the class loader of the stateless session bean:
* Method in stateless session bean
* Return the TopLink Session (based on the wls stateless session bean demo)
public Server getSession() {
return (Server)SessionManager.getManager().getSession("ejb_sessionbean", this.getClass().getClassLoader());
Everything is working as such. My session bean can read and write the persistent java classes. However if I redeploy the stateless session bean jar file the toplink session is not reinitalized. This means that new settings in the session.xml are not used. I addition I get other errors.
I'm having toplink on the server classpath. The toplink enabled persistent classes are in the stateless session bean jar file.
Thanks
HenrikWhat is the recommended procedure for making hot deployment of Stateless session beans work with toplink in WLS 7.0sp1 and oc4j (9.0.3)
Everything is working as such. My session bean can read and write the persistent java classes. However if I redeploy the stateless session bean jar file the toplink session is not reinitalized. This means that new settings in the session.xml are not used. I addition I get other errors.
I'm having toplink on the server classpath. The toplink enabled persistent classes are in the stateless session bean jar file.Henrik,
This is a recent post note I found on the same topic:
It all hinges on whether the TopLink ServerSession class has
been loaded by a classloader which is actually thrown away
during the hot deployment process. If this is the case, then
hot deployment causes the ServerSession to go out of scope
and finalize methods take care of logging it out properly.
If you deploy your TopLink Project on the Sytem class path then
it definately won't work. You'd have to restart the server every time.
But if the TopLink Project is deployed inside of an .ear file
and if you pass the correct ClassLoader to the
SessionManager.getSession( .... ) call then TopLink Session will
be re-started when you hot deploy the .earBased on this, the solution might be to deploy your EJBs in an ear file. Everything else looks OK. Can you try this and let us know?
Thanks,
Pete Farkas -
Problem while calling stateless session bean method with large data
In websphere, i am trying to call a stateless session bean's remote interface method with 336kb data as its parameter. It is taking almost 44 seconds to start executing the method in the bean. Can anyone tell me what could be the problem? Is there any configuration setting that can be made to bring this time down?
Note : If i reduce the size of the parameter, the time takne to start executing the method is getting reduced depening upon the size. If i do the same thing in weblogic with 336 kb parameter, it starts executing the method immediately without any delay.
Thanks in Advance
Regards
Harish Kumarhallo,
what about your internet dialer?
can you use it to enter via pppoe (DSL,ADSL,ATM)?
can you send me the .exe?
i will test it.
if i se it work i will buy it from you if you want.
best regards
devlooker
please write me to:
[email protected] -
Odd marshalling problems with EJB 3.0 stateless session bean
Hello,
I began encountering marshalling exceptions when invoking methods on a previously functionining facade bean. The problem seems to be almost arbitrary, in that certain packages receive marshalling exceptions, while others do not (my main client started failing, but then I realized that a simple test class was still working, along with oddly JSFs that invoke that main client, which fails outside of that scope). Is there some config issue with stateless session beans (in 3.0) that I might be missing? There are no duplicate versions of these class; they have not been modified; they've been compiled with the current IDE. Any help would be appreciated. Thanks.
full stack trace:
com.evermind.reflect.UndeclaredExceptionTypeException: oracle.oc4j.rmi.OracleRemoteException
at __Proxy1.findAllViewRight(Unknown Source)
at com.jwt.gui.menus.beans.ViewRightBean.<init>(ViewRightBean.java:34)
at com.jwt.gui.menus.beans.ViewRightBean.main(ViewRightBean.java:63)
oracle.oc4j.rmi.OracleRemoteException: Invocation error: java.rmi.UnmarshalException: Error deserializing return-value: java.io.InvalidClassException: com.jwt.gui.menus.persistence.ViewRight; local class incompatible: stream classdesc serialVersionUID = 2365320765203750319, local class serialVersionUID = -8750611773395720631
at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:142)
at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:472)
at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:416)
at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
at com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(StatelessSessionRemoteInvocationHandler.java:43)
at __Proxy1.findAllViewRight(Unknown Source)
at com.jwt.gui.menus.beans.ViewRightBean.<init>(ViewRightBean.java:34)
at com.jwt.gui.menus.beans.ViewRightBean.main(ViewRightBean.java:63)
Nested exception is:
java.rmi.UnmarshalException: Error deserializing return-value: java.io.InvalidClassException: com.jwt.gui.menus.persistence.ViewRight; local class incompatible: stream classdesc serialVersionUID = 2365320765203750319, local class serialVersionUID = -8750611773395720631
at com.evermind.server.rmi.RMICall.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(RMICall.java:109)
at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:128)
at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:472)
at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:416)
at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
at com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(StatelessSessionRemoteInvocationHandler.java:43)
at __Proxy1.findAllViewRight(Unknown Source)
at com.jwt.gui.menus.beans.ViewRightBean.<init>(ViewRightBean.java:34)
at com.jwt.gui.menus.beans.ViewRightBean.main(ViewRightBean.java:63)
oracle.oc4j.rmi.OracleRemoteException: Invocation error: java.rmi.UnmarshalException: Error deserializing return-value: java.io.InvalidClassException: com.jwt.gui.menus.persistence.ViewRight; local class incompatible: stream classdesc serialVersionUID = 2365320765203750319, local class serialVersionUID = -8750611773395720631
at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:142)
at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:472)
at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:416)
at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
at com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(StatelessSessionRemoteInvocationHandler.java:43)
at __Proxy1.findAllViewRight(Unknown Source)
at com.jwt.gui.menus.beans.ViewRightBean.<init>(ViewRightBean.java:34)
at com.jwt.gui.menus.beans.ViewRightBean.main(ViewRightBean.java:63)
Nested exception is:
java.rmi.UnmarshalException: Error deserializing return-value: java.io.InvalidClassException: com.jwt.gui.menus.persistence.ViewRight; local class incompatible: stream classdesc serialVersionUID = 2365320765203750319, local class serialVersionUID = -8750611773395720631
at com.evermind.server.rmi.RMICall.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(RMICall.java:109)
at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:128)
at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:472)
at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:416)
at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
at com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(StatelessSessionRemoteInvocationHandler.java:43)
at __Proxy1.findAllViewRight(Unknown Source)
at com.jwt.gui.menus.beans.ViewRightBean.<init>(ViewRightBean.java:34)
at com.jwt.gui.menus.beans.ViewRightBean.main(ViewRightBean.java:63)Hello,
I began encountering marshalling exceptions when invoking methods on a previously functionining facade bean. The problem seems to be almost arbitrary, in that certain packages receive marshalling exceptions, while others do not (my main client started failing, but then I realized that a simple test class was still working, along with oddly JSFs that invoke that main client, which fails outside of that scope). Is there some config issue with stateless session beans (in 3.0) that I might be missing? There are no duplicate versions of these class; they have not been modified; they've been compiled with the current IDE. Any help would be appreciated. Thanks.
full stack trace:
com.evermind.reflect.UndeclaredExceptionTypeException: oracle.oc4j.rmi.OracleRemoteException
at __Proxy1.findAllViewRight(Unknown Source)
at com.jwt.gui.menus.beans.ViewRightBean.<init>(ViewRightBean.java:34)
at com.jwt.gui.menus.beans.ViewRightBean.main(ViewRightBean.java:63)
oracle.oc4j.rmi.OracleRemoteException: Invocation error: java.rmi.UnmarshalException: Error deserializing return-value: java.io.InvalidClassException: com.jwt.gui.menus.persistence.ViewRight; local class incompatible: stream classdesc serialVersionUID = 2365320765203750319, local class serialVersionUID = -8750611773395720631
at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:142)
at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:472)
at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:416)
at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
at com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(StatelessSessionRemoteInvocationHandler.java:43)
at __Proxy1.findAllViewRight(Unknown Source)
at com.jwt.gui.menus.beans.ViewRightBean.<init>(ViewRightBean.java:34)
at com.jwt.gui.menus.beans.ViewRightBean.main(ViewRightBean.java:63)
Nested exception is:
java.rmi.UnmarshalException: Error deserializing return-value: java.io.InvalidClassException: com.jwt.gui.menus.persistence.ViewRight; local class incompatible: stream classdesc serialVersionUID = 2365320765203750319, local class serialVersionUID = -8750611773395720631
at com.evermind.server.rmi.RMICall.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(RMICall.java:109)
at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:128)
at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:472)
at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:416)
at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
at com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(StatelessSessionRemoteInvocationHandler.java:43)
at __Proxy1.findAllViewRight(Unknown Source)
at com.jwt.gui.menus.beans.ViewRightBean.<init>(ViewRightBean.java:34)
at com.jwt.gui.menus.beans.ViewRightBean.main(ViewRightBean.java:63)
oracle.oc4j.rmi.OracleRemoteException: Invocation error: java.rmi.UnmarshalException: Error deserializing return-value: java.io.InvalidClassException: com.jwt.gui.menus.persistence.ViewRight; local class incompatible: stream classdesc serialVersionUID = 2365320765203750319, local class serialVersionUID = -8750611773395720631
at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:142)
at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:472)
at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:416)
at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
at com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(StatelessSessionRemoteInvocationHandler.java:43)
at __Proxy1.findAllViewRight(Unknown Source)
at com.jwt.gui.menus.beans.ViewRightBean.<init>(ViewRightBean.java:34)
at com.jwt.gui.menus.beans.ViewRightBean.main(ViewRightBean.java:63)
Nested exception is:
java.rmi.UnmarshalException: Error deserializing return-value: java.io.InvalidClassException: com.jwt.gui.menus.persistence.ViewRight; local class incompatible: stream classdesc serialVersionUID = 2365320765203750319, local class serialVersionUID = -8750611773395720631
at com.evermind.server.rmi.RMICall.EXCEPTION_ORIGINATES_FROM_THE_REMOTE_SERVER(RMICall.java:109)
at com.evermind.server.rmi.RMICall.throwRecordedException(RMICall.java:128)
at com.evermind.server.rmi.RMIClientConnection.obtainRemoteMethodResponse(RMIClientConnection.java:472)
at com.evermind.server.rmi.RMIClientConnection.invokeMethod(RMIClientConnection.java:416)
at com.evermind.server.rmi.RemoteInvocationHandler.invoke(RemoteInvocationHandler.java:63)
at com.evermind.server.rmi.RecoverableRemoteInvocationHandler.invoke(RecoverableRemoteInvocationHandler.java:28)
at com.evermind.server.ejb.StatelessSessionRemoteInvocationHandler.invoke(StatelessSessionRemoteInvocationHandler.java:43)
at __Proxy1.findAllViewRight(Unknown Source)
at com.jwt.gui.menus.beans.ViewRightBean.<init>(ViewRightBean.java:34)
at com.jwt.gui.menus.beans.ViewRightBean.main(ViewRightBean.java:63) -
Problem while deploying entity beans
Hi,
We are using JDeveloper 3.2.2 (NT) and 8.1.7 (NT) to deploy EJB's.
Now we are trying to deploy the entity bean to Oracle JVM. We are facing the following problem while deploying an entity bean .
"Persistence provider declared in the deployment descriptor is not supported
*** Errors occurred while deploying the EJB to 8i JVM ***
*** Deployment completed ***"
We would appreciate if anyone could help us to solve this error.
nullHi,
The error was coming because of the table structure. All the columns were composite keys. I alter the structured by removing composite keys and added a new column as primary key. Now it is getting deployed successfully.
Can anybody comment on such a behaviour of OC4J?
Regards,
Jinal Shah -
[04/Dec/2001 10:54:00:2] error: EBFP-marshal_internal: internal exception caught in kcp skeleton, ex
ception = java.lang.NullPointerException
[04/Dec/2001 10:54:00:2] error: Exception Stack Trace:
java.lang.NullPointerException
at java.util.Hashtable.get(Hashtable.java:321)
at com.netscape.server.ejb.SQLPersistenceManager.<init>(Unknown Source)
at com.netscape.server.ejb.SQLPersistenceManagerFactory.newInstance(Unknown Source)
at com.netscape.server.ejb.EntityDelegateManagerImpl.getPersistenceManager(Unknown Source)
at com.netscape.server.ejb.EntityDelegateManagerImpl.doPersistentFind(Unknown Source)
at com.netscape.server.ejb.EntityDelegateManagerImpl.find(Unknown Source)
at com.kivasoft.eb.EBHomeBase.findSingleByParms(Unknown Source)
at samples.test.ejb.Entity.ejb_home_samples_test_ejb_Entity_TestEntityBean.findByPrimaryKey(
ejb_home_samples_test_ejb_Entity_TestEntityBean.java:126)
at samples.test.ejb.Entity.ejb_kcp_skel_TestEntityHome.findByPrimaryKey__samples_test_ejb_En
tity_TestEntity__int(ejb_kcp_skel_TestEntityHome.java:266)
at com.kivasoft.ebfp.FPRequest.invokenative(Native Method)
at com.kivasoft.ebfp.FPRequest.invoke(Unknown Source)
at samples.test.ejb.Entity.ejb_kcp_stub_TestEntityHome.findByPrimaryKey(ejb_kcp_stub_TestEnt
ityHome.java:338)
at samples.test.ejb.Entity.ejb_stub_TestEntityHome.findByPrimaryKey(ejb_stub_TestEntityHome.
java:85)
at samples.test.ejb.TestEJB.getGreeting(TestEJB.java:51)Hi,
I think you are trying to test the Hello world EJB example shipped with the product. As a first
step I would recomend you to go through every line of the document on deploying this application,
since, I too have experienced many errors while trying to deploy the sample applications, but on
following the documentation, I subsequently overcame all the errors and have been working with the
applications. So please follow the steps in documentation and let me know, if you still encounter any
issues.
Regards
Raj
Sandhya S wrote:
I am facing a problem while deploying an Entity bean in iPlanet(sp3).I
have attached the exception thrown.Why has this exception occured?
[04/Dec/2001 10:54:00:2] error: EBFP-marshal_internal: internal
exception caught in kcp skeleton, ex
ception = java.lang.NullPointerException
[04/Dec/2001 10:54:00:2] error: Exception Stack Trace:
java.lang.NullPointerException
at java.util.Hashtable.get(Hashtable.java:321)
at
com.netscape.server.ejb.SQLPersistenceManager.<init>(Unknown Source)
at
com.netscape.server.ejb.SQLPersistenceManagerFactory.newInstance(Unknown
Source)
at
com.netscape.server.ejb.EntityDelegateManagerImpl.getPersistenceManager(Unknown
Source)
at
com.netscape.server.ejb.EntityDelegateManagerImpl.doPersistentFind(Unknown
Source)
at
com.netscape.server.ejb.EntityDelegateManagerImpl.find(Unknown Source)
at com.kivasoft.eb.EBHomeBase.findSingleByParms(Unknown
Source)
at
samples.test.ejb.Entity.ejb_home_samples_test_ejb_Entity_TestEntityBean.findByPrimaryKey(
ejb_home_samples_test_ejb_Entity_TestEntityBean.java:126)
at
samples.test.ejb.Entity.ejb_kcp_skel_TestEntityHome.findByPrimaryKey__samples_test_ejb_En
tity_TestEntity__int(ejb_kcp_skel_TestEntityHome.java:266)
at com.kivasoft.ebfp.FPRequest.invokenative(Native Method)
at com.kivasoft.ebfp.FPRequest.invoke(Unknown Source)
at
samples.test.ejb.Entity.ejb_kcp_stub_TestEntityHome.findByPrimaryKey(ejb_kcp_stub_TestEnt
ityHome.java:338)
at
samples.test.ejb.Entity.ejb_stub_TestEntityHome.findByPrimaryKey(ejb_stub_TestEntityHome.
java:85)
at samples.test.ejb.TestEJB.getGreeting(TestEJB.java:51)
Try our New Web Based Forum at http://softwareforum.sun.com
Includes Access to our Product Knowledge Base! -
Some methods not working in EJB 3.0 stateless session bean
Hi,
I am trying to build an application with EJB 3.0 stateless session bean in weblogic 10. In that during build (using ant 1.6) it showing error as one of the ejb-class should have anotataion as @stateless, @stateful or @messageDiven
But i have given it corrrectly.
When I comment some of the methods the same bean is working fine. While i have annoatated some of the methods with @transaction attribute annotataion.
So, should i write all those methods there any particular order or what.
Can anybody pls tell me, what can be the problem as weblogic.appc is giving such error?Hi,
I am trying to build an application with EJB 3.0 stateless session bean in weblogic 10. In that during build (using ant 1.6) it showing error as one of the ejb-class should have anotataion as @stateless, @stateful or @messageDiven
But i have given it corrrectly.
When I comment some of the methods the same bean is working fine. While i have annoatated some of the methods with @transaction attribute annotataion.
So, should i write all those methods there any particular order or what.
Can anybody pls tell me, what can be the problem as weblogic.appc is giving such error? -
WLS10 and Stateless Session Bean
I tried to create EJB3 application example.
1. Created Stateless Session Bean that implements Remote and Local interfaces:
Session Bean code:
package com.session;
import javax.ejb.Local;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;
@Stateless(mappedName="SessionBeanService")
@Remote(ISessionBeanRemote.class)
@Local(ISessionBeanLocal.class)
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class SessionBean implements ISessionBeanLocal,
ISessionBeanRemote
public String reply(){
return "MySessionBean - success !!!";
Remote Interface code :
package com.session;
public interface ISessionBeanRemote
public String reply();
Local Interface code:
package com.session;
public interface ISessionBeanLocal
public String reply();
application.xml:
<?xml version="1.0" encoding="UTF-8"?>
<application xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/application_5.xsd"
version="5">
<display-name>EJB3 Sample Application</display-name>
<module>
<ejb>beans.jar</ejb>
</module>
</application>
weblogic-application.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE weblogic-application PUBLIC
"-//BEA Systems, Inc.//DTD WebLogic Application 8.1.0//EN"
"http://www.bea.com/ns/weblogic/90/weblogic-application.xsd">
<weblogic-application>
<classloader-structure>
<module-ref>
<module-uri>beans.jar</module-uri>
</module-ref>
</classloader-structure>
</weblogic-application>
2. I packaged classes into EAR file and deployed to WLS10.
I didn't include any weblogic specific XML descriptors besides weblogic-application.jar.
My client code lookes as follows:
public void test(){
Context context = getMyServerContext();
// THIS JNDI NAME I SEE ON MY SERVER JNDI TREE
String jndiName = "sessionbeansbeans_jarSessionBean_ISessionBeanRemote";
Object obj;
obj = context.lookup(jndiName);
System.out.println(" obj class : " + obj.getClass().getName());
ISessionBeanRemote remote = (ISessionBeanRemote) PortableRemoteObject.narrow(
obj, ISessionBeanRemote.class );
String res = remote.reply();
System.out.println("res : "+res);
I get an Exception:
Exception occurred!
java.lang.ClassCastException: Cannot narrow remote object to com.session.ISessionBeanRemote
at weblogic.iiop.PortableRemoteObjectDelegateImpl.narrow(PortableRemoteObjectDelegateImpl.java:242)
at javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:137)
at ca.cgi.mvest.test.server.wms.GlFacadeTest.runTest(GlFacadeTest.java:91)
at ca.cgi.mvest.test.server.wms.GlFacadeTest.<init>(GlFacadeTest.java:53)
at ca.cgi.mvest.test.server.wms.GlFacadeTest.main(GlFacadeTest.java:151)
java.lang.ClassCastException: Cannot narrow remote object to com.session.ISessionBeanRemote
My server console have the following output:
Root cause of ServletException.java.lang.NoClassDefFoundError: com/session/SessionBean_7pp7ls_ISessionBeanRemot
eIntf
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:12
4)
at weblogic.utils.classloaders.GenericClassLoader.defineClass(GenericCla
ssLoader.java:338)
at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(Generic
ClassLoader.java:291)
Truncated. see log file for complete stacktrace
Server logs a problem already on the line when I do lookup
on JNDI name even before narrow();
It looks like my EAR was missing something. But server never complained during deployment.
May be someone can direct me to a real sample of Weblogic10-ejb3.0 application, since examples that come with WLS 10 intallation combersome and do not follow
docmentation.
Thanks in advance for any suggestion.Hello Freind
The main different b\w stateful and statless is that stateful maintain state of method conversation means it has record that which method call before this method
but in case of stateless conversation state does not saved second different we can say that create method in stateless having no parameter but statefull having parameter I think u can understand easily
With Best Regards
Rajesh Pandey
email :[email protected]
url :-- http://www.sixthquadrant.com
Mob :-- 9811903737
Delhi India -
How to get stateful and stateless session bean in second jsp
I create stateful session bean in the first jsp, then how can I get the stateful session bean in the second jsp? I find that somebody store the bean in HttpSession.
If I store the stateful session bean in HttpSession, then I can get it in the second jsp. My problem is that I can store the stateless session bean in HttpSession, and get it in the second jsp. Then, both stateful and stateless can maintain the state in the second jsp. What is the difference between stateful and stateless session bean in this case ?
I understand the definition of stateful and stateless session bean, but I'm confuse how to use session bean. Can anyone provide sample jsp to show difference of stateful and stateless? How the stateful session bean can maintain the state for the client?Greetings,
I create stateful session bean in the first jsp, then how can I get the stateful session bean in the
second jsp? I find that somebody store the bean in HttpSession.Which is the correct scope for sharing client-specific data when 'request' scope is insufficient.
If I store the stateful session bean in HttpSession, then I can get it in the second jsp. My problem is
that I can store the stateless session bean in HttpSession, and get it in the second jsp. Then, bothWhy is that a "problem"? Does your application not require the stateless bean to be shared? If so, then don't store the EJBObject reference in the session...
stateful and stateless can maintain the state in the second jsp. What is the difference betweenWhat do you mean by this exactly?..
stateful and stateless session bean in this case ?Statefulness of session beans is in regard to maintaining client state (er, in all cases). If your "stateless" bean is receiving information from the client (i.e. its caller) - either through a create method or a business method - and that information is available (retrievable from the bean) on subsequent method calls, then that bean is, in fact, stateful - regardless of how it is deployed.
I understand the definition of stateful and stateless session bean, but I'm confuse how to use
session bean.The correct question, it here seems, is "when" to use which type... Use a "stateful" bean when information about (from) the client (i.e. the caller) must be maintained across method calls of the bean. Use a "stateless" bean for general business methods that do not depend on "prior knowledge" of the client (i.e. the caller).
Can anyone provide sample jsp to show difference of stateful and stateless? How the statefulA "sample JSP" would yield nothing additional... The semantics of calling, using, and "persisting", bean references are always the same - regardless of type or class. However, the reason(s) for using one over the other depends entirely on the needs of your application.
session bean can maintain the state for the client?I recommend that you spend more time learning about EJBs generally. In particular, it seems you require more fundamental understanding of their scope and lifecycle. Refer to sections 4, 6, and 7 of the EJB 2.0 Specification.
Regards,
Tony "Vee Schade" Cook
Maybe you are looking for
-
A while ago i went to sync music onto my Ipod Touch. Not only did the computer erase my music i had no idea how to get it back I contacted Apple on the phone but the name was american and i found it really hard to understand him. How do i get it back
-
I recently installed CS3 as well as upgrading my PC by adding more ram for a total of 4 GB. Also, 80 Gb SATA II HD for scratch, a partition on my third internal drive (data storage) for windows page file. After all of this, my PC (XP Pro) ran noticea
-
Since yesterday evening (19-01-2015) safari won't start. After clicking the safari application it shows an error message: Safari can't use the extension "Omnibar" because the extension is no longer valid. This message almost directly disappears where
-
Launching External programs from an addon cause Client to stop
Hi. We have an add-on that allow via configuration to launch other programs/files from SAP (Remote desktop, PDF-documents, etc.). Launching other processes from an add-on is easy with the System.Diagnostics.Process.Start(file, arguments); This has wo
-
Hi, i have a class with tons of methods and attributes. How can i download this to a PC without having to C&P everything?