-->
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.  [ 2 posts ] 
Author Message
 Post subject: Exception when using Hibernate3 and Tapestry,wl shutdown ;-(
PostPosted: Sat Jul 09, 2005 9:46 pm 
Senior
Senior

Joined: Wed Dec 17, 2003 4:24 am
Posts: 188
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

3.0.5

<hibernate-mapping package="lyo.test.domain">
<class
name="Author"
table="author"
>
<id
name="id"
type="string"
column="AUTHOR_ID"
>
<generator class="uuid.hex"/>
</id>

<property
name="authorSex"
column="AUTHOR_SEX"
type="string"
not-null="false"
length="1"
/>
<property
name="authorJoinTime"
column="AUTHOR_JOIN_TIME"
type="timestamp"
not-null="false"
length="19"
/>
<property
name="authorEmail"
column="AUTHOR_EMAIL"
type="string"
not-null="false"
length="100"
/>
<property
name="authorHabit"
column="AUTHOR_HABIT"
type="string"
not-null="false"
length="200"
/>
<property
name="authorProvince"
column="AUTHOR_PROVINCE"
type="string"
not-null="false"
length="50"
/>
<property
name="authorName"
column="AUTHOR_NAME"
type="string"
not-null="false"
length="40"
/>
<property
name="authorPassword"
column="AUTHOR_PASSWORD"
type="string"
not-null="false"
length="40"
/>
<property
name="authorAge"
column="AUTHOR_AGE"
type="integer"
not-null="false"
length="11"
/>

<set
inverse="true"
lazy="true"
name="articleSet"
>
<key column="AUTHOR_ID" />
<one-to-many class="Article" />
</set>

<set
inverse="true"
lazy="true"
name="pictureSet"
>
<key column="PICTURE_ID" />
<one-to-many class="Picture" />
</set>



</class>
</hibernate-mapping>
:


public Author findAuthor(String username, String password) {
List list= this.getHibernateTemplate().find("from Author a where a.authorName='"+username+"' and a.authorPassword='"+password+"'");
Author au=null;
if(null!=list&&!list.isEmpty()){
au=(Author)list.get(0);
}
return au;
}


started in RUNNING mode>
<2005-7-10 上午09时28分06秒 CST> <Notice> <WebLogicServer> <BEA-000355> <Thread
"ListenThread.Default" listening on port 7001, ip address *.*>
<2005-7-10 上午09时29分06秒 CST> <Warning> <HTTP> <BEA-101248> <[null]: Deployme
nt descriptor "web.xml" is malformed. Check against the DTD: org.xml.sax.SAXPars
eException: The content of element type "web-app" must match "(icon?,display-nam
e?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,
servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error
-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*,login-config
?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)". (line 43, column 11).>
Get username: yo
2005-07-10 09:33:12,810 [ExecuteThread: '14' for queue: 'weblogic.kernel.Default
'] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - Loading
XML bean definitions from class path resource [org/springframework/jdbc/support
/sql-error-codes.xml]
2005-07-10 09:33:12,840 [ExecuteThread: '14' for queue: 'weblogic.kernel.Default
'] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory -
Creating shared instance of singleton bean 'DB2'
2005-07-10 09:33:12,860 [ExecuteThread: '14' for queue: 'weblogic.kernel.Default
'] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory -
Creating shared instance of singleton bean 'HSQL'
2005-07-10 09:33:12,860 [ExecuteThread: '14' for queue: 'weblogic.kernel.Default
'] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory -
Creating shared instance of singleton bean 'MS-SQL'
2005-07-10 09:33:12,860 [ExecuteThread: '14' for queue: 'weblogic.kernel.Default
'] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory -
Creating shared instance of singleton bean 'MySQL'
2005-07-10 09:33:12,870 [ExecuteThread: '14' for queue: 'weblogic.kernel.Default
'] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory -
Creating shared instance of singleton bean 'Oracle'
2005-07-10 09:33:12,870 [ExecuteThread: '14' for queue: 'weblogic.kernel.Default
'] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory -
Creating shared instance of singleton bean 'Informix'
2005-07-10 09:33:12,870 [ExecuteThread: '14' for queue: 'weblogic.kernel.Default
'] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory -
Creating shared instance of singleton bean 'PostgreSQL'
2005-07-10 09:33:12,880 [ExecuteThread: '14' for queue: 'weblogic.kernel.Default
'] INFO org.springframework.beans.factory.support.DefaultListableBeanFactory -
Creating shared instance of singleton bean 'Sybase'
2005-07-10 09:33:12,890 [ExecuteThread: '14' for queue: 'weblogic.kernel.Default
'] INFO org.springframework.jdbc.support.SQLErrorCodesFactory - SQLErrorCodes l
oaded: [DB2, HSQL, MS-SQL, MySQL, Oracle, Informix, PostgreSQL, Sybase]
CharScanner; panic: ClassNotFoundException: org.hibernate.hql.ast.HqlToken


MySQL 4.1

NO

INFO:
Tapestry code is:
Code:
public void doLogon(IRequestCycle cycle){
      System.out.println("Get username: "+this.getUsername());
      Author au=this.getUserDao().findAuthor(this.getUsername(),this.getPassword());
      if(null!=au){
         Visit v=(Visit)this.getVisit();
         v.setUsername(au.getAuthorName());
         v.setPassword(au.getAuthorPassword());
         cycle.activate("main");
      }else{
         this.setErrorMessage("³ö´íÁË:error in logon!");
         cycle.activate("logon");
      }
   }



When this Exception happen,weblogic8.1 shutdown!? But this application could run in Tomcat5.0 property,why it couldn't find the HqlToken class in Weblogic8? What's meaning of this sentence ?


Code:
CharScanner; panic: ClassNotFoundException: org.hibernate.hql.ast.HqlToken

Thks![/code]

_________________
You are not alone...


Top
 Profile  
 
 Post subject: Because of this?
PostPosted: Sat Jul 09, 2005 9:56 pm 
Senior
Senior

Joined: Wed Dec 17, 2003 4:24 am
Posts: 188
Code:
BEA Weblogic issues
Hibernate3 uses ANTLR for the new query parser. Unfortunately BEA Weblogic includes a version of ANTLR in the system classpath which will be loaded before any application libraries and, because Weblog doesn't seem to support propert class loader isolation, will not see the Hibernate classes in the application's context. BEA seems to solve this issue by prefixing package names, but the distributed ANTLR doesn't have this prefix. Another source for this issue is the usage of Class.forName() in ANTLR itself.

Until both parties have solved these issues we can only provide workarounds: Place all your Hibernate and dependent libraries on the application server's boot classpath or use the old query parser as described above.

The Hibernate Team has send a fix for this issue to the ANTLR developers, and it should be included in the next release. We'll distribute this new version with a minor release of Hibernate in the next few weeks or months. For now we distribute a patched version of ANTLR with Hibernate 3.0 which uses the context classloader instead of Class.forName().

The Weblogic classloading and/or package prefix issues are unfortunately out of our reach. We encourage you to contact your BEA support representative.



Should I add all hibernate and dependences jar to startweblogic.cmd? :-(

_________________
You are not alone...


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