发帖    主题    评论    推荐    标签    作者    订阅    查搜    注册   登陆   关注
 
面向对象 设计模式 领域驱动设计 企业架构 框架 开发教程 微服务 大数据 扩展性 并发编程 事件驱动 分布式 SOA
1 2 3 4 ... 7 下一页 Go 7

《JdonFramework 5.1发布》中案例错误的改正

    
2008-02-29 09:58
赞助商链接

文章《JdonFramework 5.1发布》中案例 http://www.jdon.com/jdonframework/download/samples_hibernate.zip
有错误,错误是这个案例中的 /WEB-INF/web.xml 有些错误的代码:


<servlet>
<servlet-name>myServlet</servlet-name>
<servlet-class>sample.MyServlet</servlet-class>
</servlet>




<servlet-mapping>
<servlet-name>myServlet</servlet-name>
<url-pattern>/mys</url-pattern>
</servlet-mapping>

这里提供的 servlet 在案例中并不存在,我想可能是测试时的代码。删除后案例可以运行。但配置的log仍然会出错。
[该贴被lqixv于2008-02-29 10:00修改过]

2008-02-29 14:15

可以运行了,但却无法插入数据。错误如下:


14:00:09,453 INFO [STDOUT] 14:00:09,453 INFO [ContainerDirector] <======== Jdon Framework started successfully! =========>
14:00:09,656 INFO [Version] Hibernate Annotations 3.2.1.GA
14:00:09,734 INFO [Environment] Hibernate 3.2.5
14:00:09,765 INFO [Environment] hibernate.properties not found
14:00:09,781 INFO [Environment] Bytecode provider name : javassist
14:00:09,796 INFO [Environment] using JDK 1.4 java.sql.Timestamp handling
14:00:10,265 INFO [Configuration] configuring from resource: /hibernate.cfg.xml
14:00:10,265 INFO [Configuration] Configuration resource: /hibernate.cfg.xml
14:00:10,546 INFO [Configuration] Reading mappings from resource : sample/model/User.hbm.xml
14:00:10,656 INFO [Configuration] Reading mappings from resource : sample/model/Dept.hbm.xml
14:00:10,671 INFO [Configuration] Reading mappings from resource : sample/model/Address.hbm.xml
14:00:10,718 INFO [Configuration] Reading mappings from resource : sample/model/Property.hbm.xml
14:00:10,718 INFO [Configuration] Configured SessionFactory: null
14:00:11,078 INFO [HbmBinder] Mapping class: sample.model.User -> nec_userb
14:00:11,562 INFO [HbmBinder] Mapping class: sample.model.Dept -> nec_dept
14:00:11,578 INFO [HbmBinder] Mapping class: sample.model.Address -> nec_address
14:00:11,593 INFO [HbmBinder] Mapping class: sample.model.Property -> nec_property
14:00:11,625 INFO [HbmBinder] Mapping collection: sample.model.User.properties -> nec_property
14:00:13,093 INFO [DriverManagerConnectionProvider] Using Hibernate built-in connection pool (not for production use!)
14:00:13,093 INFO [DriverManagerConnectionProvider] Hibernate connection pool size: 20
14:00:13,093 INFO [DriverManagerConnectionProvider] autocommit mode: false
14:00:13,109 INFO [DriverManagerConnectionProvider] using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:3306/test
14:00:13,109 INFO [DriverManagerConnectionProvider] connection properties: {user=test, password=test}
14:00:14,078 INFO [SettingsFactory] RDBMS: MySQL, version: 5.1.20-beta-community-nt-debug
14:00:14,078 INFO [SettingsFactory] JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.0.7 ( $Date: 2007-03-09 22:13:57 +0100 (Fri, 09 Mar 2007) $, $Revision: 6341 $ )
14:00:14,171 INFO [Dialect] Using dialect: org.hibernate.dialect.MySQLDialect
14:00:14,218 INFO [TransactionFactoryFactory] Using default transaction strategy (direct JDBC transactions)
14:00:14,234 INFO [TransactionManagerLookupFactory] No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
14:00:14,234 INFO [SettingsFactory] Automatic flush during beforeCompletion(): disabled
14:00:14,234 INFO [SettingsFactory] Automatic session close at end of transaction: disabled
14:00:14,234 INFO [SettingsFactory] JDBC batch size: 15

2008-02-29 14:16



14:00:14,234 INFO [SettingsFactory] JDBC batch updates for versioned data: disabled
14:00:14,234 INFO [SettingsFactory] Scrollable result sets: enabled
14:00:14,234 INFO [SettingsFactory] JDBC3 getGeneratedKeys(): enabled
14:00:14,234 INFO [SettingsFactory] Connection release mode: auto
14:00:14,250 INFO [SettingsFactory] Maximum outer join fetch depth: 2
14:00:14,250 INFO [SettingsFactory] Default batch fetch size: 1
14:00:14,250 INFO [SettingsFactory] Generate SQL with comments: disabled
14:00:14,250 INFO [SettingsFactory] Order SQL updates by primary key: disabled
14:00:14,250 INFO [SettingsFactory] Order SQL inserts for batching: disabled
14:00:14,250 INFO [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
14:00:14,265 INFO [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
14:00:14,265 INFO [SettingsFactory] Query language substitutions: {}
14:00:14,265 INFO [SettingsFactory] JPA-QL strict compliance: disabled
14:00:14,265 INFO [SettingsFactory] Second-level cache: enabled
14:00:14,265 INFO [SettingsFactory] Query cache: enabled
14:00:14,265 INFO [SettingsFactory] Cache provider: org.hibernate.cache.EhCacheProvider
14:00:14,281 INFO [SettingsFactory] Optimize cache for minimal puts: disabled
14:00:14,281 INFO [SettingsFactory] Structured second-level cache entries: disabled
14:00:14,281 INFO [SettingsFactory] Query cache factory: org.hibernate.cache.StandardQueryCacheFactory
14:00:14,328 INFO [SettingsFactory] Echoing all SQL to stdout
14:00:14,328 INFO [SettingsFactory] Statistics: disabled
14:00:14,328 INFO [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
14:00:14,328 INFO [SettingsFactory] Default entity-mode: pojo
14:00:14,328 INFO [SettingsFactory] Named query checking : enabled
14:00:14,484 INFO [SessionFactoryImpl] building session factory
14:00:14,546 WARN [ConfigurationFactory] No configuration found. Configuring ehcache from ehcache-failsafe.xml found in the classpath: jar:file:/D:/jboss-4.0.4.GA/server/default/tmp/deploy/tmp62334msweb-exp.war/WEB-INF/lib/ehcache-1.2.3.jar!/ehcache-failsafe.xml
14:00:16,265 INFO [SessionFactoryObjectFactory] Not binding factory to JNDI, no JNDI name configured
14:00:16,281 INFO [SchemaUpdate] Running hbm2ddl schema update
14:00:16,281 INFO [SchemaUpdate] fetching database metadata
14:00:16,296 INFO [SchemaUpdate] updating schema
14:00:16,421 INFO [TableMetadata] table found: test.nec_address
14:00:16,421 INFO [TableMetadata] columns: [name, id]
14:00:16,421 INFO [TableMetadata] foreign keys: []
14:00:16,421 INFO [TableMetadata] indexes: [primary]
14:00:16,468 INFO [TableMetadata] table found: test.nec_dept
14:00:16,468 INFO [TableMetadata] columns: [name, id]
14:00:16,468 INFO [TableMetadata] foreign keys: []
14:00:16,468 INFO [TableMetadata] indexes: [primary]
14:00:16,531 INFO [TableMetadata] table found: test.nec_property
14:00:16,531 INFO [TableMetadata] columns: [userid, value, name, id]
14:00:16,531 INFO [TableMetadata] foreign keys: [fk4f2963287a60bc7a]
14:00:16,531 INFO [TableMetadata] indexes: [fk4f2963287a60bc7a, primary]
14:00:16,593 INFO [TableMetadata] table found: test.nec_userb
14:00:16,593 INFO [TableMetadata] columns: [deptid, name, id, addressid]
14:00:16,593 INFO [TableMetadata] foreign keys: [fkcf0a4184230b00da, fkcf0a41845c962aee]
14:00:16,593 INFO [TableMetadata] indexes: [fkcf0a4184230b00da, primary, fkcf0a41845c962aee, addressid]
14:00:16,593 INFO [SchemaUpdate] schema update complete

2008-02-29 14:17


14:00:16,625 INFO [UpdateTimestampsCache] starting update timestamps cache at region: org.hibernate.cache.UpdateTimestampsCache
14:00:16,625 WARN [EhCacheProvider] Could not find configuration [org.hibernate.cache.UpdateTimestampsCache]; using defaults.
14:00:16,687 INFO [StandardQueryCache] starting query cache at region: org.hibernate.cache.StandardQueryCache
14:00:16,687 WARN [EhCacheProvider] Could not find configuration [org.hibernate.cache.StandardQueryCache]; using defaults.
14:00:18,484 INFO [STDOUT] Hibernate: select count(user0_.id) as col_0_0_ from nec_userb user0_
14:00:18,625 INFO [STDOUT] Hibernate: select user0_.id as col_0_0_ from nec_userb user0_ order by user0_.id limit ?
14:01:08,109 INFO [STDOUT] Hibernate: select dept0_.id as id1_, dept0_.name as name1_ from nec_dept dept0_
14:01:33,156 INFO [STDOUT] 14:01:33,140 ERROR [HibernateTemplate] exception while execute
java.lang.IllegalArgumentException: id to load is required for loading
at org.hibernate.event.LoadEvent.<init>(LoadEvent.java:51)
at org.hibernate.event.LoadEvent.<init>(LoadEvent.java:33)
at org.hibernate.impl.SessionImpl.load(SessionImpl.java:792)
at org.hibernate.impl.SessionImpl.load(SessionImpl.java:788)
at com.jdon.persistence.hibernate.HibernateTemplate$3.execute(HibernateTemplate.java:151)
at com.jdon.persistence.hibernate.HibernateTemplate.doHibernate(HibernateTemplate.java:74)
at com.jdon.persistence.hibernate.HibernateTemplate.load(HibernateTemplate.java:145)
at com.jdon.persistence.hibernate.HibernateTemplate.load(HibernateTemplate.java:139)
at com.jdon.persistence.hibernate.HibernateCRUDTemplate.loadById(HibernateCRUDTemplate.java:98)
at com.jdon.persistence.DaoCRUDTemplate.loadModelById(DaoCRUDTemplate.java:69)
at sample.service.UserServiceImp.create(UserServiceImp.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.jdon.aop.reflection.MethodInvokerUtil.execute(MethodInvokerUtil.java:54)
at com.jdon.aop.reflection.ProxyMethodInvocation.methodInvoke(ProxyMethodInvocation.java:108)
at com.jdon.aop.reflection.ProxyMethodInvocation.proceed(ProxyMethodInvocation.java:76)
at com.jdon.aop.interceptor.SessionContextInterceptor.invoke(SessionContextInterceptor.java:76)
at com.jdon.aop.reflection.ProxyMethodInvocation.proceed(ProxyMethodInvocation.java:84)
at com.jdon.aop.interceptor.StatefulInterceptor.invoke(StatefulInterceptor.java:82)
at com.jdon.aop.reflection.ProxyMethodInvocation.proceed(ProxyMethodInvocation.java:84)
at com.jdon.aop.interceptor.PoolInterceptor.invoke(PoolInterceptor.java:91)
at com.jdon.aop.reflection.ProxyMethodInvocation.proceed(ProxyMethodInvocation.java:84)
at com.jdon.aop.interceptor.CacheInterceptor.invoke(CacheInterceptor.java:58)
at com.jdon.aop.reflection.ProxyMethodInvocation.proceed(ProxyMethodInvocation.java:84)
at com.jdon.aop.AopClient.invoke(AopClient.java:73)
at com.jdon.container.access.ServiceAccessorImp.executeService(ServiceAccessorImp.java:50)
at com.jdon.controller.service.WebServiceDecorator.execute(WebServiceDecorator.java:87)
at com.jdon.controller.service.WebServiceImp.execute(WebServiceImp.java:73)
at com.jdon.controller.service.WebServiceImp.execute(WebServiceImp.java:58)
at com.jdon.model.handler.XmlModelHandler.serviceAction(XmlModelHandler.java:132)
at com.jdon.strutsutil.ModelSaveAction.execute(ModelSaveAction.java:88)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:415)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

2008-02-29 14:17


at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.jdon.util.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:92)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at com.jdon.persistence.hibernate.CloseSessionInViewFilter.doFilter(CloseSessionInViewFilter.java:43)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)
14:01:33,156 INFO [STDOUT] 14:01:33,156 ERROR [UserServiceImp] java.lang.Exception: java.lang.IllegalArgumentException: id to load is required for loading
14:01:37,031 INFO [STDOUT] Hibernate: select user0_.id as col_0_0_ from nec_userb user0_ order by user0_.id limit ?

7Go 1 2 3 4 ... 7 下一页

赞助商链接

赞助商链接

返回顶部

移动版 关于本站 使用帮助 联系管理员 最佳分辨率1366x768
OpenSource JIVEJDON Powered by JdonFramework Code © 2002-20 jdon.com