-->
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.  [ 1 post ] 
Author Message
 Post subject: Problem with Hibernate running in Weblogic 8.1 app srv
PostPosted: Mon Nov 21, 2005 6:51 am 
Newbie

Joined: Mon Nov 21, 2005 6:05 am
Posts: 1
Hello,

I'm trying to get Hibernate working from within WebLogic Application Server 8.1. I setup a connection pool in Weblogic so hibernate can use it.

In the hibernate.cfg.xml file I specified the datasource:

Code:
<hibernate-configuration>
   <session-factory>      
      <property name="hibernate.dialect">org.hibernate.dialect.OracleDialect</property>   
      <property name="hibernate.datasource">jdbc/VlimpersDB</property>
      <property name="hibernate.show_sql">true</property>
      <property name="hibernate.cglib.use_reflection_optimizer">false</property>
   </session-factory>
</hibernate-configuration>


Actually we use 2 different Hibernate configurations: one with read write access in the database and the other with only read access. So we set the hibernate properties concerning the database connection when we create the Configuration.
Code:
configurationRW = new Configuration().configure()
         .addClass( ...)
            .setProperty("hibernate.connection.datasource", "jdbc/VlimpersDB")               
         .setProperty("hibernate.dialect", jdbcDialect)         
         .setProperty("hibernate.show_sql", ""+show_sql)   
         .setProperty("hibernate.jdbc.batch_size", "" + getBatchSize());



From the client program I call a session bean which calls hibernate: getting the configuration, creating a sessionfactory and a session and performing a simple lookup of some data.
This is the code from the session bean.

Code:
       log.info("TriggerRecords !!!!!!!!!!!!!!!!!!");
        Vector vector = new Vector();
        SessionFactory sessionFactory = HibernateConnector.getFactoryRW();
        Session session = sessionFactory.openSession();
        log.info("Session retrieved !!!!!!!!!!!!!!!!!!"); 
       
        List list = session.createCriteria(VO_TRIGGERING.class).add(Restrictions.eq("VO_DEL_CHG", "N")).add(
                Restrictions.eq("KEY1", emplid)).list();
        log.info(" list created !!!!!!!!!!!!!!!!!!!!!!");
       
        for (int i = 0; i < list.size(); i++) {
            VO_TRIGGERINGInterface triggering = (VO_TRIGGERINGInterface) list.get(i);
            TriggerData triggerData = new TriggerData("MINVG", triggering.getKEY1(), triggering.getKEY2(), triggering
                    .getBEGIN_DT(), triggering.getEND_DT(), "N");
            vector.addElement(triggerData);
        }
        session.close();
        return vector;



Problem is that I always get the following exception in the logging of the application server:

Code:
21-nov-2005 11:38:43 org.hibernate.cfg.Configuration secondPassCompile
INFO: processing association property references
21-nov-2005 11:38:43 org.hibernate.cfg.Configuration secondPassCompile
INFO: processing foreign key constraints
21-nov-2005 11:38:44 org.hibernate.util.NamingHelper getInitialContext
INFO: JNDI InitialContext properties:{}
21-nov-2005 11:38:44 org.hibernate.connection.DatasourceConnectionProvider configure
INFO: Using datasource: jdbc/VlimpersDB
21-nov-2005 11:38:44 org.hibernate.cfg.SettingsFactory buildSettings
WARNING: Could not obtain connection metadata
java.sql.SQLException: User: sysadm, failed to be authenticated.
        at weblogic.jdbc.common.internal.RmiDataSource.getSubject(Ljava.lang.String;Ljava.lang.String;)Lweblogic.security.acl.internal.AuthenticatedSubject;(RmiDataSource.java:264)

        at weblogic.jdbc.common.internal.RmiDataSource.getConnection(Ljava.lang.String;Ljava.lang.String;)Ljava.sql.Connection;(RmiDataSource.java:195)
        at org.hibernate.connection.DatasourceConnectionProvider.getConnection()Ljava.sql.Connection;(DatasourceConnectionProvider.java:56)
        at org.hibernate.cfg.SettingsFactory.buildSettings(Ljava.util.Properties;)Lorg.hibernate.cfg.Settings;(SettingsFactory.java:72)
        at org.hibernate.cfg.Configuration.buildSettings()Lorg.hibernate.cfg.Settings;(Configuration.java:1463)
        at org.hibernate.cfg.Configuration.buildSessionFactory()Lorg.hibernate.SessionFactory;(Configuration.java:1004)
        at be.test.hibernate.HibernateConnector.configure()V(HibernateConnector.java:198)
        at be.test.hibernate.HibernateConnector.getConnector()Lbe.vlaanderen.et.vlimpers.hibernate.HibernateConnector;(HibernateConnector.java:309)
        at be.test.hibernate.HibernateConnector.getFactoryRW()Lorg.hibernate.SessionFactory;(HibernateConnector.java:327)
        at be.test.triggering.util.testbench.HibernateTestSessionBean.getTriggerRecords(Ljava.lang.String;)Ljava.util.Vector;(HibernateTestSessionBean.java:62)
        at be.test.triggering.util.testbench.ejb_hibernatetest_hcabtw_EOImpl.getTriggerRecords(Ljava.lang.String;)Ljava.util.Vector;(ejb_hibernatetest_hcabtw_EOIm
pl.java:98)
        at be.test.triggering.util.testbench.ejb_hibernatetest_hcabtw_EOImpl_WLSkel.invoke(ILweblogic.rmi.spi.InboundRequest;Lweblogic.rmi.spi.OutboundResponse;Lj
ava.lang.Object;)Lweblogic.rmi.spi.OutboundResponse;(Unknown Source)
        at weblogic.rmi.internal.BasicServerRef.invoke(Lweblogic.rmi.extensions.server.RuntimeMethodDescriptor;Lweblogic.rmi.spi.InboundRequest;Lweblogic.rmi.spi.OutboundResponse;)
V(BasicServerRef.java:477)
        at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(Lweblogic.rmi.extensions.server.RuntimeMethodDescriptor;Lweblogic.rmi.spi.InboundRequest;Lweblogic.rmi.spi.OutboundResp
onse;)V(ReplicaAwareServerRef.java:108)
        at weblogic.rmi.internal.BasicServerRef$1.run()Ljava.lang.Object;(BasicServerRef.java:420)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Lweblogic.security.subject.AbstractSubject;Ljava.security.PrivilegedExceptionAction;)Ljava.lang.Object;(Authenti
catedSubject.java:363)
        at weblogic.security.service.SecurityManager.runAs(Lweblogic.security.acl.internal.AuthenticatedSubject;Lweblogic.security.acl.internal.AuthenticatedSubject;Ljava.security.
PrivilegedExceptionAction;)Ljava.lang.Object;(SecurityManager.java:147)
        at weblogic.rmi.internal.BasicServerRef.handleRequest(Lweblogic.rmi.spi.InboundRequest;)V(BasicServerRef.java:415)
        at weblogic.rmi.internal.BasicExecuteRequest.execute(Lweblogic.kernel.ExecuteThread;)V(BasicExecuteRequest.java:30)
        at weblogic.kernel.ExecuteThread.execute(Lweblogic.kernel.ExecuteRequest;)V(ExecuteThread.java:219)
        at weblogic.kernel.ExecuteThread.run()V(ExecuteThread.java:178)
        at java.lang.Thread.startThreadFromVM(Ljava.lang.Thread;)V(Unknown Source)
21-nov-2005 11:38:44 org.hibernate.dialect.Dialect <init>
INFO: Using dialect: org.hibernate.dialect.OracleDialect
21-nov-2005 11:38:44 org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
INFO: Using default transaction strategy (direct JDBC transactions)
21-nov-2005 11:38:44 org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
21-nov-2005 11:38:44 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic flush during beforeCompletion(): disabled
21-nov-2005 11:38:44 org.hibernate.cfg.SettingsFactory buildSettings
21-nov-2005 11:38:44 org.hibernate.dialect.Dialect <init>
INFO: Using dialect: org.hibernate.dialect.OracleDialect
21-nov-2005 11:38:44 org.hibernate.transaction.TransactionFactoryFactory buildTransactionFactory
INFO: Using default transaction strategy (direct JDBC transactions)
21-nov-2005 11:38:44 org.hibernate.transaction.TransactionManagerLookupFactory getTransactionManagerLookup
INFO: No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
21-nov-2005 11:38:44 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic flush during beforeCompletion(): disabled
21-nov-2005 11:38:44 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Automatic session close at end of transaction: disabled
21-nov-2005 11:38:44 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Scrollable result sets: disabled
21-nov-2005 11:38:44 org.hibernate.cfg.SettingsFactory buildSettings
INFO: JDBC3 getGeneratedKeys(): disabled
21-nov-2005 11:38:44 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Connection release mode: null
21-nov-2005 11:38:44 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default batch fetch size: 1
21-nov-2005 11:38:44 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Generate SQL with comments: disabled
21-nov-2005 11:38:44 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Order SQL updates by primary key: disabled
21-nov-2005 11:38:44 org.hibernate.cfg.SettingsFactory createQueryTranslatorFactory
INFO: Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
21-nov-2005 11:38:44 org.hibernate.hql.ast.ASTQueryTranslatorFactory <init>
INFO: Using ASTQueryTranslatorFactory
21-nov-2005 11:38:44 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query language substitutions: {}
21-nov-2005 11:38:44 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Second-level cache: enabled
21-nov-2005 11:38:44 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Query cache: disabled
21-nov-2005 11:38:44 org.hibernate.cfg.SettingsFactory createCacheProvider
INFO: Cache provider: org.hibernate.cache.EhCacheProvider
21-nov-2005 11:38:44 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Optimize cache for minimal puts: disabled
21-nov-2005 11:38:44 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Structured second-level cache entries: disabled
21-nov-2005 11:38:44 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Echoing all SQL to stdout
21-nov-2005 11:38:44 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Statistics: disabled
21-nov-2005 11:38:44 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Deleted entity synthetic identifier rollback: disabled
21-nov-2005 11:38:44 org.hibernate.cfg.SettingsFactory buildSettings
INFO: Default entity-mode: pojo
21-nov-2005 11:38:44 org.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
21-nov-2005 11:38:44 org.hibernate.impl.SessionFactoryObjectFactory addInstance
INFO: Not binding factory to JNDI, no JNDI name configured
21-nov-2005 11:38:44 org.hibernate.impl.SessionFactoryImpl checkNamedQueries
INFO: Checking 0 named queries
21-nov-2005 11:38:44 be.test.hibernate.HibernateConnector configure
INFO: READ WRITE FACTORY CREATED !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
21-nov-2005 11:38:44 be.test.triggering.util.testbench.HibernateTestSessionBean getTriggerRecords
INFO: Session retrieved !!!!!!!!!!!!!!!!!!
21-nov-2005 11:38:44 org.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 0, SQLState: null
21-nov-2005 11:38:44 org.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: User: sysadm, failed to be authenticated.


Using hibernate configuration which doesn't connect to the DB through the connectionpool works fine. So the user has enough rights on the DB to connect to it. I also tested the datasource itself with a simple client program which looks up the datasource and perform a simple look up of some data and this is also working.

At this moment I don't know what's wrong. Can somebody give me some help on this?


Thanks a lot,

Dries


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

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.