PDA

View Full Version : Trouble with org.omg.CORBA...


mburbidg
May 30th, 2008, 09:52 AM
I'm having trouble using org.omg.CORBA. It is in the JDK 5.0 Standard Edition, which is what I'm using. The first problem is that I get the following exception:


Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'jobMgr' defined in URL [bundleentry://34/WEB-INF/newClientAPI-servlet.xml]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/omg/CORBA/SystemException
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.initializeBean(Abstract AutowireCapableBeanFactory.java:1336)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:471)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$1.run(AbstractAutowireC apableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 64)


I don't understand why I'm getting this exception since the class is in the JDK. In an effort to "try anything" I added org.omg.CORBA to my manifest as an import. This made this exception, which happened at startup, go away. I don't understand this either since the JDK doesn't export it. Perhaps imports are not verified against exports by equinox.

But then when my code goes to use the functionality in the package org.omg I get the following exception.


org.omg.CORBA.INITIALIZE: can't instantiate default ORB implementation com.sun.corba.se.impl.orb.ORBImpl 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.adobe.ids.utilities.CORBAUtilities.getORB(CORB AUtilities.java:32)
at com.adobe.ids.connector.Connector.getAppFromIOR(Co nnector.java:96)
at com.adobe.ids.connector.Connector.getInstance(Conn ector.java:61)
at com.adobe.dandelion.monitoring.VerifySystemCmd.exe cute(VerifySystemCmd.java:31)
at com.adobe.dandelion.monitoring.MonitorController.d oHandle(MonitorController.java:26)
at com.adobe.dandelion.BaseController.handle(BaseCont roller.java:54)
at org.springframework.web.servlet.mvc.AbstractComman dController.handleRequestInternal(AbstractCommandC ontroller.java:84)
at org.springframework.web.servlet.mvc.AbstractContro ller.handleRequest(AbstractController.java:153)
at org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda pter.java:48)
at org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:875)
at org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:809)
at org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:571)
at org.springframework.web.servlet.FrameworkServlet.d oGet(FrameworkServlet.java:501)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet .java:820)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:269)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:188)
at org.springframework.web.filter.CharacterEncodingFi lter.doFilterInternal(CharacterEncodingFilter.java :96)
at org.springframework.web.filter.OncePerRequestFilte r.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.in ternalDoFilter(ApplicationFilterChain.java:215)
at org.apache.catalina.core.ApplicationFilterChain.do Filter(ApplicationFilterChain.java:188)
at org.apache.catalina.core.StandardWrapperValve.invo ke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardContextValve.invo ke(StandardContextValve.java:174)
at org.apache.catalina.core.StandardHostValve.invoke( StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:117)
at org.apache.catalina.core.StandardEngineValve.invok e(StandardEngineValve.java:108)
at org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:151)
at org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:870)
at org.apache.coyote.http11.Http11BaseProtocol$Http11 ConnectionHandler.processConnection(Http11BaseProt ocol.java:665)
at org.apache.tomcat.util.net.PoolTcpEndpoint.process Socket(PoolTcpEndpoint.java:528)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThr ead.runIt(LeaderFollowerWorkerThread.java:81)
at org.apache.tomcat.util.threads.ThreadPool$ControlR unnable.run(ThreadPool.java:685)
at java.lang.Thread.run(Thread.java:613)
Caused by: java.lang.ClassNotFoundException: com.sun.corba.se.impl.orb.ORBImpl
at java.net.URLClassLoader$1.run(URLClassLoader.java: 200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.j ava:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:3 16)
at java.net.FactoryURLClassLoader.loadClass(URLClassL oader.java:579)
at java.lang.ClassLoader.loadClass(ClassLoader.java:2 51)
at java.lang.ClassLoader.loadClassInternal(ClassLoade r.java:374)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:242)
at org.omg.CORBA.ORB.create_impl(ORB.java:295)
... 34 more


com.sun.corba.se.impl.orb.ORBImpl also should be in the JDK. Is there something about the OSGi environment that is messing up the classpath to the JDK? Does anyone have any suggestions as to what to try?

Thanks,
Michael-

Costin Leau
May 30th, 2008, 11:01 AM
OSGi might affect proper use of CORBA - I haven't used it myself so this is just a hunch. Note that Equinox, as the many of the other OSGi implementations, export the packages available in the JDK (that is everything else except java.*). Since you depend on a class you should import it - additionally you could use boot delegation but that's not what I recommend since it hides the dependency.
I'm not sure what classloader is ORB using but you can delegate to the bootpath sun.* and com.sun.* packages.

mburbidg
May 30th, 2008, 11:12 AM
How do I delegate to the bootpath sun.* and com.sun.* packages?

mburbidg
May 30th, 2008, 11:48 AM
Costin,

I figured it out. I set the following system property in my config.ini.

org.osgi.framework.bootdelegation=sun.*,com.sun.*

And that fixed the CORBA problem!

Thanks,
Michael-

Costin Leau
May 30th, 2008, 03:22 PM
Hi Michael,

Sorry I couldn't respond earlier - glad you could find the solution already. I would argue it's best practice to delegate this packages always since they belong to the SUN JDK (in fact even the OSGi spec gives an example using this packages).
We also use them in Spring-DM testing framework.