-->
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.  [ 14 posts ] 
Author Message
 Post subject: Help !Help!
PostPosted: Thu Mar 17, 2005 8:44 am 
Newbie

Joined: Thu Mar 17, 2005 7:00 am
Posts: 8
Hibernate version:3.0


sessionFactory = new Configuration().configure().buildSessionFactory();


java.lang.NoClassDefFoundError
org.hibernate.mapping.SimpleValue.createIdentifierGenerator(SimpleValue.java:111)
org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:166)
org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1043)
com.yourcompany.struts.action.LoginAction.execute(LoginAction.java:56)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
[b]

[b]database:Oracle9


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 9:59 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
so you are missing a class .... add all dependent jars to the classpath.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 12:18 pm 
Newbie

Joined: Thu Mar 17, 2005 7:00 am
Posts: 8
I have done,but it doesn't work...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 12:21 pm 
Newbie

Joined: Thu Mar 17, 2005 7:00 am
Posts: 8
max wrote:
so you are missing a class .... add all dependent jars to the classpath.

Thank you for your help!!
what's the jars i need?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 12:26 pm 
Expert
Expert

Joined: Fri Nov 07, 2003 4:24 am
Posts: 315
Location: Cape Town, South Africa
Are you using a foreign identifier on a one-to-one relationship and have failed to specify a property? Your mappings may help


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 12:28 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
all jars from hibernate distribution


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 12:40 pm 
Newbie

Joined: Thu Mar 17, 2005 7:00 am
Posts: 8
I'm a fresh ,this is my first project...

Users.hbm.xml
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
<!--
Auto-generated mapping file from
the hibernate.org cfg2hbm engine
-->
<class
name="com.test.Users"
table="USERS"
schema="HISIGNMIS"
>
<id
name="Id"
type="java.math.BigDecimal"
>
<column name="ID" length="22" not-null="true" unique="true" sql-type="NUMBER" />
<generator class="assigned" />
</id>

<property
name="Username"
type="java.lang.String"
>
<column name="USERNAME" length="20" not-null="false" sql-type="VARCHAR2" />
</property>

<property
name="Pwd"
type="java.lang.String"
>
<column name="PWD" length="20" not-null="false" sql-type="VARCHAR2" />
</property>

</class>
</hibernate-mapping>

Action

public ActionForward execute(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response)
{
LoginForm loginForm = (LoginForm) form;
ActionMessages errors = new ActionMessages();
SessionFactory sessionFactory;
try
{
sessionFactory = new Configuration().configure().buildSessionFactory();
}
catch (Exception ex)
{
errors.add("msg",new ActionMessage("failure"));
saveMessages(request,errors);
return mapping.getInputForward();
}
Session session = (Session)(new ThreadLocal().get());
if(session != null)
{
try
{
session = sessionFactory.openSession();

Users user = new Users();
user.setId(loginForm.getId());
user.setPwd(loginForm.getPwd());
user.setUsername(loginForm.getUsername());
session.save(user);
errors.add("msg",new ActionMessage("success"));
saveMessages(request,errors);
return mapping.getInputForward();
}
catch(Exception e){}
}
errors.add("msg",new ActionMessage("failure"));
saveMessages(request,errors);
return mapping.getInputForward();
}


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 12:47 pm 
Expert
Expert

Joined: Fri Nov 07, 2003 4:24 am
Posts: 315
Location: Cape Town, South Africa
...and you have all the lib jars (in the lib folder) + the hibernate2.jar on your classpath?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 12:55 pm 
Newbie

Joined: Thu Mar 17, 2005 7:00 am
Posts: 8
drj wrote:
...and you have all the lib jars (in the lib folder) + the hibernate2.jar on your classpath?


Why you know this????


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 1:01 pm 
Expert
Expert

Joined: Fri Nov 07, 2003 4:24 am
Posts: 315
Location: Cape Town, South Africa
?? Not sure what you mean.

You need to work out which class is not found. Once you have this information let us know.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 1:03 pm 
Newbie

Joined: Thu Mar 17, 2005 7:00 am
Posts: 8
Thank you ,I'm finding it now...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 1:04 pm 
Expert
Expert

Joined: Sat Jun 12, 2004 4:49 pm
Posts: 915
Quote:
Why you know this????


you have to read documentation


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 1:07 pm 
Newbie

Joined: Thu Mar 17, 2005 7:00 am
Posts: 8
A little...


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 17, 2005 11:13 pm 
Newbie

Joined: Thu Mar 17, 2005 7:00 am
Posts: 8
It's working...
:-)


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