-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 
Author Message
 Post subject: Binding SessionFactory to JNDI (WebSphere 5 security enabled
PostPosted: Mon Jun 14, 2004 5:06 am 
Newbie

Joined: Mon Jun 14, 2004 4:45 am
Posts: 1
Hi,

I tried to bind a Hibernate SessionFactory to JNDI using the "hibernate.session_factory_name" config parameter.
Everything worked well in my local test environment which does not have security enabled.


In a production environment with security enabled I get the following exception:

[14.06.04 11:04:29:380 CEST] 7816e471 SystemErr R [WARN] SessionFactoryObjectFactory - -Could not bind factory to JNDI <javax.naming.NoPermissionException: NO_PERMISSION exception caught [Root exception is org.omg.CORBA.NO_PERMISSION: not authorized to perform bind_new_corba_context operation. minor code: 0 completed: No]>javax.naming.NoPermissionException: NO_PERMISSION exception caught. Root exception is org.omg.CORBA.NO_PERMISSION: not authorized to perform bind_new_corba_context operation. minor code: 0 completed: No
at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.performAuthorizationCheck(WsnOptimizedNamingImplBase.java:2705)
at com.ibm.ws.naming.cosbase.WsnOptimizedNamingImplBase.bind_new_corba_context(WsnOptimizedNamingImplBase.java:1256)
at com.ibm.WsnOptimizedNaming._NamingContextStub.bind_new_corba_context(Unknown Source)
at com.ibm.ws.naming.jndicos.CNContextImpl.cosBindNewContext(CNContextImpl.java:3470)
at com.ibm.ws.naming.jndicos.CNContextImpl.doCreateSubcontext(CNContextImpl.java:2334)
at com.ibm.ws.naming.jndicos.CNContextImpl.createSubcontext(CNContextImpl.java:819)
at com.ibm.ws.naming.util.WsnInitCtx.createSubcontext(WsnInitCtx.java:232)
at javax.naming.InitialContext.createSubcontext(InitialContext.java:425)
at net.sf.hibernate.util.NamingHelper.bind(NamingHelper.java:69)
at net.sf.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:90)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:172)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:750)
at de.nordlbit.soca.hibernate.test.HibernateAccessServlet.init(HibernateAccessServlet.java:32)
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doInit(StrictServletInstance.java:82)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._init(StrictLifecycleServlet.java:147)
at com.ibm.ws.webcontainer.servlet.PreInitializedServletState.init(StrictLifecycleServlet.java:270)
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.init(StrictLifecycleServlet.java:113)
at com.ibm.ws.webcontainer.servlet.ServletInstance.init(ServletInstance.java:189)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at com.ibm.ws.webcontainer.webapp.WebAppServletManager.addServlet(WebAppServletManager.java:870)
at com.ibm.ws.webcontainer.webapp.WebAppServletManager.loadServlet(WebAppServletManager.java:224)
at com.ibm.ws.webcontainer.webapp.WebAppServletManager.getServletReference(WebAppServletManager.java:455)
at com.ibm.ws.webcontainer.webapp.WebApp.getServletReference(WebApp.java:646)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcherInfo.calculateInfo(WebAppRequestDispatcherInfo.java:188)
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcherInfo.<init>(WebAppRequestDispatcherInfo.java:68)
at com.ibm.ws.webcontainer.webapp.WebApp.getRequestDispatcher(WebApp.java:1455)
at com.ibm.ws.webcontainer.webapp.WebApp.getRequestDispatcher(WebApp.java:1414)
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java:197)
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:71)
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:182)
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java:334)
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java:56)
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:610)
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:431)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)



Then I added two more config parameters "hibernate.jndi.java.naming.security.principal" and "hibernate.jndi.java.naming.security.credentials" to my configuration - No effect.

Any ideas?


Peter


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 03, 2006 9:32 am 
Newbie

Joined: Thu Jun 15, 2006 2:15 pm
Posts: 15
Did you ever figure this out? I have the same problem.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 26, 2007 10:33 am 
Beginner
Beginner

Joined: Thu Feb 08, 2007 10:40 am
Posts: 46
Hey, I have the same problem with WebSphere 6 and enabled security. Anyone can give any help here?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 26, 2007 11:28 pm 
Newbie

Joined: Mon Jan 03, 2005 10:57 pm
Posts: 14
The same problem..... anyone have a solution for it ?

chears


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 06, 2007 3:24 am 
Beginner
Beginner

Joined: Thu Feb 08, 2007 10:40 am
Posts: 46
This problem is still open. Anyone who give a hint please?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 09, 2007 5:23 am 
Beginner
Beginner

Joined: Thu Feb 08, 2007 10:40 am
Posts: 46
BUMP


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 09, 2007 5:32 am 
Beginner
Beginner

Joined: Thu Jan 04, 2007 5:46 am
Posts: 31
Hi
Iam having the same problem i think we two ill solve the problem . u post your java and xml code . let me once.


Top
 Profile  
 
 Post subject: javax.naming.NoPermissionException: NO_PERMISSION
PostPosted: Tue Mar 18, 2008 10:03 am 
Beginner
Beginner

Joined: Wed Aug 09, 2006 12:09 pm
Posts: 20
Location: Belgium
Hello.

Did anyone find a solution to this. I have the same running on WAS 6.1


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 19, 2008 3:50 am 
Beginner
Beginner

Joined: Wed Aug 09, 2006 12:09 pm
Posts: 20
Location: Belgium
OK I have solved my problem.

I am running Hibernate 3 on Websphere 6.1 FP 15, but this should apply to all Websphere as is quite a generic thing.

All I had to do was to give permissions to the administrator for CORBA naming Service.

To do this, in Websphere 6.1 might be different in other versions.

Login to the admin console and go to
Environment > Naming > CORBA Naming Service Users.

Here there were no users assigned in my install so I just added the administrator to have COS naming read/write and create.

I am not 100% sure of the implications of this but it fixed my problem.

cheers
Martin


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 9 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.