-->
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.  [ 5 posts ] 
Author Message
 Post subject: How to bind SessionFactory to JNDI server through BASICAUTH
PostPosted: Wed Feb 06, 2008 11:12 am 
Newbie

Joined: Wed Feb 06, 2008 11:01 am
Posts: 3
Hi,
My hibernate.cfg.xml looks like
----------------
<property name="hibernate.session_factory_name">SessionFactory</property>
<property name="hibernate.connection.datasource">com/DB</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hbm2ddl.auto">validate</property>
<property name="hibernate.current_session_context_class">thread</property>
----------------
Now i am trying to bind the SessionFactory to JNDI also retrieving as follows
sessionFactory = new Configuration().configure(HIBERNATE_CFG_FILE).buildSessionFactory();

Issue
when i am trying to do this i am getting some authentication error as follows
The role-based authorization check failed for naming-authz operation NameServer:rebind_java_object. The user UNAUTHENTICATED (unique ID: unauthenticated) was not granted any of the following required roles: CosNamingCreate, CosNamingDelete, CosNamingWrite.

1-Actually in my server side basic authentication has been set, so my query is should i need to change anything in my src code, to access the same as before authentication it was working fine.
2-Similiary while retrieving the session factory what should be my sample jndi code from context?

Thanks
Sid


Top
 Profile  
 
 Post subject: User and password
PostPosted: Wed Feb 06, 2008 11:44 am 
Newbie

Joined: Mon Jul 09, 2007 10:48 am
Posts: 7
There are 3 options:
1) put username and pasword into your config file:
hibernate.connection.username
hibernate.connection.password
2) put the username and password into JDBC parameters of the data source
3) Set it during building session factory


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 07, 2008 1:12 am 
Newbie

Joined: Wed Feb 06, 2008 11:01 am
Posts: 3
Hi,
Thanks for reply.
Actually i am trying to bind the session factory through JNDI at runtime.
As follows
sessionFactory = new Configuration().configure(HIBERNATE_CFG_FILE).buildSessionFactory();Without auhtentication, this is working fine but with authentication(Basic) it throws permission error.
My query is while dynamically binding during startup how my source code will be changed, only by appending userid and password it does not resolve my problem.

Thanks
Sid


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 07, 2008 1:44 am 
Newbie

Joined: Wed Feb 06, 2008 11:01 am
Posts: 3
Means, whatever the userID and password you have suggested it is for connecting to the DB, but my query is how to connect to was app server with basic authentication on.

Sid


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 05, 2009 4:55 pm 
Newbie

Joined: Wed May 17, 2006 3:45 pm
Posts: 4
Did anyone come up with a solution to this? I have a similar problem converting a WAS50 app to WAS61 with global security enabled.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.