Highlights of problems and solutions in STRUTS + spring + hibernate project framework construction (2)

Source: Internet
Author: User

Struts1.2 + spring2.0 + hibernate3.1 highlights of problems and solutions in project framework construction (2)

There are two bugs in the process of building a project using MySQL as a database:

Severe: servlet. Service () for servlet JSP threw exception
Javax. servlet. jsp. jspexception: No getter Method for property userid of bean org.apache.struts.taglib.html. Bean
 At org. Apache. Struts. taglib. tagutils. Lookup(Labutils. Java: 973)
At org.apache.struts.taglib.html. basefieldtag. preparevalue (basefieldtag. Java: 121)
At org.apache.struts.taglib.html. basefieldtag. renderinputelement (basefieldtag. Java: 102)
At org.apache.struts.taglib.html. basefieldtag. dostarttag (basefieldtag. Java: 81)
At org. Apache. jsp. modules. login_jsp. _ jspx_meth_html_005ftext_005f0 (login_jsp.java: 228)
At org. Apache. jsp. modules. login_jsp. _ jspx_meth_html_005fform_005f0 (login_jsp.java: 169)
At org. Apache. jsp. modules. login_jsp. _ jspx_meth_html_005fhtml_005f0 (login_jsp.java: 130)
At org. Apache. jsp. modules. login_jsp. _ jspservice (login_jsp.java: 83)
At org. Apache. Jasper. runtime. httpjspbase. Service (httpjspbase. Java: 70)
At javax. servlet. http. httpservlet. Service (httpservlet. Java: 803)
At org. Apache. Jasper. servlet. jspservletwrapper. Service (jspservletwrapper. Java: 384)
At org. Apache. Jasper. servlet. jspservlet. servicejspfile (jspservlet. Java: 320)
At org. Apache. Jasper. servlet. jspservlet. Service (jspservlet. Java: 266)
At javax. servlet. http. httpservlet. Service (httpservlet. Java: 803)
At org. Apache. Catalina. Core. applicationfilterchain. internaldofilter (applicationfilterchain. Java: 290)
At org. Apache. Catalina. Core. applicationfilterchain. dofilter (applicationfilterchain. Java: 206)
At org. Apache. Catalina. Core. applicationdispatcher. Invoke (applicationdispatcher. Java: 687)
At org. Apache. Catalina. Core. applicationdispatcher. processrequest (applicationdispatcher. Java: 469)
At org. Apache. Catalina. Core. applicationdispatcher. doforward (applicationdispatcher. Java: 403)
At org. Apache. Catalina. Core. applicationdispatcher. Forward (applicationdispatcher. Java: 301)
At com. morecans. Test. loginfilter. dofilter (loginfilter. Java: 34)
At org. Apache. Catalina. Core. applicationfilterchain. internaldofilter (applicationfilterchain. Java: 235)
At org. Apache. Catalina. Core. applicationfilterchain. dofilter (applicationfilterchain. Java: 206)
At org. Apache. Catalina. Core. standardwrappervalve. Invoke (standardwrappervalve. Java: 228)
At org. Apache. Catalina. Core. standardcontextvalve. Invoke (standardcontextvalve. Java: 175)
At org. Apache. Catalina. Core. standardhostvalve. Invoke (standardhostvalve. Java: 128)
At org. Apache. Catalina. Valves. errorreportvalve. Invoke (errorreportvalve. Java: 104)
At org. Apache. Catalina. Core. standardenginevalve. Invoke (standardenginevalve. Java: 109)
At org. Apache. Catalina. connector. coyoteadapter. Service (coyoteadapter. Java: 216)
At org. Apache. Coyote. http11.http11processor. Process (http11processor. Java: 844)
At org. Apache. Coyote. http11.http11protocol $ http11connectionhandler. Process (http11protocol. Java: 634)
At org.apache.tomcat.util.net. jioendpoint $ worker. Run (jioendpoint. Java: 445)
At java. Lang. thread. Run (thread. Java: 619)
2007-7-15 15:05:10 org. Apache. Catalina. Core. standardwrappervalve invoke

Analysis:
No getter Method for property userid of bean org.apache.struts.taglib.html. bean indicates in modules. login. the USERID attribute in the Form Design in JSP cannot be found in the corresponding actionform bean or the setter/getter Method

Solution:
Add the corresponding attributes and setter/getter methods to the actionform bean.

Severe: servlet. Service () for servlet action threw exception
Java. SQL. sqlexception: Table 'morecans. morecans _ customer' doesn' t exist
 At com. MySQL. JDBC. mysqlio. checkerrorpacket(Mysqlio. Java: 2926)
At com. MySQL. JDBC. mysqlio. sendcommand (mysqlio. Java: 1571)
At com. MySQL. JDBC. mysqlio. sqlquerydirect (mysqlio. Java: 1666)
At com.mysql.jdbc.connection.exe csql (connection. Java: 2978)
At com.mysql.jdbc.connection.exe csql (connection. Java: 2902)
At com.mysql.jdbc.preparedstatement.exe cuteinternal (preparedstatement. Java: 933)
At com.mysql.jdbc.preparedstatement.exe cutequery (preparedstatement. Java: 1027)
At org.apache.commons.dbcp.delegatingpreparedstatement.exe cutequery (delegatingpreparedstatement. Java: 92)
At org. hibernate. JDBC. abstractbatcher. getresultset (abstractbatcher. Java: 120)
At org. hibernate. loader. loader. getresultset (loader. Java: 1272)
At org. hibernate. loader. loader. docquery (loader. Java: 391)
At org. hibernate. loader. loader. doqueryandinitializenonlazycollections (loader. Java: 218)
At org. hibernate. loader. loader. loadentity (loader. Java: 1345)
At org. hibernate. loader. entity. entityloader. Load (entityloader. Java: 116)
At org. hibernate. loader. entity. entityloader. Load (entityloader. Java: 101)
At org. hibernate. persister. entity. basicentitypersister. Load (basicentitypersister. Java: 2471)
At org. hibernate. event. Def. defaultloadeventlistener. loadfromdatasource (defaloadloadeventlistener. Java: 351)
At org. hibernate. event. Def. defaultloadeventlistener. doload (defaultloadeventlistener. Java: 332)
At org. hibernate. event. Def. defaultloadeventlistener. Load (defaultloadeventlistener. Java: 113)
At org. hibernate. event. Def. defaultloadeventlistener. proxyorload (defaloadloadeventlistener. Java: 167)
At org. hibernate. event. Def. defaultloadeventlistener. onload (defaultloadeventlistener. Java: 79)
At org. hibernate. impl. sessionimpl. Get (sessionimpl. Java: 621)
At org. springframework. Orm. hibernate3.hibernatetemplate $2. doinhibernate (hibernatetemplate. Java: 489)
At org.springframework.orm.hibernate3.hibernatetemplate.exe cute (hibernatetemplate. Java: 372)
At org. springframework. Orm. hibernate3.hibernatetemplate. Get (hibernatetemplate. Java: 483)
At org. springframework. Orm. hibernate3.hibernatetemplate. Get (hibernatetemplate. Java: 477)
At com. morecans. Test. pojo. customerdao. findbyid (customerdao. Java: 53)
At com.morecans.test.struts.action.loginaction.exe cute (loginaction. Java: 74)
At org.springframework.web.struts.delegatingactionproxy.exe cute (delegatingactionproxy. Java: 110)
At org. Apache. Struts. Action. requestprocessor. processactionperform (requestprocessor. Java: 419)
At org. Apache. Struts. Action. requestprocessor. Process (requestprocessor. Java: 224)
At org. Apache. Struts. Action. actionservlet. Process (actionservlet. Java: 1194)
At org. Apache. Struts. Action. actionservlet. dopost (actionservlet. Java: 432)
At javax. servlet. http. httpservlet. Service (httpservlet. Java: 710)
At javax. servlet. http. httpservlet. Service (httpservlet. Java: 803)
At org. Apache. Catalina. Core. applicationfilterchain. internaldofilter (applicationfilterchain. Java: 290)
At org. Apache. Catalina. Core. applicationfilterchain. dofilter (applicationfilterchain. Java: 206)
At com. morecans. Test. encodingfilter. dofilter (encodingfilter. Java: 27)
At org. Apache. Catalina. Core. applicationfilterchain. internaldofilter (applicationfilterchain. Java: 235)
At org. Apache. Catalina. Core. applicationfilterchain. dofilter (applicationfilterchain. Java: 206)
At com. morecans. Test. loginfilter. dofilter (loginfilter. Java: 32)
At org. Apache. Catalina. Core. applicationfilterchain. internaldofilter (applicationfilterchain. Java: 235)
At org. Apache. Catalina. Core. applicationfilterchain. dofilter (applicationfilterchain. Java: 206)
At org. Apache. Catalina. Core. standardwrappervalve. Invoke (standardwrappervalve. Java: 228)
At org. Apache. Catalina. Core. standardcontextvalve. Invoke (standardcontextvalve. Java: 175)
At org. Apache. Catalina. Core. standardhostvalve. Invoke (standardhostvalve. Java: 128)
At org. Apache. Catalina. Valves. errorreportvalve. Invoke (errorreportvalve. Java: 104)
At org. Apache. Catalina. Core. standardenginevalve. Invoke (standardenginevalve. Java: 109)
At org. Apache. Catalina. connector. coyoteadapter. Service (coyoteadapter. Java: 216)
At org. Apache. Coyote. http11.http11processor. Process (http11processor. Java: 844)
At org. Apache. Coyote. http11.http11protocol $ http11connectionhandler. Process (http11protocol. Java: 634)
At org.apache.tomcat.util.net. jioendpoint $ worker. Run (jioendpoint. Java: 445)
At java. Lang. thread. Run (thread. Java: 619)

Analysis:
Table 'morecans. morecans _ customer' doesn' t exist indicates that hibernate cannot find the customer table. Here, the data table cannot be found because the database name morecans must be provided when connecting to MySQL.

Solution:
Remove customer. HBM. <class name = "com. morecans. test. pojo. customer "table =" customer "catalog =" morecans "> catalog =" morecans, you can solve this problem.

Related Resources:Highlights of problems and solutions in STRUTS + spring + hibernate project framework construction (1)

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.