File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes BEA/Weblogic and the fly likes Unhandled exception in lookup [Root exception is org.omg.CORBA.NO_PERMISSION Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Unhandled exception in lookup [Root exception is org.omg.CORBA.NO_PERMISSION" Watch "Unhandled exception in lookup [Root exception is org.omg.CORBA.NO_PERMISSION" New topic
Author

Unhandled exception in lookup [Root exception is org.omg.CORBA.NO_PERMISSION

ronnie yizar
Greenhorn

Joined: Feb 15, 2012
Posts: 1
Hi,

we are using a EJBclient invoker from a DB oracle instance 11.1.0.7.0
the code is deployed using javaload into the DB, we also deployed wlclient.jar and wl-j2ee-client.jar
our environment details:
DB oracle version: 11.1.0.7.0
JDK: 1.5._17

weblogic 11g and weblogic server version is 10.3.2.0
JDK 1.6._17


we cannot change JVM version client must be JRE5 and server JRE6 and the client must be run on DB side.

basically our client code request the weblogic server for a reference to an EJB object
then we use that object in order to interact with a thirdparty interface using webservice.


our code is :
public class CCSEJBInvoker {
/**
*
* @throws Exception
*/
public static HashMap getTemplateList(Long projectId,Long projTaskId,String orderType,Long dimUserId) throws Exception {
Context ctx=null;
CCSBeanRemote objCCS=null;
String result;
HashMap hashResult;
try {
objCCS = null;
result = "false";
hashResult = new HashMap();
hashResult.put("result", result);
ctx= CCSEJBInvokerConfig.getInitialContext();
System.out.println("here 1 line:39");
CCSBeanRemoteHome object = (CCSBeanRemoteHome)ctx.lookup("CCSBean");
System.out.println("here 2 line:41" + "object:" + object);
CCSBeanRemoteHome ccsHome = (CCSBeanRemoteHome)PortableRemoteObject.narrow( object , CCSBeanRemoteHome.class);
System.out.println("here 3 line:43" + "ccsHome:" +ccsHome);
objCCS = ccsHome.create();
System.out.println("here 4 line:45" + "objCCS:" +objCCS);
try
{
hashResult = objCCS.getTemplateList(projectId,projTaskId,orderType,dimUserId);
}
catch(Throwable t)
{
t.printStackTrace();
System.out.println("Throwable Exception:" + t.getMessage());
//throw new Exception("Throwable Runtime Exception");
}
System.out.println("here 5 line:47" + "hashResult:" + hashResult);
System.out.println(hashResult.get("result"));
System.out.println("here 6 line:49");
}
catch(SystemException e)
{
e.printStackTrace();
System.out.println("Exception:" + "Error while lookup CCSBean =" + e.getMessage());
throw new CCSException("Error while lookup CCSBean");
}
catch (Exception e) {
e.printStackTrace();
System.out.println("Exception:" +e.getMessage());
throw e;
}
finally
{
objCCS.remove();
ctx.close();
}
return hashResult;
}
}

in order to get the initialcontext we have the following class which is also loaded into DB
we are getting the creditials from our DB:

public class CCSEJBInvokerConfig {
public static synchronized Context getInitialContext() throws CCSException, NamingException,Exception,SystemException {
String user = getDIMParamValue("ccsWeblogicUser");

String password = getDIMParamValue("ccsWeblogicPassword");


String url = getDIMParamValue("ccsWeblogicURL");



System.out.println("user" + user + " password" + password + " url "
+ url);
System.out.println("Creating initial context");
Properties p = new Properties();
p.put("java.naming.factory.initial","weblogic.jndi.WLInitialContextFactory");
p.put("java.naming.provider.url", url);
System.setProperty("com.sun.CORBA.transport.ORBWaitForResponseTimeout", "7200000");
System.setProperty("com.sun.CORBA.transport.ORBTCPReadTimeouts", "1:60000:300:1");
System.setProperty("java.net.preferIPv4Stack", "true");
System.setProperty("sun.net.inetaddr.ttl", "0");
System.setProperty("networkaddress.cache.ttl", "0");

if (user != null) {
System.out.println("user: " + user);
p.put("java.naming.security.principal", user);
if (password == null) {
password = "";
}
p.put("java.naming.security.credentials", password);
}
InitialContext ic = null;
try {
ic = new InitialContext(p);
System.out.println("initial context created succesfuly");
}
catch (Exception e)
{
e.printStackTrace();
System.out.println("Exception:" + "Error while getting Initial Context =" + e.getMessage());
throw e;
}

return ic;
}
}


we are failing on the following row after we get the initialcontext when trying to do lookup for the bean:
CCSBeanRemoteHome object = (CCSBeanRemoteHome)ctx.lookup("CCSBean");

it is not happens all the time it is more like an intermediate issue that we cannot predict when the exception will come.
most of the time it comes on the first try of the session.

this is the exception from oracle trace log:

Feb 14, 2012 3:36:39 PM com.cramer.comcast.te.mecbh.r11_7.callouts.serviceAssign.ServiceAssignCallouts ccsInterface_preTaskCallout
INFO: projTaskID: 2377211 <-> projectID: 22411
Inside getDIMParamValue
Param Name:
Inside getDIMParamValue
Param Name:
Inside getDIMParamValue
Param Name:
user:weblogic password******* url t3://<<our host ip>>:8158
Creating initial context
initial context created succesfuly
here 1 line:39
Exception:Error while lookup CCSBean =Unhandled exception in lookup
javax.naming.NamingException: Unhandled exception in lookup [Root exception is org.omg.CORBA.NO_PERMISSION: vmcid: 0x0 minor code: 0 completed: No]
at weblogic.corba.j2ee.naming.Utils.wrapNamingException(Utils.java:83)
at weblogic.corba.j2ee.naming.ContextImpl.lookup(ContextImpl.java:291)
at weblogic.corba.j2ee.naming.ContextImpl.lookup(ContextImpl.java:227)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at com.cramer.comcast.te.mecbh.ccs.invoker.CCSEJBInvoker.getTemplateList(CCSEJBInvoker.java:40)
at com.cramer.comcast.te.mecbh.r11_7.callouts.serviceAssign.ServiceAssignCallouts.ccsInterface_preTaskCallout(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java)
at java.lang.reflect.Method.invoke(Method.java)
at com.cramer.rm.core.db.PKGExecDynamicJava.execute(PKGExecDynamicJava.java)
Caused by: org.omg.CORBA.NO_PERMISSION: vmcid: 0x0 minor code: 0 completed: No
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java)
at java.lang.reflect.Constructor.newInstance(Constructor.java)
at java.lang.Class.newInstance0(Class.java)
at java.lang.Class.newInstance(Class.java)
at com.sun.corba.se.impl.protocol.giopmsgheaders.MessageBase.getSystemException(MessageBase.java:897)
at com.sun.corba.se.impl.protocol.giopmsgheaders.ReplyMessage_1_2.getSystemException(ReplyMessage_1_2.java:99)
at com.sun.corba.se.impl.protocol.CorbaMessageMediatorImpl.getSystemExceptionReply(CorbaMessageMediatorImpl.java:572)
at com.sun.corba.se.impl.protocol.CorbaClientRequestDispatcherImpl.processResponse(CorbaClientRequestDispatcherImpl.java)

we tried to add the following permission to the oracle instance:

call dbms_java.grant_permission( 'CRAMER', 'SYS:java.io.SerializablePermission', 'enableSubclassImplementation', '' );
call dbms_java.grant_permission(‘CRAMER’,’SYS:java.util.PropertyPermission’ ,‘com.sun.CORBA.transport.ORBTCPReadTimeouts’,’write’);
call dbms_java.grant_permission( 'CRAMER', 'SYS:java.util.PropertyPermission', 'com.sun.CORBA.transport.ORBWaitForResponseTimeout', 'write' )
call dbms_java.grant_permission(‘CRAMER’,’SYS:java.util.PropertyPermission’, ‘java.net.preferIPv4Stack’,’write’);
call dbms_java.grant_permission(‘CRAMER’,’SYS:java.util.PropertyPermission’, ‘sun.net.inetaddr.ttl’,’write’);
call dbms_java.grant_permission(‘CRAMER’,’SYS:java.util.PropertyPermission’ ,‘networkaddress.cache.ttl’,’write’);

also to the java code:

System.setProperty("com.sun.CORBA.transport.ORBWaitForResponseTimeout", "7200000");
System.setProperty("com.sun.CORBA.transport.ORBTCPReadTimeouts", "1:60000:300:1");
System.setProperty("java.net.preferIPv4Stack", "true");
System.setProperty("sun.net.inetaddr.ttl", "0");
System.setProperty("networkaddress.cache.ttl", "0");


also tried to add the following configuration to our weblogic console under the managed server IIOP Protocol definition:
Enable IIOP (checked)
Default IIOP Username : weblogic
Default IIOP Password : <<our password>>

we tried to load wlfullclient5.jar into DB but all weblogic classes become invalid so we restore our DB from the backup.

*this is our ejb-jar.xml:*

<ejb-jar version="2.1" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd">
<display-name>notification-ejb</display-name>
<enterprise-beans>
<session>
<display-name>ccsEJB</display-name>
<ejb-name>CCSBean</ejb-name>
<home>com.cramer.comcast.te.mecbh.ccs.impl.CCSBeanRemoteHome</home>
<remote>com.cramer.comcast.te.mecbh.ccs.impl.CCSBeanRemote</remote>
<ejb-class>com.cramer.comcast.te.mecbh.ccs.impl.CCSBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<env-entry>
<!-- ******************** CONFIGURABLE ENTRY ************************ -->
<description>Application Name</description>
<env-entry-name>application_name</env-entry-name>
<env-entry-type>java.lang.String </env-entry-type>
<!-- <env-entry-value>CRAMER</env-entry-value> -->
<env-entry-value>Cramer Development</env-entry-value>
</env-entry>
<env-entry>
<!-- ******************** CONFIGURABLE ENTRY ************************ -->
<description>Version Number</description>
<env-entry-name>version_number</env-entry-name>
<env-entry-type>java.lang.String </env-entry-type>
<!-- <env-entry-value>CRAMER</env-entry-value> -->
<env-entry-value>11.4 Branch</env-entry-value>
</env-entry>
<resource-ref>
<!-- ******************** CONFIGURABLE ENTRY ************************ -->
<res-ref-name>jdbc/CramerDS_native</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</session>
</enterprise-beans>
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>CCSBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>NotSupported</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>

*_and this is our weblogic weblogic-ejb-jar.xml:_*

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-ejb-jar xmlns="http://www.bea.com/ns/weblogic/90">
<weblogic-enterprise-bean>
<ejb-name>CCSBean</ejb-name>
<enable-call-by-reference>true</enable-call-by-reference>
<jndi-name>CCSBean</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar>


we also tried to write a client in Eclipse using the same JDK 1.5._17 and wlclient.jar we dont get this exception at all even after runing it
in while (true) loop which every 2 sec (thread.sleep) creates the initialcontext and do a lookup for the EJB.

it must be something related to the implemntation of the oracle JVM on the DB which is different from the one we use in eclipse
how can we overcome the exception? are we missing any permission in the DB?, does it related to JNDI cache expired?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Unhandled exception in lookup [Root exception is org.omg.CORBA.NO_PERMISSION