新人第一次在CSDN发帖:请大神们指教
我在本机上运行MyEclipse中的项目,出现以下提示,我hibernate连接的是虚拟机上的oracle9g,(在本机上可以ping的通虚拟机的ip,在虚拟机上不可以ping通本机ip,hibernate测试连接也成功了)出现如下提示。在虚拟机上发表数据表没有被创建,求各位大师指点啊~~~~!急2012-11-21 15:43:42 org.apache.catalina.core.AprLifecycleListener init
信息: Loaded Apache Tomcat Native library 1.1.10.
2012-11-21 15:43:44 org.apache.coyote.http11.Http11AprProtocol init
信息: Initializing Coyote HTTP/1.1 on http-8974
2012-11-21 15:43:44 org.apache.coyote.ajp.AjpAprProtocol init
信息: Initializing Coyote AJP/1.3 on ajp-8009
2012-11-21 15:43:44 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 1806 ms
2012-11-21 15:43:44 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2012-11-21 15:43:44 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.10
2012-11-21 15:43:45 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
15:43:47,211  INFO Environment:500 - Hibernate 3.2.0
15:43:47,223  INFO Environment:533 - hibernate.properties not found
15:43:47,226  INFO Environment:667 - Bytecode provider name : cglib
15:43:47,234  INFO Environment:584 - using JDK 1.4 java.sql.Timestamp handling
15:43:47,379  INFO Configuration:1365 - configuring from url: file:/E:/Tomcat%206.0/webapps/OA/WEB-INF/classes/hibernate.cfg.xml
15:43:47,497 DEBUG DTDEntityResolver:38 - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd]
15:43:47,498 DEBUG DTDEntityResolver:40 - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
15:43:47,499 DEBUG DTDEntityResolver:50 - located [http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd] in classpath
15:43:47,549 DEBUG Configuration:1311 - myeclipse.connection.profile=oracle2
15:43:47,550 DEBUG Configuration:1311 - connection.url=jdbc:oracle:thin:@192.168.1.128:1521:orcl
15:43:47,550 DEBUG Configuration:1311 - connection.username=scott
15:43:47,551 DEBUG Configuration:1311 - connection.password=admin123
15:43:47,551 DEBUG Configuration:1311 - connection.driver_class=oracle.jdbc.driver.OracleDriver
15:43:47,554 DEBUG Configuration:1311 - dialect=org.hibernate.dialect.Oracle9Dialect
15:43:47,554 DEBUG Configuration:1311 - show_sql=true
15:43:47,555 DEBUG Configuration:1510 - null<-org.dom4j.tree.DefaultAttribute@15d616e [Attribute: name resource value "com/softeem/oa/pojos/Role.hbm.xml"]
15:43:47,555  INFO Configuration:507 - Reading mappings from resource: com/softeem/oa/pojos/Role.hbm.xml
15:43:47,559 DEBUG DTDEntityResolver:38 - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd]
15:43:47,560 DEBUG DTDEntityResolver:40 - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
15:43:47,562 DEBUG DTDEntityResolver:50 - located [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd] in classpath
15:43:47,688  INFO HbmBinder:300 - Mapping class: com.softeem.oa.pojos.Role -> tb_role
15:43:47,719 DEBUG HbmBinder:1270 - Mapped property: roleId -> role_id
15:43:47,734 DEBUG HbmBinder:1270 - Mapped property: roleName -> role_name
15:43:47,734 DEBUG HbmBinder:1270 - Mapped property: rolePrior -> role_prior
15:43:47,750  INFO HbmBinder:1412 - Mapping collection: com.softeem.oa.pojos.Role.permissions -> tb_role_permission
15:43:47,750 DEBUG HbmBinder:1270 - Mapped property: permissions
15:43:47,750  INFO HbmBinder:1412 - Mapping collection: com.softeem.oa.pojos.Role.users -> tb_role_user
15:43:47,750 DEBUG HbmBinder:1270 - Mapped property: users
15:43:47,750 DEBUG Configuration:1510 - null<-org.dom4j.tree.DefaultAttribute@d67067 [Attribute: name resource value "com/softeem/oa/pojos/User.hbm.xml"]
15:43:47,750  INFO Configuration:507 - Reading mappings from resource: com/softeem/oa/pojos/User.hbm.xml
15:43:47,766 DEBUG DTDEntityResolver:38 - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd]
15:43:47,766 DEBUG DTDEntityResolver:40 - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
15:43:47,766 DEBUG DTDEntityResolver:50 - located [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd] in classpath
15:43:47,781  INFO HbmBinder:300 - Mapping class: com.softeem.oa.pojos.User -> tb_user
15:43:47,781 DEBUG HbmBinder:1270 - Mapped property: userId -> user_id
15:43:47,781 DEBUG HbmBinder:1270 - Mapped property: userName -> user_name
15:43:47,781 DEBUG HbmBinder:1270 - Mapped property: userPass -> user_pass
15:43:47,781 DEBUG HbmBinder:1270 - Mapped property: notes
15:43:47,781 DEBUG HbmBinder:1270 - Mapped property: friends
15:43:47,781  INFO HbmBinder:1412 - Mapping collection: com.softeem.oa.pojos.User.roles -> tb_role_user
15:43:47,781 DEBUG HbmBinder:1270 - Mapped property: roles
15:43:47,781  INFO HbmBinder:1412 - Mapping collection: com.softeem.oa.pojos.User.permissions -> tb_user_permission
15:43:47,781 DEBUG HbmBinder:1270 - Mapped property: permissions
15:43:47,922 DEBUG HbmBinder:1270 - Mapped property: person
15:43:47,922 DEBUG Configuration:1510 - null<-org.dom4j.tree.DefaultAttribute@1700391 [Attribute: name resource value "com/softeem/oa/pojos/ChildModular.hbm.xml"]
15:43:47,922  INFO Configuration:507 - Reading mappings from resource: com/softeem/oa/pojos/ChildModular.hbm.xml
15:43:47,922 DEBUG DTDEntityResolver:38 - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd]
15:43:47,922 DEBUG DTDEntityResolver:40 - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
15:43:47,922 DEBUG DTDEntityResolver:50 - located [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd] in classpath
...
...(省略部分代码)15:43:49,822 DEBUG OneToManyLoader:64 - Static select for one-to-many com.softeem.oa.pojos.Modular.childModular: select childmodul0_.modular_id as modular3_1_, childmodul0_.childModular_id as childMod1_1_, childmodul0_.childModular_id as childMod1_5_0_, childmodul0_.childModular_name as childMod2_5_0_, childmodul0_.modular_id as modular3_5_0_ from tb_childModular childmodul0_ where childmodul0_.modular_id=?
15:43:49,822 DEBUG BasicCollectionLoader:64 - Static select for collection com.softeem.oa.pojos.User.roles: select roles0_.user_id as user2_1_, roles0_.role_id as role1_1_, role1_.role_id as role1_0_0_, role1_.role_name as role2_0_0_, role1_.role_prior as role3_0_0_ from tb_role_user roles0_ left outer join tb_role role1_ on roles0_.role_id=role1_.role_id where roles0_.user_id=?
15:43:49,823 DEBUG OneToManyLoader:64 - Static select for one-to-many com.softeem.oa.pojos.User.friends: select friends0_.user_id as user5_1_, friends0_.friend_id as friend1_1_, friends0_.friend_id as friend1_7_0_, friends0_.friend_name as friend2_7_0_, friends0_.friend_sex as friend3_7_0_, friends0_.friend_tel as friend4_7_0_, friends0_.user_id as user5_7_0_ from tb_friend friends0_ where friends0_.user_id=?
15:43:49,826 DEBUG SessionFactoryObjectFactory:39 - initializing class SessionFactoryObjectFactory
15:43:49,831 DEBUG SessionFactoryObjectFactory:76 - registered: 402881813b21ec3f013b21ec423f0000 (unnamed)
15:43:49,831  INFO SessionFactoryObjectFactory:82 - Not binding factory to JNDI, no JNDI name configured
15:43:49,831 DEBUG SessionFactoryImpl:308 - instantiated session factory
15:43:49,832 DEBUG SessionFactoryImpl:390 - Checking 0 named HQL queries
15:43:49,833 DEBUG SessionFactoryImpl:410 - Checking 0 named SQL queries
2012-11-21 15:43:52 org.apache.coyote.http11.Http11AprProtocol start
信息: Starting Coyote HTTP/1.1 on http-8974
2012-11-21 15:43:52 org.apache.coyote.ajp.AjpAprProtocol start
信息: Starting Coyote AJP/1.3 on ajp-8009
2012-11-21 15:43:52 org.apache.catalina.startup.Catalina start
信息: Server startup in 8288 ms
以下是我的hibernate.cfg.xml的配置代码。
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="myeclipse.connection.profile">oracle2</property>
<property name="connection.url">jdbc:oracle:thin:@192.168.1.128:1521:orcl</property>
<property name="connection.username">scott</property>
<property name="connection.password">admin123</property>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="show_sql">true</property>
<mapping resource="com/softeem/oa/pojos/Role.hbm.xml" />
<mapping resource="com/softeem/oa/pojos/User.hbm.xml" />
<mapping resource="com/softeem/oa/pojos/ChildModular.hbm.xml" />
<mapping resource="com/softeem/oa/pojos/Department.hbm.xml" />
<mapping resource="com/softeem/oa/pojos/Friend.hbm.xml" />
<mapping resource="com/softeem/oa/pojos/Mail.hbm.xml" />
<mapping resource="com/softeem/oa/pojos/Mechanism.hbm.xml" />
<mapping resource="com/softeem/oa/pojos/Modular.hbm.xml" />
<mapping resource="com/softeem/oa/pojos/Note.hbm.xml" />
<mapping resource="com/softeem/oa/pojos/OfficialDoc.hbm.xml" />
<mapping resource="com/softeem/oa/pojos/Permission.hbm.xml" />
<mapping resource="com/softeem/oa/pojos/Person.hbm.xml" />
</session-factory>
</hibernate-configuration>

解决方案 »

  1.   

    将 log4j.logger.org.hibernate=debug 更改成 log4j.logger.org.hibernate=error 时,只输出SQL和错误信息。
      

  2.   

    去掉debug后启动tomcat时信息: Loaded Apache Tomcat Native library 1.1.10.
    2012-11-21 16:41:11 org.apache.coyote.http11.Http11AprProtocol init
    信息: Initializing Coyote HTTP/1.1 on http-8974
    2012-11-21 16:41:11 org.apache.coyote.ajp.AjpAprProtocol init
    信息: Initializing Coyote AJP/1.3 on ajp-8009
    2012-11-21 16:41:11 org.apache.catalina.startup.Catalina load
    信息: Initialization processed in 1997 ms
    2012-11-21 16:41:11 org.apache.catalina.core.StandardService start
    信息: Starting service Catalina
    2012-11-21 16:41:11 org.apache.catalina.core.StandardEngine start
    信息: Starting Servlet Engine: Apache Tomcat/6.0.10
    2012-11-21 16:41:13 org.apache.catalina.core.ApplicationContext log
    信息: Initializing Spring root WebApplicationContext
    2012-11-21 16:41:21 org.apache.coyote.http11.Http11AprProtocol start
    信息: Starting Coyote HTTP/1.1 on http-8974
    2012-11-21 16:41:21 org.apache.coyote.ajp.AjpAprProtocol start
    信息: Starting Coyote AJP/1.3 on ajp-8009
    2012-11-21 16:41:21 org.apache.catalina.startup.Catalina start
    信息: Server startup in 9746 ms究竟要怎么搞才能连上虚拟机上的oracle呢?我本机和虚拟机的防火墙都关了啊。