Servlet calling EJB
I am having problem calling a session bean from servlet. I got the
following ClassCastException when try to 'narrow' the home interface
after lookup(). The same lines of code works in a standalone console
app, though.
java.lang.ClassCastException:
com.trinity.railcar.ejb.TripManagerEJBHomeImpl_ServiceStub
at
com.trinity.railcar.servlets.HelloWorldServlet.service(HelloWorldServlet.java:56)
at javax.servlet.http.HttpServlet.service(HttpServlet.java,
Compiled Code)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java,
Compi
led Code)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java,
Compiled Code)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java,
Compiled Code)
at
weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager
.java, Compiled Code)
at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java,
Compiled Co
de)
at
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java,
Compiled Code)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java,
Compiled Code)
where the code in line 56 is:
TripManagerHome trip_manager_home =
(TripManagerHome) PortableRemoteObject.narrow(home,
TripManagerHome.class);
Anybody has any suggestions?
thanks
Xiaodong
Remove home and remote interfaces from your WAR or web deployment.
Cameron Purdy, LiveWater
"Xiaodong Zhou" <[email protected]> wrote in message
news:[email protected]...
> I am having problem calling a session bean from servlet. I got the
> following ClassCastException when try to 'narrow' the home interface
> after lookup(). The same lines of code works in a standalone console
> app, though.
> -------------------
> java.lang.ClassCastException:
> com.trinity.railcar.ejb.TripManagerEJBHomeImpl_ServiceStub
> at
>
com.trinity.railcar.servlets.HelloWorldServlet.service(HelloWorldServlet.jav
a:56)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java,
> Compiled Code)
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
> Compi
> led Code)
> at
>
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
l.java,
>
> Compiled Code)
> at
>
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImp
l.java,
>
> Compiled Code)
> at
>
weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContext
Manager
>
> .java, Compiled Code)
> at
> weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java,
> Compiled Co
> de)
> at
> weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java,
> Compiled Code)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java,
> Compiled Code)
> --------
> where the code in line 56 is:
> TripManagerHome trip_manager_home =
> (TripManagerHome) PortableRemoteObject.narrow(home,
>
> TripManagerHome.class);
>
> Anybody has any suggestions?
>
> thanks
>
> Xiaodong
>
Similar Messages
-
How can I call EJB from JSP/Servlets in iWS?
Hi!!
My JSP/Servlets are on iWS, and I deploy EJB on iAS.
In this case, I don't know how JSP/Servlet call EJb on iAS.
I'd like to know how I can set JNDI name in JSP/Servlet on iWS.
I will thank you if you give me a simple example source using JSP/Servlet
and EJB.
Thanks in advance!!!
- Park-Park,
Why Are you running your JSP/Servlets in iWS instead of iAS? For whatever
reason,
look at the Converter sample from iAS. You will be doing RMI/IIOP in this
case and the sample explains in detail what to do.
hth,
-robert
"SungHyun, Park" <[email protected]> wrote in message
news:9jpfmt$[email protected]..
Hi!!
My JSP/Servlets are on iWS, and I deploy EJB on iAS.
In this case, I don't know how JSP/Servlet call EJb on iAS.
I'd like to know how I can set JNDI name in JSP/Servlet on iWS.
I will thank you if you give me a simple example source using JSP/Servlet
and EJB.
Thanks in advance!!!
- Park- -
Calling EJB with HTML via SERVLET
Hi,
I used a writen example that calls EJB from HTML via SERVLET. Example name is Bonus. The problem I have is that the HTML throw error while calling SERVLET. I dont figure out what seams to be a problem. Someone know?
I wonder if the problem is in servlet? The EJB is fine!
christian
HTML CODE:(bonus.html)
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1250"/>
<TITLE>untitled1</TITLE>
</HEAD>
<BODY BGCOLOR = "WHITE">
<BLOCKQUOTE>
<H3>Bonus Calculation</H3>
<FORM METHOD="GET" ACTION="BonusAlias">
<P>Enter social security Number:<P>
<INPUT TYPE="TEXT" NAME="SOCSEC"></INPUT>
</P>
Enter Multiplier:
<P>
<INPUT TYPE="TEXT" NAME="MULTIPLIER"></INPUT>
</P>
<INPUT TYPE="SUBMIT" VALUE="Submit">
<INPUT TYPE="RESET">
</FORM>
</BLOCKQUOTE>
</BODY>
</HTML>
SERVLET CODE:(BonusServlet.java)
package mypackage5;
import mypackage5.Calc;
import mypackage5.CalcHome;
import mypackage5.impl.CalcBean;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import javax.naming.*;
import javax.rmi.PortableRemoteObject;
import java.beans.*;
public class BonusServlet extends HttpServlet {
CalcHome homecalc;
public void init(ServletConfig config) throws ServletException{
//Look up home interface
try{
//InitialContext ctx = new InitialContext();
//Object objref = ctx.lookup("Calc");
//homecalc = (CalcHome)PortableRemoteObject.narrow(objref, CalcHome.class);
Context context = new InitialContext();
CalcHome calcHome = (CalcHome)PortableRemoteObject.narrow(context.lookup("Calc"), CalcHome.class);
Calc calc;
catch (Exception NamingException) {
NamingException.printStackTrace();
public void doGet (HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String socsec = null;
int multiplier = 0;
double calc = 0.0;
PrintWriter out;
response.setContentType("text/html");
String title = "EJB Example";
out = response.getWriter();
out.println("<HTML><HEAD><TITLE>");
out.println(title);
out.println("</TITLE></HEAD><BODY>");
try{
Calc theCalculation;
//Get Multiplier and Social Security Information
String strMult = request.getParameter("MULTIPLIER");
Integer integerMult = new Integer(strMult);
multiplier = integerMult.intValue();
socsec = request.getParameter("SOCSEC");
//Calculate bonus
double bonus = 100.00;
theCalculation = homecalc.create();
calc = theCalculation.calcBonus(multiplier, bonus);
catch (Exception CreateException){
CreateException.printStackTrace();
//Display Data
out.println("<H1>Bonus Calculation</H1>");
out.println("<P>Soc Sec: " + socsec + "<P>");
out.println("<P>Multiplier: " +
multiplier + "<P>");
out.println("<P>Bonus Amount: " + calc + "<P>");
out.println("</BODY></HTML>");
out.close();
public void destroy() {
System.out.println("Destroy");The error is that page cannot be found! When I run only the servlet it works, when I run the HTML page and enter the field throws eror that the page cannot be found!
thanks
Christian -
Error in calling EJB from servlet
I've create a servlet as a client bean to call EJB
I deploy the EJB, copy the servlet class (in .class format)
(\config\<domain>\serverclass) and
jsp to Weblogic 6.0
When I run the JSP, It said that the EJB class not found.
Please help
Fannie
Additional information :
I added the path where ejb jar file located to the calsspath in
startWebLogic.sh
Thanks!!
Fannie
Fannie <[email protected]> wrote in message
news:3ac84447$[email protected]..
> I've create a servlet as a client bean to call EJB
> I deploy the EJB, copy the servlet class (in .class format)
> (\config\<domain>\serverclass) and
> jsp to Weblogic 6.0
> When I run the JSP, It said that the EJB class not found.
>
> Please help
>
> Fannie
>
>
>
>
-
Calling EJB from Oracle via IIOP
I've spent the last two days trying to figure out how I can call an
EJB from an Oracle Stored Procedure. I first looked into WLS JNDI
(Using WLInitialContextFactory ), but my collegue recommended I look
into IIOP because it is "less proprietary". I was able to get a WL
example working that does a lookup on an EJB and "narrows" the IIOP
object...so it looked promissing, but then I tried to load the JAR
into Oracle and it said:
"referenced name javax/rmi/PortableRemoteObject could not be found"
So I did a quick check and it looks like this didn't come into
existance until JDK 1.3. By all accounts, Oracle 8.1.6 supports JDK 2
(1.2). So now I'm stuck. I've got a few examples about connecting to
the Oracle ORB using session-iiop, but I don't know if Weblogic will
be able to work with this. I don't know how I'd even call it because
the URL requires an Oracle SID...so now what? I see three options.
Please let me know which would be best (or another option that I'm
missing)
1. Try connecting with Weblogic "T3"
2. Try to get the right combination of classes loaded so 1.2 can work
like 1.3
3. Use the Oracle IIOP (I have no examples for connecting to other
ORBs so I have no idea how to lookup objects).
Chris[email protected] (Chris Snyder) writes:
Andy Piper <[email protected]> wrote in message news:<[email protected]>...
[email protected] (Chris Snyder) writes:
1. Try connecting with Weblogic "T3"It depends on what version of WLS you are using. If you are using 6.1
then you are out-of-luck because this only support JDK 1.3.1.We are using WLS 6.1 and Oracle 8.1.6. There's got to be a way to
connect what is essentially a 1.2 JVM to a 1.3.1 JVM. On my way home
yesterday I was wondering if just straight RMI would work...although
we need to encrypt the connection. I've seen several people talk
about calling EJB's from stored procedures so it seems like there is a
way. Any other ideas?The really gross way is HTTP. In a previous life I had a customer use
oracle's HTTP plug-in to do this. You could probably invert the
problem also. I.e. write CORBA objects that sit inside an Orb hosted
in WLS and invoke on those using oracle's CORBA support. But HTTP is
probably the way most likely to work. You probably couldn't use RMI
over HTTP either - you would have to write a servlet that delegated to
your beans.
andy -
EJBUtils.cloneObject(...) takes long time when calling EJB's
hi,
using OC4J 10.1.3 in windows XP.
I have a servlet that calls a local stateless EJB (UserManagerBean) (2.1 version) and the EJB calls a second local stateless EJB (UserPersistorBean). The last one does a JDBC query and the result is returned to the servlet. The servlet call takes about 19.5 seconds (in my PC) to execute. Using a profiler, I have detected that EJBUtils.cloneObject(...) is called two times (one for each EJB) and it takes about 18 seconds (every time the servlet call is done, not only the first time !). The JDBC calls it only takes 1.171 seconds.
here is the trace call showed in the profiler: (time is breaked down in each call)
-servlet call time to execute= 19.500
--UserManager_StatelessSessionBeanWrapper18.searchAll(Query) time to execute= 19.500
----com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(MethodState, Object[], ThreadState) time to execute= 10.750
------com.nte.anthema.security.UserManagerBean.searchAll(Query) time to execute= 10.750
--------UserPersistor_StatelessSessionBeanWrapper16.searchAll(Query) time to execute= 10.750
----------com.evermind.server.ejb.EJBUtils.cloneObject(Object, AbstractEJBHome) time to execute= 9.578 (related with UserPersistorBean)
----------com.evermind.server.ejb.StatelessSessionEJBObject.OC4J_invokeMethod(MethodState, Object[], ThreadState) time to execute= 1.171
-------------com.nte.anthema.security.persistence.UserPersistorBean.searchAll(Query) time to execute= 1.171
----com.evermind.server.ejb.EJBUtils.cloneObject(Object, AbstractEJBHome) time to execute= 8.750 (related with UserManagerBean)
Any idea why EJBUtils.cloneObject is executed every time these EJB are called ? I have other EJB's and EJBUtils.cloneObject(...) is not executed when that EJB's aree called.
Any help ?
Thanks !
pep.It's loading the code insight. Since you have such a large number of objects you may want to turn this off.
sqldeveloper -J-Dsdev.insight=false
-kris -
Servlet and EJB on different machine: Security propagation
Hi all,
I have an application, where my servlets and EJBS are deployed on the same machine.So
when in my servlet a user need to authenticate himself, security credentials are
propagated to the EJB automatically.I'd like to know in the case where the components
are on different machine if I need to put the credential in my InitialContext
when my servlet calls my EJB or if it is also done automatically.
Cheers
romainSay your stub is in a jar called stub.jar.
You need to put that stub somewhere that it can be reached through a protocol for which Java has a URL type - so you can put it on a shared file system and use a file URL or behind an http server and use an http URL.
Let's use http - put stub.jar at the docroot of a web server.
Then, when you start your SERVER code, include this VM parameter:
-Djava.rmi.server.codebase="http://<serveraddress>stub.jar"
Now your client will be able to use http to load the stub file out of stub.jar through http.
If you do use a file URL, make sure the shared directory you put your jar in is not on the client's classpath. -
Thred Safety when Injecting an EJB into servlet using @EJB
Hi , i have read that
when EJBs were injected into servlets using @EJB it is said that there will be no Thread Safety here ??
Is this true.Hi,
You can directly call the methods in the bean without using bean model
see this thread
Webdynpro and Oracle
Regards
Rohit -
How to pass submitted Data from a servlet to EJB Session Bean in JPA
How to pass Data User submitted Data from a servlet to EJB Session Bean when using JPA :
Hi ,
I have a jsp page in which the user fills up the Data and submits it to the servlet :
Inside servlets i am getting all the parameters and setting it to the Entity Class .
Sample Entity class is shown below :
@Entity
public class Employee {
@Id private int id;
private String name;
public Employee() {}
public Employee(int id) { this.id = id; }
public int getId() { return id; }
public void setId(int id) { this.id = id; }
public String getName() { return name; }
public void setName(String name) { this.name = name; }
}After calling setters of my Entity Class .
I am using JNDI lookup to call my session Bean method and pass this Entity class to the session Bean to persist data
Please let me know what will be the right approach :
1. Passing parameters whole as a Entity Class
that is
public void insertData(Employee emp)
}Or
2. public void insertData(String Name , int ID)
}they are both right as they both work. Easy huh?
You might argue that if you have to set a lot of fields, use the entity as otherwise you get a method with a gigantic amount of parameters. -
Error while calling ejb service call from BPM service
Hi,
We are using the Oracle 11.1.1.5.0
We are calling ejb service call from BPM service to update the data to Oracle database.
We are getting the below error when we executing the ejb service call from BPM Service.
<Error> <EJB> <BEA-010026> <Exception occurred du
ring commit of transaction Name=[EJB oracle.bpm.bpmn.engine.ejb.impl.BPMNDeliver
yBean.handleCallback(java.lang.String,java.lang.String,java.lang.String,int,bool
ean)],Xid=BEA1-45B91984D57960994897(30845116),Status=Rolled back. [Reason=javax.
transaction.xa.XAException: JDBC driver does not support XA, hence cannot be a p
articipant in two-phase commit. To force this participation, set the GlobalTrans
actionsProtocol attribute to LoggingLastResource (recommended) or EmulateTwoPhas
eCommit for the Data Source = EBSConnection],numRepliesOwedMe=0,numRepliesOwedOt
hers=0,seconds since begin=1,seconds left=60,XAServerResourceInfo[SOADataSource_
base_domain]=(ServerResourceInfo[SOADataSource_base_domain]=(state=rolledback,as
signed=soa_server1),xar=SOADataSource,re-Registered = false),XAServerResourceInf
o[ArCnTaskForms@EBSConnection@EBSConnection_base_domain]=(ServerResourceInfo[ArC
nTaskForms@EBSConnection@EBSConnection_base_domain]=(state=rolledback,assigned=s
oa_server1),xar=weblogic.jdbc.wrapper.JTSEmulateXAResourceImpl@fa5476,re-Registe
red = false),SCInfo[base_domain+soa_server1]=(state=rolledback),properties=({web
logic.jdbc.remote.EBSConnection=t3://192.168.10.114:8001, weblogic.transaction.n
ame=[EJB oracle.bpm.bpmn.engine.ejb.impl.BPMNDeliveryBean.handleCallback(java.la
ng.String,java.lang.String,java.lang.String,int,boolean)]}),local properties=({w
eblogic.jdbc.jta.SOADataSource=[ No XAConnection is attached to this TxInfo ]}),
OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=soa
server1+192.168.10.114:8001+basedomain+t3+, XAResources={eis/tibjms/Queue, eis
/activemq/Queue, WLStore_base_domain_BPMJMSFileStore, WLStore_base_domain__WLS_s
oa_server1, eis/fioranomq/Topic, eis/jbossmq/Queue, eis/Apps/Apps, eis/websphere
mq/Queue, eis/AQ/aqSample, WLStore_base_domain_SOAJMSFileStore, eis/aqjms/Queue,
WSATGatewayRM_soa_server1_base_domain, eis/sunmq/Queue, eis/pramati/Queue, SSCo
nnectionDS_base_domain, eis/tibjms/Topic, eis/tibjmsDirect/Queue, eis/wls/Queue,
eis/tibjmsDirect/Topic, EDNDataSource_base_domain, eis/wls/Topic, eis/aqjms/Top
ic, RL3TST_base_domain, ArCnTaskForms@EBSConnection@EBSConnection_base_domain, S
OADataSource_base_domain, WLStore_base_domain_UMSJMSFileStore_auto_2},NonXAResou
rces={})],CoordinatorURL=soa_server1+192.168.10.114:8001+base_domain+t3+): weblo
gic.transaction.RollbackException: Could not prepare resource 'ArCnTaskForms@EBS
Connection@EBSConnection_base_domain
JDBC driver does not support XA, hence cannot be a participant in two-phase comm
it. To force this participation, set the GlobalTransactionsProtocol attribute to
LoggingLastResource (recommended) or EmulateTwoPhaseCommit for the Data Source
= EBSConnection
at weblogic.transaction.internal.TransactionImpl.throwRollbackException(
TransactionImpl.java:1881)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(Se
rverTransactionImpl.java:345)
at weblogic.transaction.internal.ServerTransactionImpl.commit(ServerTran
sactionImpl.java:239)
at weblogic.ejb.container.internal.BaseLocalObject.postInvoke1(BaseLocal
Object.java:622)
at weblogic.ejb.container.internal.BaseLocalObject.__WL_postInvokeTxRetr
y(BaseLocalObject.java:455)
at weblogic.ejb.container.internal.SessionLocalMethodInvoker.invoke(Sess
ionLocalMethodInvoker.java:52)
at oracle.bpm.bpmn.engine.ejb.impl.BPMNDeliveryBean_of8dk6_ICubeDelivery
LocalBeanImpl.handleCallback(Unknown Source)
at com.collaxa.cube.engine.dispatch.message.instance.CallbackDeliveryMes
sageHandler.handle(CallbackDeliveryMessageHandler.java:47)
at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(Dispatc
hHelper.java:140)
at com.collaxa.cube.engine.dispatch.BaseDispatchTask.process(BaseDispatc
hTask.java:88)
at com.collaxa.cube.engine.dispatch.BaseDispatchTask.run(BaseDispatchTas
k.java:64)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: javax.transaction.xa.XAException: JDBC driver does not support XA, he
nce cannot be a participant in two-phase commit. To force this participation, se
t the GlobalTransactionsProtocol attribute to LoggingLastResource (recommended)
or EmulateTwoPhaseCommit for the Data Source = EBSConnection
at weblogic.jdbc.wrapper.JTSXAResourceImpl.prepare(JTSXAResourceImpl.jav
a:83)
at weblogic.transaction.internal.XAServerResourceInfo.prepare(XAServerRe
sourceInfo.java:1327)
at weblogic.transaction.internal.XAServerResourceInfo.prepare(XAServerRe
sourceInfo.java:513)
at weblogic.transaction.internal.ServerSCInfo$1.run(ServerSCInfo.java:36
8)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTunin
gWorkManagerImpl.java:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
.>
<12 Oct, 2012 12:34:40 PM IST> <Error> <oracle.soa.bpel.engine.dispatch> <BEA-00
0000> <failed to handle message
javax.transaction.xa.XAException: JDBC driver does not support XA, hence cannot
be a participant in two-phase commit. To force this participation, set the Globa
lTransactionsProtocol attribute to LoggingLastResource (recommended) or EmulateT
woPhaseCommit for the Data Source = EBSConnection
at weblogic.jdbc.wrapper.JTSXAResourceImpl.prepare(JTSXAResourceImpl.jav
a:83)
at weblogic.transaction.internal.XAServerResourceInfo.prepare(XAServerRe
sourceInfo.java:1327)
at weblogic.transaction.internal.XAServerResourceInfo.prepare(XAServerRe
sourceInfo.java:513)
at weblogic.transaction.internal.ServerSCInfo$1.run(ServerSCInfo.java:36
8)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTunin
gWorkManagerImpl.java:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
>
<12 Oct, 2012 12:34:40 PM IST> <Error> <oracle.soa.bpel.engine.dispatch> <BEA-00
0000> <Failed to handle dispatch message ... exception ORABPEL-05002
Message handle error.
error while attempting to process the message "com.collaxa.cube.engine.dispatch.
message.instance.CallbackDeliveryMessage"; the reported exception is: Error comm
itting transaction:; nested exception is: javax.transaction.xa.XAException: JDBC
driver does not support XA, hence cannot be a participant in two-phase commit.
To force this participation, set the GlobalTransactionsProtocol attribute to Log
gingLastResource (recommended) or EmulateTwoPhaseCommit for the Data Source = EB
SConnection
This error contained an exception thrown by the message handler.
Check the exception trace in the log (with logging level set to debug mode).
ORABPEL-05002
Message handle error.
error while attempting to process the message "com.collaxa.cube.engine.dispatch.
message.instance.CallbackDeliveryMessage"; the reported exception is: Error comm
itting transaction:; nested exception is: javax.transaction.xa.XAException: JDBC
driver does not support XA, hence cannot be a participant in two-phase commit.
To force this participation, set the GlobalTransactionsProtocol attribute to Log
gingLastResource (recommended) or EmulateTwoPhaseCommit for the Data Source = EB
SConnection
This error contained an exception thrown by the message handler.
Check the exception trace in the log (with logging level set to debug mode).
at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(Dispatc
hHelper.java:207)
at com.collaxa.cube.engine.dispatch.BaseDispatchTask.process(BaseDispatc
hTask.java:88)
at com.collaxa.cube.engine.dispatch.BaseDispatchTask.run(BaseDispatchTas
k.java:64)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:908)
at java.lang.Thread.run(Thread.java:662)
>
Could any body help on this issue.It is little bit urgent for us to resolve.
Thanks in advance.Thanks Sudipto Desmukh,
The link is helpful me to resolve this issue.
Thanks,
Narasimha E -
Calling EJB 3.0 from ALBPM
Hi,
I tried calling EJB 2.1 from ALBPM and it worked.
But I was nto able to call EJB 3.0.
Is calling EJB 3.0 supported from ALBPM 6.0.2?
If yes, how to call a business method in EJB 3.0?Frank,
Thanks. The @LOB annotations are missing.
Create table with:
CREATE TABLE TestBlob (id number PRIMARY KEY, xmlCol BLOB);
INSERT INTO TestBlob VALUES(1, EMPTY_BLOB());
The following is the complete listing for the EJB 3 class generated from table TestBlob.
package ejb3;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
@Entity
@NamedQueries({
@NamedQuery(name = "Testblob.findAll", query = "select o from Testblob o")
public class Testblob implements Serializable {
@Id
@Column(nullable = false)
private Long id;
private byte[] xmlCol;
public Testblob() {
public Testblob(Long id) {
this.id = id;
public Long getId() {
return id;
public void setId(Long id) {
this.id = id;
public byte[] getXmlCol() {
return xmlCol;
public void setXmlCol(byte[] xmlCol) {
this.xmlCol = xmlCol;
} -
EJB 2.1 session bean calling EJB 3 session bean?
I have a WL 10 (JDK 1.5/EE 5) server that has several EJB 3 stateless session beans deployed and working well. But now I need to allow a JBoss 3.2.3 (JDK 1.4) EJB 2.1 session bean make remote calls into these EJB 3 EJBs. Can this even work?
It seems to me that EJB 3 calling EJB 2 would be fine, but not in the reverse?I have a WL 10 (JDK 1.5/EE 5) server that has several EJB 3 stateless session beans deployed and working well. But now I need to allow a JBoss 3.2.3 (JDK 1.4) EJB 2.1 session bean make remote calls into these EJB 3 EJBs. Can this even work?
It seems to me that EJB 3 calling EJB 2 would be fine, but not in the reverse? -
WDP calling EJB and passing objects of classes from Java project
Hi.
We have <b>Java</b> project which contains some classes common for all projects (like xxx.Version).
We have <b>EJB</b> project which defines EJB interface using these common classes (like getVersion(String,int): xxx.Version and getCurrency(String,xxx.Version,int):xxx.Currency ).
We have <b>Web Dynpro</b> project which calls EJB:
1. Lookup is successful
2. call to getVersion is successful
3. call to getCurrency fails with <b>NoSuchMethodException</b>:
xxx.XXXObjectImpl0.getCurrency(java.lang.String, xxx.Version, int)
at java.lang.Class.getMethod(Class.java:986)
at com.sap.engine.services.rmi_p4.reflect.LocalInvocationHandler.invokeInternal(LocalInvocationHandler.java:51)
at com.sap.engine.services.rmi_p4.reflect.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:53)
at $Proxy346.getCurrency(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sap.engine.services.ejb.session.stateless_sp5.ObjectStubProxyImpl.invoke(ObjectStubProxyImpl.java:187)
at $Proxy347.getCurrency(Unknown Source)
at xxx.XXX.getCurrencyWrapper(XXXXX.java:24)
How can I set dependencies to get this running?
Thanks to all
VolkerHi,
Is it available in the interface you are using..
If the answer is yes.. you might have probably forgotten to deploy the EJBs ear file after making the changes..
Rebuild it.. and deploy the EJB s ear file again..
It will solve the problem.. If that also does not work,it might be a problem with the cache.. restart the server..
It should work now !
Regards
Bharathwaj -
How to Call EJB from coldfusion
I need to call EJB that's created in JBoss from coldfusion.
I'm getting different errors depending on how I set the home object
and provider url.
If I prefix provider url with jnp://, then I get the
following error
The connection to the remote JNDI server on host jnp at port
1099 has failed (as have all backup hosts listed, if any) - please
verify that the server is running and the NamingService is
available
If I take the jnp out and keep just the ip address and port,
then i get the following error
null (no security manager: RMI class loader disabled).
So I'm not sure what the issue is and I haven't used this
feature before.
Here's my codeI tries to call custom EJBfrom custom component received
follwong error
ERROR [STDERR] javax.naming.CommunicationException [Root exception is java.lang.ClassNotFoundException:
No ClassLoaders found for: com.mycom.myapp.action.interfaces.pm.ejb.PmFacadeRemote
(no security manager: RMI class loader disabled)]
any idea?
Thanks
YogLC -
Call EJB from a XI Javamapping
I have developed a simple EAR which contains a CMP with local and remote interfaces. This cmp may be successfully called using the remote-interface from a client (j2se) project. Now i like to call the same CMP from within a XI JavaMapping. In the execute method i am using the following code:
InitialContext ctx;
MeraConfigurationLocal configLocal = null;
try {
ctx = new InitialContext();
Object obj = ctx.lookup("localejbs/mgb.ch/XIMera_EAR/MeraConfigurationBean");
if (trace != null)
trace.addInfo("Got object from jndi: "+obj);
MeraConfigurationLocalHome configHome = (MeraConfigurationLocalHome)obj;
if (configHome !=null) {
if (trace != null)
trace.addInfo("ConfigurationLocalHome: "+configHome);
configLocal = configHome.create();
} catch (Exception e) {
throw new StreamTransformationException(e.getMessage(), e);
int port = Integer.parseInt(
configLocal.ReadParam(MeraResourcePoolDispatcherService.CFG_GENERAL_LISTENER_PORT));
if (trace != null)
trace.addInfo("Got listenerport from localejbs/mgb.ch/XIMera_EAR/MeraConfigBean: "+port);
after calling ctx.lookup ... i got the following traceentry in xi:
<Trace level="1" type="T">*** START APPLICATION TRACE ***</Trace>
<Trace level="2" type="T">Got object from jndi: [email protected]30</Trace>
<Trace level="1" type="T">*** END APPLICATION TRACE ***</Trace>
when i try to cast this obj into a MeraConfigurationLocal the system is throwing a ClassCastExceptionHello.
Check my wiki article:
http://wiki.sdn.sap.com/wiki/display/stage/SapNetweaverProcessIntegration.CallEjb3.0methodfromJavaclassmappingPI7.1
(SapNetweaver Process Integration. Call Ejb 3.0 method from Java class mapping PI 7.1)
Maybe you are looking for
-
Where can I download CRX developer edition ? Im geting error message on clicking the Download link. Someone pls help me to download CRX. Thanks in Advance.
-
I have the ipad2. I have filled up all of the windows with programs. Now whenever I add a program there is no room for the icon. I have deleted several programs and their icons from the screens leaving.empty spaces for other icons. Now how do I get
-
Can't enter unit price in Goods Receipt PO form
Priority: High Hello Experts, In GRPO >> form settings, I have checked both the boxes VISIBLE AND ACTIVE. It displays the field on form but does not allow me to modify it. Help Required... tha
-
Animation Tweening is producing a transparent to opaque transition
I have two frames with the start and end of my animation. My two layers contain a transparent background and an opaque object. When I choose the tweening option and add my specified number of frames, then test the animation, the start of the animatio
-
Data being deleted off my external HDD when I copy to it
I have got a 160 GB extertnal USB hard drive and when i copy new data to it its deleting old data. whats wrong with it and how can i stop it deleting all my older data? Neil