on 04-13-2005 6:22 PM
I've been writing about when JSPDynPage and WebDynpro are better for WebApplications in /thread/33637 [original link is broken]
The point that I'm not sure of is, if WebDynpro and EJB must be on the same server or if WebDynpro could access EJB on other servers?
Hi Manuel,
I suppose you have doubts about this scenario: You have a WebDynpro app that will be deployed to Web AS instance A and that has to access an EJB that will be deployed to Web AS instance B, whereas A and B don't form a cluster.
Well, in general you can do it - lookup the EJB and call its methods remotely. In this case you may want to have a look at <a href="http://help.sap.com/saphelp_nw04/helpdata/en/8b/2e2c4142aef623e10000000a155106/frameset.htm">this document</a> - there is a special property "force_remote" which must be specified when constructing the JNDI InitialContext.
However, for performance reasons I'd suggest you to deploy both apps on the same Web AS instance and make use of EJB local interfaces. Thus you benefit from local method invocation (i.e. in the same JVM), no need of routing to another Web AS dispatcher, no need of method parameters serialization and deserialization, and so on and so on.
Hope that was of help!
Vladimir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I am using the following code for accessing an ejb from a portal component(JSPDynPage)::
IPortalComponentRequest newRequest =(IPortalComponentRequest) this.getRequest();
IPortalComponentSession newSession = newRequest.getComponentSession();try {
Sender sender = (Sender)newSession.getValue("sender");
if ( sender == null )
{
Context ctx = new InitialContext();
Object ref = ctx.lookup("MessageSender");
System.out.println("After lookup: " + ref.getClass().getName() );
SenderHome senderHome =(SenderHome)P4ObjectBroker.init().narrow(ref,SenderHome.class);
newSession.putValue("sender",sender);
sender = senderHome.createSender();
}
}
Message Sender is the JNDI name of the session bean
This code is givivng an error of ClassCastException:com.sap.message.sender.senderHome#
When I am using SenderLocalHome instead of SenderHome it does not give exception but does not fetch the create() function in the bean.
Moreover the ref that it fetches is :HomeRMI_P4:Dynamic Stub:com.sap.message.sender.SenderHomeImpl0@1fbcbad#
why is it that it fetches a reference of Senderhome instead of SenderLocalhome?
Regards
Shilpa
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.