cancel
Showing results for 
Search instead for 
Did you mean: 

Web AS 6.3 CORBA and EJB

Former Member
0 Kudos

hi,

i am trying to use an EJB (deployed in the AS) via CORBA.

The AS is the Netweaver Web AS 6.3 Sneak Preview

The goal is to have for example a Visual Basic client which is using the EJB.

I'm trying this way:

-write the EJB

-deploy

-generate idl from home and remote interface

-write client

The client has to call the namingservice to find the home interface and then he can "create" his remote interface.

My questions:

-is there an CORBA ORB in the Web AS 6.3 integrated?

-are EJB automatically registered at this ORB?

-what is the port (TCP) of the NameServer

I thought i can use the IIOP Port 50007, but this doesn't work,

also th port 50002 doesn't work.

I have started in the j2ee Admin the iiop Provider of the Dispatcher manually.

Can you also help me in Browsing the ORB (if there is one) with the jndi Explorer Plugin?

which Class? how does the URI looks like?

thx

Christian

Accepted Solutions (0)

Answers (1)

Answers (1)

Benny
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Christian,

the developers manualkeeps some information about this under:

http://help.sap.com/saphelp_webas630/helpdata/en/fe/a3996fa314f94f8a0c3475b08636d0/frameset.htm

-is there an CORBA ORB in the Web AS 6.3 integrated?

As far aas I remember, yes.

-are EJB automatically registered at this ORB?

pretty sure that not.

Basically I'd say skip it until our next version is on the net, because there was a lot of work on this since may.

Regards,

Benny

Former Member
0 Kudos

Hi Christian,

straight to your questions:

- The J2EE Engine 6.30 has CORBA ORB integrated. So, it must be in the Sneak Preview also.

- Just a remark on the development process you described: When deploying the EJBs, you should deploy them with IIOP support (I don't know which tool you deploy them with, but by default EJBs are deployed with P4 support). Anyway, whichever way you deploy the EJBs, you can provide the IIOP support usign the Visual Administrator tool. To do that, go to the EJB Container Service, Runtime screen. Select the EJB you deployed. On the right-hand side, a Deploy IIOP support button must appear. This updates the application with the appropriate IIOP support.

- about the port - yes, the 50007 is the right port to request (provided that your instance ID is 0). For detailed description of default ports numbers generation, refer to http://help.sap.com/saphelp_webas630/helpdata/en/a2/f9d7fed2adc340ab462ae159d19509/frameset.htm

Btw., did you check whether the IIOP service is running on both dispatcher and server nodes? Remember, this service has startup state "manual", which means it does not start with the Engine startup.

If nothing from above helps, you may have to get more specific about the errors you get.. Maybe then somebody can help you.

About the 6.40 version, the documentation will come up with a detailed, step-by-step, ready-to-be-run tutorial for developing IIOP application with EJB server part, and both java and C++ clients. Hope that this will help guys that have similar problems.

Best regards,

Ivo.

Former Member
0 Kudos

Thx,

but I can't find this button. I've read about about it before

In the Visual Administrator -> Server0...->Services->EJB Container there are:

Textfields: Description, Display Name, JNDI Name, Container Size, Session Timeout,

Buttons: Continue Changing, Clear Changes, Make Update

Maybe i'm in the wrong place?

Maybe this isn't included in the Sneak Preview?

Best regards

Christian

Former Member
0 Kudos

Hi Christian,

It seems that you've dug a little bit down The textfiels and buttons you describe appear per bean..

the button to generate IIOP support should appear when you select the application name the beans pertain to, e.g. sap.com/<YourAppName>. This node is an immediate subnode of the root Beans node that appears when you open the EJB Container screen in the Visual Administrator..

Now, check if the Deploy IIOP Support button is there?

Regards,

Ivo

Former Member
0 Kudos

hi,

Thx for your help, but it doesn't appear either.

I decided to to programm a j2ee client application for my bean which connects to the tnameserv ORB. Just to get this working. Later I will return to my original Problem.

Best Regards,

Christian

Former Member
0 Kudos

Hello,

As I described in my other post I have written my CORBA Wrapper in Java using JNDI to locate the EJB. This works as expected without big problems.

Now I'm back to my Problem, because the Wrapper isn't really any solution for production.

I found out. If the IIOP provider of the server and dispatcher are started before the deploy tool, than it changes a very little bit.

In the properties page of the deploy tab is a new entry in the ClusterInfo tab. It says iiop and is checked. It's not uncheckable.

After a deploy the "Deploy IIOP Support" in the EJB Container doesn't appears, too.

My question now, is this the same like using the magic buttton, which doesn't appear in my Case or is this sth. different. If it's sth. different, what is it?

Are there other possibilities, why this button doesn't appear in my Visual Administrator?

Or do I have to wait for the next beta in spring next year?

Sincerly regards,

Christian

Former Member
0 Kudos

Hi Christian,

the property in the Deploy Tool is meant to do the same as the button I've told you about in the Visual Administrator. Well, I did not say that that's exactly the problem in your case; I've just made a guess since you were not very specific about the error you get (and the point you get it at). To be able to find the right answer to your questions, we would definitely need more info about the errors you get. So, please provide that.

Then, we'll investigate the problem and come up with the answer. (may take some time though).

Regards,

Ivo

Former Member
0 Kudos

Hi,

This button/feature hasn't solved my problem. I tried to get the EJB Home Interface via CORBA and COSNaming from an Java client with this code:

-


Properties props = new Properties();

props.put("org.omg.CORBA.ORBInitialHost", "ws-27");

props.put("org.omg.CORBA.ORBInitialPort", "50007");

ORB _orb = ORB.init((String[]) null, props);

org.omg.CORBA.Object obj = null;

obj = orb.stringto_object("corbaloc:iiop:ws-27:50007/NameService");

NamingContextExt initCtx = NamingContextExtHelper.narrow(obj);

System.out.println(initCtx);

org.omg.CORBA.Object ejbHome = null;

try {

u00A0u00A0u00A0ejbHome =initCtx.resolve_str("kundenVerwaltung/kundenVerwaltungEJBSFBean");

/*at this point the programm hangs.

u00A0u00A0The used name is the JNDI name of the bean.*/

} catch (NotFound e) {} catch (CannotProceed e) {} catch (org.omg.CosNaming.NamingContextPackage.InvalidName e) {}

kundenVerwaltungEJBSFHome home =(kundenVerwaltungEJBSFHome) PortableRemoteObject.narrow(ejbHome, kundenVerwaltungEJBSFHome.class);

kundenVerwaltungEJBSF remote = null;

try {

u00A0u00A0remote = home.create();

} catch (CreateEx e) {}

-


I'm getting the following error message in my C:\usr\sap\C11\JC00\j2ee\cluster\server0\log\console_logs\error.log

-


java.lang.NullPointerException

at org.omg.CosNaming._NamingContextImplBase.invoke(_NamingContextImplBase.java:40)

at com.sap.engine.services.iiop.internal.giop.IncomingRequest.invokeMethod(IncomingRequest.java:268)

at com.sap.engine.services.iiop.internal.giop.IncomingRequest.process(IncomingRequest.java:222)

at com.sap.engine.services.iiop.internal.giop.ConnectionParser.readMessage(ConnectionParser.java:68)

at com.sap.engine.services.iiop.server.CommunicationLayerImpl.request(CommunicationLayerImpl.java:212)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)

at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:60)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:55)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:115)

org.omg.CORBA.BAD_PARAM: ID010037: Error in writing string, which is null.u00A0u00A0minor code: 0 completed: No

at com.sap.engine.services.iiop.CORBA.portable.CORBAOutputStream.write_string(CORBAOutputStream.java:421)

at com.sap.engine.services.iiop.internal.giop.IncomingRequest.createExceptionReply(IncomingRequest.java:397)

at com.sap.engine.services.iiop.internal.giop.IncomingRequest.invokeMethod(IncomingRequest.java:292)

at com.sap.engine.services.iiop.internal.giop.IncomingRequest.process(IncomingRequest.java:222)

at com.sap.engine.services.iiop.internal.giop.ConnectionParser.readMessage(ConnectionParser.java:68)

at com.sap.engine.services.iiop.server.CommunicationLayerImpl.request(CommunicationLayerImpl.java:212)

at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)

at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:60)

at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:55)

at java.security.AccessController.doPrivileged(Native Method)

at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:115)

-


I think he can't find the name via COSNaming. And so he can't send any output data stream. But i have not found any clue which name to use, or how to get the right NameService.

I've also tried to use

"corbaname:iiop:ws-27:50007#kundenVerwaltung/kundenVerwaltungEJBSFBean"

But then i'm not getting the error message, but the program still hangs at the same position.

Regards,

Christian

Former Member
0 Kudos

Hi Christian,

I'm from the IIOP team in Bulgaria, here is the answer for your issue :

In the SneakPreview the operations from org.omg.CosNaming.NamingContextExt are not supported, so instead of NamingContextExt.resolve_str() use NamingContext.resolve()

Here is how to edit your client :

'<-' - means remove row

'->' - means add row

Properties props = new Properties();

props.put("org.omg.CORBA.ORBInitialHost", "ws-27");

props.put("org.omg.CORBA.ORBInitialPort", "50007");

ORB _orb = ORB.init((String[]) null, props);

org.omg.CORBA.Object obj = null;

obj = orb.stringto_object("corbaloc:iiop:ws-27:50007/NameService");

<- NamingContextExt initCtx = NamingContextExtHelper.narrow(obj);

-> NamingContext initCtx = NamingContextHelper.narrow(obj);

System.out.println(initCtx);

org.omg.CORBA.Object ejbHome = null;

try {

<- ejbHome =initCtx.resolve_str("kundenVerwaltung/kundenVerwaltungEJBSFBean");

-> NameComponent[] nComps = new NameComponent[] {new NameComponent("kundenVerwaltung", ""), new NameComponent("kundenVerwaltungEJBSFBean", "")};

-> ejbHome = initCtx.resolve(nComps);

} catch (NotFound e) {} catch (CannotProceed e) {} catch (org.omg.CosNaming.NamingContextPackage.InvalidName e) {}

kundenVerwaltungEJBSFHome home =(kundenVerwaltungEJBSFHome) PortableRemoteObject.narrow(ejbHome, kundenVerwaltungEJBSFHome.class);

kundenVerwaltungEJBSF remote = null;

try {

remote = home.create();

} catch (CreateEx e) {}

After this change it will be ok. The operation from org.omg.CosNaming.NamingContextEx are supported in the Web AS versions from August 2003, it will be best if you equip with some newer than July 2003 version.

Former Member
0 Kudos

Hello Nikolai,

thanks for your help. Now I know it is possible to contact the EJB via CORBA. But as I searched the fault in my VisualBasic Client I found out that it sends other GIOP Messages as the the Java Orb.

The Java Orb sends a REQUEST for and communicates isa_ and gives the CodeBase of NamingContext

The VBOrb just sends a LOCATEREQUEST for NameService

But the VBOrb gets no Answer from the Netweaver.

Is ist possible, that the SapNetweaver Developer studio SneakPreview (beta2) dosn't understand LOCATEREQUEST? It is part of the OMG Standard so its not a bug of VBOrb in Fact.

I hope somebody can help me.

I found out by using Ethereal and analyzed the network traffic

Regards

Christian

Former Member
0 Kudos

Hi Christian,

You've guessed right, in the Sneak Preview we have implementation of CORBA 1.1 and not

comletelly implemented CORBA 1.2.. Since the middle of the last year we took care of the communication with different ORB's, and we've implemented a lot from CORBA 1.2. specification and started the implementation of CORBA 1.3

Regards Nikolai.

P.S. : you van contact me on e-mail : nikolai.neichev@sap.com,

it will be much more conveniently, than corresponding in the forum.