-->
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.  [ 10 posts ] 
Author Message
 Post subject: Sessionfactory error: com/suncrypto/provider/SunJCE
PostPosted: Wed Mar 01, 2006 1:32 pm 
Beginner
Beginner

Joined: Mon Mar 22, 2004 9:37 am
Posts: 22
Location: Willow Grove, PA
Hibernate console does not seem able to create a session factory
(version 3.1.0.beta4).

I do have an encrypted property that indirectly makes use of this class.
(or perhaps hibernate tools need jce.jar as well?)
e.g.
Code:
  <property
        name="password"
        type="java.lang.String"
        column="PASSWORD"
        length="128"
        access="com.diamondip.common.orm.hibernate.EncryptedProperty"
    />


jce is part of the jre. Eclipse builds my project fine. Is there a reason hibernate console fouls up on this?

I even added /usr/java/jdk1.5.0/jre/lib/jce.jar to the console config's classpath.

Thanks,

Matt


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 01, 2006 1:57 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
what is the full stacktrace ?

it should just work assuming it (and all its dependencies) is in the classpath.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 01, 2006 2:16 pm 
Beginner
Beginner

Joined: Mon Mar 22, 2004 9:37 am
Posts: 22
Location: Willow Grove, PA
hibernate-tools.log is not showing any stack traces. Is this the log I should be looking at?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 01, 2006 2:19 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
you say you get an error in eclipse, right ? then the eclipse log view should have something...

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 01, 2006 2:27 pm 
Beginner
Beginner

Joined: Mon Mar 22, 2004 9:37 am
Posts: 22
Location: Willow Grove, PA
max wrote:
you say you get an error in eclipse, right ? then the eclipse log view should have something...

Got it.


!ENTRY org.hibernate.eclipse.console 4 4 2006-03-01 18:17:05.738
!MESSAGE Problems while creating sessionfactory
!STACK 0
java.lang.NoClassDefFoundError: com/sun/crypto/provider/SunJCE
at com.diamondip.common.orm.hibernate.EncryptedProperty$EncryptedGetter.<init>(EncryptedProperty.java:69)
at com.diamondip.common.orm.hibernate.EncryptedProperty.getGetter(EncryptedProperty.java:219)
at org.hibernate.mapping.Property.getGetter(Property.java:251)
at org.hibernate.tuple.PojoEntityTuplizer.buildPropertyGetter(PojoEntityTuplizer.java:255)
at org.hibernate.tuple.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:121)
at org.hibernate.tuple.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55)
at org.hibernate.tuple.TuplizerLookup.create(TuplizerLookup.java:64)
at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:257)
at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:412)
at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:108)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:215)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)
at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:265)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:35)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:68)
at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:260)
at org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter.getChildren(ConsoleConfigurationWorkbenchAdapter.java:24)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:70)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:192)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
!SUBENTRY 1 org.hibernate.eclipse.console 4 150 2006-03-01 18:17:05.739


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 01, 2006 2:45 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm...are you running eclipse with a jdk 1.5 ?

NoClassDefFoundError hints that the jce.jar you added depends on classes found in the bootclasspath....so most likely you need to run it with a jdk that hads jce in the boot classpath too (and remove it from the console configuraiton classpath)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 01, 2006 2:57 pm 
Beginner
Beginner

Joined: Mon Mar 22, 2004 9:37 am
Posts: 22
Location: Willow Grove, PA
max wrote:
hmm...are you running eclipse with a jdk 1.5 ?

NoClassDefFoundError hints that the jce.jar you added depends on classes found in the bootclasspath....so most likely you need to run it with a jdk that hads jce in the boot classpath too (and remove it from the console configuraiton classpath)


thanks

I have sunjce_provider.jar in /usr/java/jdk1.5.0/jre/lib/ext/sunjce_provider.jar
(which works for tomcat/other startups)

It was fixed by adding /usr/java/jdk1.5.0/jre/lib/ext/sunjce_provider.jar to the classpath in the hibernate console configuration. Only confusing part is that the label reads that is only for (pojos and drivers).

Thanks for you help,

Matt


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 01, 2006 3:19 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
"for POJO" meaning "whatever needed to load the POJO"...

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 01, 2006 3:41 pm 
Beginner
Beginner

Joined: Mon Mar 22, 2004 9:37 am
Posts: 22
Location: Willow Grove, PA
^ Okay, I understand how to get this to work.

The POJO does not reference these classes. Its the accessor mapped in the xml document that does.

Maybe a documentation note could be made of it?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 01, 2006 4:05 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
documentation patches is also very welcome ;)

_________________
Max
Don't forget to rate


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