cancel
Showing results for 
Search instead for 
Did you mean: 

JNDI troubles porting application

Former Member
0 Kudos

Hi there. I am working to port a j2ee application from Websphere to run on the NW04 sneak preview. Unfortunately I seem to be having strange JNDI issues that are proving difficult to resolve.

I create new J2EE EJB, Web App, and Enterprise App projects in developer studio, and create a test bean and servlet to verify that I can do a lookup and call a method on a stateless session bean.

Here's my test servlet code, where SecuritySBBean is my test bean:

protected void doGet(

HttpServletRequest request,

HttpServletResponse response)

throws ServletException, IOException

{

try

{

String url = "java:comp/env/ejb/SecuritySBBean";

Context ctx = new InitialContext();

Object objref = ctx.lookup(url);

SecuritySBHome sbHome = (SecuritySBHomePortableRemoteObject.narrow(objref, SecuritySBHome.class);

SecuritySB testSb = sbHome.create();

PrintWriter out = new PrintWriter(response.getOutputStream());

out.println("<pre>");

out.println(testSb.testMethod("xxx"));

out.println("</pre>");

out.flush();

out.close();

}

catch (Exception e)

{

throw new ServletException("exception", e);

}

}

Now, when I deploy this and hit the url I mapped to the servlet, all is good, I get the message on the screen.

However, when I go to add my jars and source from my existing and working application to the new project folders, refresh the project, and rebuild.. Now the deployment FAILS with the following message!

Caused by: org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementation com.sun.enterprise.iiop.POAEJBORB vmcid: 0x0 minor code: 0 completed: No

at org.omg.CORBA.ORB.create_impl(ORB.java:297)

at org.omg.CORBA.ORB.init(ORB.java:336)

at com.sap.engine.services.servlets_jsp.server.runtime.context.WebApplicationConfig.parse(WebApplicationConfig.java:116)

at com.sap.engine.services.servlets_jsp.server.runtime.context.ApplicationContext.init(ApplicationContext.java:600)

... 24 more

Caused by: java.lang.ClassNotFoundException: com.sun.enterprise.iiop.POAEJBORB

To make things worse, it seems to be very difficult to UNscrew the application such that it works again. I can delete the app and undeploy from the server, restore a backed up version of the app and deploy it, the exact code that previously worked, and now IT fails as well.

My leading theory is that i'm including a jarfile with something that interferes with NW's JNDI code, previously I have been able to deploy the beans okay, and verified the registered names in the JNDI explorer, but still be getting Naming exceptions when looking them up from the web client..

TIA for any help or suggestions.

David Mitchell

Accepted Solutions (1)

Accepted Solutions (1)

former_member184385
Active Participant
0 Kudos

Hi David,

the stack trace shows problems with the ORB. And , interestingly it is failing at the attempt to bootstrap the default (SUN provided) JDK ORB. But, afaik, this is not supposed to work this way inside NW, you have to use SAP's own ORB implementation here.

System properties

- org.omg.CORBA.ORBClass and

- org.omg.CORBA.ORBSingletonClass

decide about, what ORB gets used. Do, by chance, your' EJB proxy initialization code manipulate this properties? Should this be the case, I suggest to comment out this statements and try the deployment again.

Regards

Gregor

Answers (2)

Answers (2)

Former Member
0 Kudos

hi there. I think I have solved the problem myself. I believe I must have been including the j2ee.jar file in my deployed EAR file, and screwing up the server. I think what got it working again was when I poked around the deployed apps folders and found a set from an expired and incompletely removed app that no longer showed up in the deployed apps list.

thanks

david

Former Member
0 Kudos

I have seen this problem, the best way to do is compile the code in SAP Netweaver Developer Studio.

Kumar Vidadala

ProcessWeaver,Inc.

www.processweaver.com

email : info@processweaver.com

Ph # (888)WEAVER3

kishorg
Advisor
Advisor
0 Kudos

HI David ,

for your naming excetion ,just try the look up with

the JNDI Name that u have given in the ejb-j2ee-engine.xml descriptor associated with the EJB.

for example i u r giving

JNDI Name as -> jndiName , then

instead of

String url = "java:comp/env/ejb/jndiName";

just give

String url = "jndiName";

i think it will work.

<<then for ur exception, >>

if ur original application in websphere is using some external jar files , that jars u have to add here as Additional Libraries.

<b>one main thing here to note is if ur original app is using some server dependent jar files , the migration becomes tough (a little chance for supporting that server specific API with SAP J2EE WAS).</b>

regards

Kishor Gopinathan

i think its is better to post this type of queries in the WAS Migration forum.