0

i created app on the openshift. Tomcat 7 + maven + spring + hibernate + postgresql. When i deploy war, i get a blank page without info.

----------

   <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:tx="http://www.springframework.org/schema/tx"
       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
        http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">

    <context:annotation-config/>
    <context:component-scan base-package="ru.marketirs.model"/>

    <tx:annotation-driven transaction-manager="transactionManager"/>

    <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">

        <property name="driverClassName" value="org.postgresql.Driver"/>

<!--        <property name="url" value="jdbc:postgresql://127.11.140.130:5432/test"/>
        <property name="username" value="admingsrszvi"/>
        <property name="password" value="pGCU-r-_raI2"/>-->



<!--    <property name="url" value="jdbc:postgresql://localhost:5433/marketirs"/>
        <property name="username" value="postgres"/>
        <property name="password" value="123"/>-->

        <property name="url" value="jdbc:postgresql://${env.OPENSHIFT_POSTGRESQL_DB_HOST}:${env.OPENSHIFT_POSTGRESQL_DB_PORT}/${env.OPENSHIFT_APP_NAME}"/>
        <property name="password" value="${env.OPENSHIFT_POSTGRESQL_DB_PASSWORD}"/>
        <property name="username" value="${env.OPENSHIFT_POSTGRESQL_DB_USERNAME}"/>

    </bean>

    <bean id="jpaDialect" class="org.springframework.orm.jpa.vendor.HibernateJpaDialect"/>

    <bean id="jpaVendorAdapter"
          class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
        <property name="database" value="POSTGRESQL"/>
        <property name="databasePlatform" value="org.hibernate.dialect.PostgreSQL9Dialect"/>
    </bean>

    <bean class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
          id="entityManagerFactory">
        <property name="persistenceXmlLocation" value="classpath:META-INF/persistence.xml"/>
        <property name="persistenceUnitName" value="ru.marketirs.model.persistence.unit"/>
        <property name="dataSource" ref="dataSource"/>
        <property name="jpaVendorAdapter" ref="jpaVendorAdapter"/>
        <property name="jpaDialect" ref="jpaDialect"/>
    </bean>

    <bean id="transactionManager"
          class="org.springframework.orm.jpa.JpaTransactionManager">
        <property name="entityManagerFactory" ref="entityManagerFactory"/>
        <property name="dataSource" ref="dataSource"/>
        <property name="jpaDialect" ref="jpaDialect"/>
    </bean>

</bean


----------

persiste

    <?xml version="1.0" encoding="utf-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
             version="2.0">
    <persistence-unit name="ru.marketirs.model.persistence.unit">
        <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>


        <properties>
            <property name="hibernate.hbm2ddl.auto" value="create"/>
        </properties>
    </persistence-unit>

</persistence>

mvc - dispather-servlet

    <beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">

    <mvc:annotation-driven/>
    <context:component-scan base-package="ru.marketirs.controllers"/>
    <!--<mvc:resources mapping="/resources/**" location="/" />-->
    <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <property name="prefix" value="/WEB-INF/pages/"/>
        <property name="suffix" value=".jsp"/>
    </bean>

    <bean class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter">
       <property name="messageConverters">
           <list>
               <ref bean="jsonMessageConverter" />
           </list>
       </property>

    </bean>
    <bean id="jsonMessageConverter" class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"/>
</beans>

logs:

    SEVERE: Error getConfigured
Feb 14, 2015 3:48:55 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/ma] startup failed due to previous errors
Feb 14, 2015 3:48:55 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /var/lib/openshift/54dfa48c4382ec78800000dc/app-root/runtime/dependencies/jbossews/webapps/ma.war has finished in 3,411 ms
Feb 14, 2015 3:48:55 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-127.2.136.129-8080"]
Feb 14, 2015 3:48:55 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3635 ms
Feb 14, 2015 3:56:54 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-127.2.136.129-8080"]
Feb 14, 2015 3:56:54 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Feb 14, 2015 3:56:54 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-127.2.136.129-8080"]
Feb 14, 2015 3:56:54 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-127.2.136.129-8080"]
Feb 14, 2015 3:57:11 PM org.apache.catalina.startup.Catalina addClusterRuleSet
INFO: Cluster RuleSet not found due to [java.lang.ClassNotFoundException: org.apache.catalina.ha.ClusterRuleSet]. Cluster configuration disabled.
"jbossews.log" 1236L, 107911C                                                      832,1         67%
Feb 14, 2015 3:48:53 PM org.apache.catalina.startup.ContextConfig parseWebXml
SEVERE: Occurred at line 12 column 15
Feb 14, 2015 3:48:54 PM org.apache.catalina.startup.ContextConfig configureStart
SEVERE: Marking this application unavailable due to previous error(s)
Feb 14, 2015 3:48:55 PM org.apache.tomcat.util.modeler.Registry registerComponent
SEVERE: Null component Catalina:type=DataSource,context=/ma,host=localhost,class=javax.sql.DataSource,name="jdbc/PostgreSQLDS"
Feb 14, 2015 3:48:55 PM org.apache.tomcat.util.modeler.Registry registerComponent
SEVERE: Null component Catalina:type=DataSource,context=/ma,host=localhost,class=javax.sql.DataSource,name="jdbc/MySQLDS"
Feb 14, 2015 3:48:55 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error getConfigured
Feb 14, 2015 3:48:55 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/ma] startup failed due to previous errors
Feb 14, 2015 3:48:55 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /var/lib/openshift/54dfa48c4382ec78800000dc/app-root/runtime/dependencies/jbossews/webapps/ma.war has finished in 3,411 ms
Feb 14, 2015 3:48:55 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-127.2.136.129-8080"]
Feb 14, 2015 3:48:55 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3635 ms
Feb 14, 2015 3:56:54 PM org.apache.coyote.AbstractProtocol pause
INFO: Pausing ProtocolHandler ["http-bio-127.2.136.129-8080"]
Feb 14, 2015 3:56:54 PM org.apache.catalina.core.StandardService stopInternal
INFO: Stopping service Catalina
Feb 14, 2015 3:56:54 PM org.apache.coyote.AbstractProtocol stop
INFO: Stopping ProtocolHandler ["http-bio-127.2.136.129-8080"]
Feb 14, 2015 3:56:54 PM org.apache.coyote.AbstractProtocol destroy
INFO: Destroying ProtocolHandler ["http-bio-127.2.136.129-8080"]
Feb 14, 2015 3:57:11 PM org.apache.catalina.startup.Catalina addClusterRuleSet
INFO: Cluster RuleSet not found due to [java.lang.ClassNotFoundException: org.apache.catalina.ha.ClusterRuleSet]. Cluster configuration disabled.
Feb 14, 2015 3:57:11 PM org.apache.catalina.startup.Catalina addClusterRuleSet
INFO: Cluster RuleSet not found due to [java.lang.ClassNotFoundException: org.apache.catalina.ha.ClusterRuleSet]. Cluster configuration disabled.
Feb 14, 2015 3:57:12 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /opt/rh/postgresql92/root/usr/lib64:/usr/java/packages/lib/i386:/lib:/usr/lib
Feb 14, 2015 3:57:12 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-127.2.136.129-8080"]
Feb 14, 2015 3:57:12 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1754 ms
Feb 14, 2015 3:57:12 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Feb 14, 2015 3:57:12 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.54
Feb 14, 2015 3:57:13 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive /var/lib/openshift/54dfa48c4382ec78800000dc/app-root/runtime/dependencies/jbossews/webapps/ma.war
Feb 14, 2015 3:57:14 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
@
                                                                                                                                                                                          832,1         68%
        at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
        at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
        at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:648)
        at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1561)
        at org.apache.catalina.startup.ContextConfig.parseWebXml(ContextConfig.java:1812)
        at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1250)
        at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:876)
        at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:374)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5355)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:632)
        at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1083)
        at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1880)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml addServlet
        at org.apache.tomcat.util.IntrospectionUtils.callMethod1(IntrospectionUtils.java:849)
        at org.apache.tomcat.util.digester.SetNextRule.end(SetNextRule.java:201)
        at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1063)
        ... 29 more
Feb 14, 2015 4:11:59 PM org.apache.catalina.startup.ContextConfig parseWebXml
SEVERE: Occurred at line 12 column 15
Feb 14, 2015 4:11:59 PM org.apache.catalina.startup.ContextConfig configureStart
SEVERE: Marking this application unavailable due to previous error(s)
Feb 14, 2015 4:12:01 PM org.apache.tomcat.util.modeler.Registry registerComponent
SEVERE: Null component Catalina:type=DataSource,context=/ma,host=localhost,class=javax.sql.DataSource,name="jdbc/PostgreSQLDS"
Feb 14, 2015 4:12:01 PM org.apache.tomcat.util.modeler.Registry registerComponent
SEVERE: Null component Catalina:type=DataSource,context=/ma,host=localhost,class=javax.sql.DataSource,name="jdbc/MySQLDS"
Feb 14, 2015 4:12:01 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error getConfigured
Feb 14, 2015 4:12:01 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/ma] startup failed due to previous errors
Feb 14, 2015 4:12:02 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deployment of web application archive /var/lib/openshift/54dfa48c4382ec78800000dc/app-root/runtime/dependencies/jbossews/webapps/ma.war has finished in 4,571 ms
Feb 14, 2015 4:12:02 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-127.2.136.129-8080"]
Feb 14, 2015 4:12:02 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 4829 ms

What do i see - http://main-marketirs.rhcloud.com/

updated - i remove catalina.jar and servlet-api from maven dep.

War deployed,but i got 502 Proxy Error: The proxy server received an invalid response from an upstream server. The proxy server could not handle the request GET /.

Reason: Error reading from remote server

Logs:

INFO: Starting service Catalina


    1,1       Наверху
ssivated, specify a unique value for property 'hibernate.ejb.entitymanager_factory_name'
2015-02-15 11:39:36 INFO  ClassPathXmlApplicationContext:513 - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1ca4644: startup date [Sun Feb 15 11:39:36 EST 2015]; root of context hierarchy
2015-02-15 11:39:44 INFO  XmlBeanDefinitionReader:316 - Loading XML bean definitions from class path resource [META-INF/beans.xml]
2015-02-15 11:40:29 INFO  AutowiredAnnotationBeanPostProcessor:141 - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2015-02-15 11:40:36 INFO  DriverManagerDataSource:133 - Loaded JDBC driver: org.postgresql.Driver
2015-02-15 11:40:36 INFO  LocalContainerEntityManagerFactoryBean:332 - Building JPA container EntityManagerFactory for persistence unit 'ru.marketirs.model.persistence.unit'
2015-02-15 11:40:36 INFO  LogHelper:46 - HHH000204: Processing PersistenceUnitInfo [
        name: ru.marketirs.model.persistence.unit
        ...]
2015-02-15 11:41:14 INFO  Dialect:145 - HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL9Dialect
2015-02-15 11:41:14 INFO  LobCreatorBuilder:123 - HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
2015-02-15 11:42:20 INFO  ASTQueryTranslatorFactory:47 - HHH000397: Using ASTQueryTranslatorFactory
                                                                                                                                                                                          2663,1      Внизу
2015-02-15 11:39:29 WARN  EntityManagerFactoryRegistry:80 - HHH000436: Entity manager factory name (ru.marketirs.model.persistence.unit) is already registered.  If entity manager will be clustered or passivated, specify a unique value for property 'hibernate.ejb.entitymanager_factory_name'
2015-02-15 11:39:36 INFO  ClassPathXmlApplicationContext:513 - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1ca4644: startup date [Sun Feb 15 11:39:36 EST 2015]; root of context hierarchy
2015-02-15 11:39:44 INFO  XmlBeanDefinitionReader:316 - Loading XML bean definitions from class path resource [META-INF/beans.xml]
2015-02-15 11:40:29 INFO  AutowiredAnnotationBeanPostProcessor:141 - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2015-02-15 11:40:36 INFO  DriverManagerDataSource:133 - Loaded JDBC driver: org.postgresql.Driver
2015-02-15 11:40:36 INFO  LocalContainerEntityManagerFactoryBean:332 - Building JPA container EntityManagerFactory for persistence unit 'ru.marketirs.model.persistence.unit'
2015-02-15 11:40:36 INFO  LogHelper:46 - HHH000204: Processing PersistenceUnitInfo [
        name: ru.marketirs.model.persistence.unit
        ...]
2015-02-15 11:41:14 INFO  Dialect:145 - HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL9Dialect
2015-02-15 11:41:14 INFO  LobCreatorBuilder:123 - HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
2015-02-15 11:42:20 INFO  ASTQueryTranslatorFactory:47 - HHH000397: Using ASTQueryTranslatorFactory
                                                                                   2663,1      Внизу
2015-02-15 11:38:07 INFO  ClassPathXmlApplicationContext:513 - Refreshing org.springframework.contextt
.support.ClassPathXmlApplicationContext@19aec75: startup date [Sun Feb 15 11:38:07 EST 2015]; root off
 context hierarchy
2015-02-15 11:38:07 INFO  XmlBeanDefinitionReader:316 - Loading XML bean definitions from class path
resource [META-INF/beans.xml]
2015-02-15 11:38:13 INFO  AutowiredAnnotationBeanPostProcessor:141 - JSR-330 'javax.inject.Inject' ann
notation found and supported for autowiring
2015-02-15 11:38:14 INFO  DriverManagerDataSource:133 - Loaded JDBC driver: org.postgresql.Driver
2015-02-15 11:38:14 INFO  LocalContainerEntityManagerFactoryBean:332 - Building JPA container EntityMM
anagerFactory for persistence unit 'ru.marketirs.model.persistence.unit'
2015-02-15 11:38:14 INFO  LogHelper:46 - HHH000204: Processing PersistenceUnitInfo [
        name: ru.marketirs.model.persistence.unit
        ...]
2015-02-15 11:38:18 INFO  Dialect:145 - HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL9Dii
alect
2015-02-15 11:38:18 INFO  LobCreatorBuilder:123 - HHH000424: Disabling contextual LOB creation as cree
ateClob() method threw error : java.lang.reflect.InvocationTargetException
2015-02-15 11:38:23 INFO  ASTQueryTranslatorFactory:47 - HHH000397: Using ASTQueryTranslatorFactory
2015-02-15 11:39:12 INFO  SchemaExport:343 - HHH000227: Running hbm2ddl schema export
2015-02-15 11:39:13 ERROR SchemaExport:425 - HHH000389: Unsuccessful: alter table Product add constraa
int FK_4pyli7u3k5igu1skcb1g7x5xe foreign key (type_id) references Categorpr
2015-02-15 11:39:13 ERROR SchemaExport:426 - ERROR: constraint "fk_4pyli7u3k5igu1skcb1g7x5xe" for rell
ation "product" already exists
2015-02-15 11:39:13 INFO  SchemaExport:405 - HHH000230: Schema export complete
2015-02-15 11:39:29 WARN  EntityManagerFactoryRegistry:80 - HHH000436: Entity manager factory name (rr
u.marketirs.model.persistence.unit) is already registered.  If entity manager will be clustered or paa
ssivated, specify a unique value for property 'hibernate.ejb.entitymanager_factory_name'
2015-02-15 11:39:36 INFO  ClassPathXmlApplicationContext:513 - Refreshing org.springframework.contextt
.support.ClassPathXmlApplicationContext@1ca4644: startup date [Sun Feb 15 11:39:36 EST 2015]; root off
 context hierarchy
2015-02-15 11:39:44 INFO  XmlBeanDefinitionReader:316 - Loading XML bean definitions from class path
resource [META-INF/beans.xml]
2015-02-15 11:40:29 INFO  AutowiredAnnotationBeanPostProcessor:141 - JSR-330 'javax.inject.Inject' ann
notation found and supported for autowiring
2015-02-15 11:40:36 INFO  DriverManagerDataSource:133 - Loaded JDBC driver: org.postgresql.Driver
2015-02-15 11:40:36 INFO  LocalContainerEntityManagerFactoryBean:332 - Building JPA container EntityMM
anagerFactory for persistence unit 'ru.marketirs.model.persistence.unit'
2015-02-15 11:40:36 INFO  LogHelper:46 - HHH000204: Processing PersistenceUnitInfo [
        name: ru.marketirs.model.persistence.unit
        ...]
2015-02-15 11:41:14 INFO  Dialect:145 - HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL9Dii
alect
2015-02-15 11:41:14 INFO  LobCreatorBuilder:123 - HHH000424: Disabling contextual LOB creation as cree
ateClob() method threw error : java.lang.reflect.InvocationTargetException
2015-02-15 11:42:20 INFO  ASTQueryTranslatorFactory:47 - HHH000397: Using ASTQueryTranslatorFactory
                                                                                   2663,1      Внизу
2015-02-15 11:38:07 INFO  ClassPathXmlApplicationContext:513 - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@19aec75: startup date [Sun Feb 15 11:38:07 EST 2015]; root of context hierarchy
2015-02-15 11:38:07 INFO  XmlBeanDefinitionReader:316 - Loading XML bean definitions from class path resource [META-INF/beans.xml]
2015-02-15 11:38:13 INFO  AutowiredAnnotationBeanPostProcessor:141 - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2015-02-15 11:38:14 INFO  DriverManagerDataSource:133 - Loaded JDBC driver: org.postgresql.Driver
2015-02-15 11:38:14 INFO  LocalContainerEntityManagerFactoryBean:332 - Building JPA container EntityManagerFactory for persistence unit 'ru.marketirs.model.persistence.unit'
2015-02-15 11:38:14 INFO  LogHelper:46 - HHH000204: Processing PersistenceUnitInfo [
        name: ru.marketirs.model.persistence.unit
        ...]
2015-02-15 11:38:18 INFO  Dialect:145 - HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL9Dialect
2015-02-15 11:38:18 INFO  LobCreatorBuilder:123 - HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
2015-02-15 11:38:23 INFO  ASTQueryTranslatorFactory:47 - HHH000397: Using ASTQueryTranslatorFactory
2015-02-15 11:39:12 INFO  SchemaExport:343 - HHH000227: Running hbm2ddl schema export
2015-02-15 11:39:13 ERROR SchemaExport:425 - HHH000389: Unsuccessful: alter table Product add constraint FK_4pyli7u3k5igu1skcb1g7x5xe foreign key (type_id) references Categorpr
2015-02-15 11:39:13 ERROR SchemaExport:426 - ERROR: constraint "fk_4pyli7u3k5igu1skcb1g7x5xe" for relation "product" already exists
2015-02-15 11:39:13 INFO  SchemaExport:405 - HHH000230: Schema export complete
2015-02-15 11:39:29 WARN  EntityManagerFactoryRegistry:80 - HHH000436: Entity manager factory name (ru.marketirs.model.persistence.unit) is already registered.  If entity manager will be clustered or passivated, specify a unique value for property 'hibernate.ejb.entitymanager_factory_name'
2015-02-15 11:39:36 INFO  ClassPathXmlApplicationContext:513 - Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1ca4644: startup date [Sun Feb 15 11:39:36 EST 2015]; root of context hierarchy
2015-02-15 11:39:44 INFO  XmlBeanDefinitionReader:316 - Loading XML bean definitions from class path resource [META-INF/beans.xml]
2015-02-15 11:40:29 INFO  AutowiredAnnotationBeanPostProcessor:141 - JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
2015-02-15 11:40:36 INFO  DriverManagerDataSource:133 - Loaded JDBC driver: org.postgresql.Driver
2015-02-15 11:40:36 INFO  LocalContainerEntityManagerFactoryBean:332 - Building JPA container EntityManagerFactory for persistence unit 'ru.marketirs.model.persistence.unit'
2015-02-15 11:40:36 INFO  LogHelper:46 - HHH000204: Processing PersistenceUnitInfo [
        name: ru.marketirs.model.persistence.unit
        ...]
2015-02-15 11:41:14 INFO  Dialect:145 - HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL9Dialect
2015-02-15 11:41:14 INFO  LobCreatorBuilder:123 - HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
2015-02-15 11:42:20 INFO  ASTQueryTranslatorFactory:47 - HHH000397: Using ASTQueryTranslatorFactory

upd 3

https://github.com/tigraboris/MarketirsFull.git

May be problem with web or pom files? logs: 2015-02-15 15:24:31 INFO LocalContainerEntityManagerFactoryBean:332 - Building JPA container EntityManagerFactory for persistence unit 'ru.marketirs.model.persistence.unit' 2015-02-15 15:24:31 INFO LogHelper:46 - HHH000204: Processing PersistenceUnitInfo [ name: ru.marketirs.model.persistence.unit ...] 2015-02-15 15:26:00 INFO Dialect:145 - HHH000400: Using dialect: org.hibernate.dialect.PostgreSQL9Dialect 2015-02-15 15:26:00 INFO LobCreatorBuilder:123 - HHH000424: Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException

Boris Zhguchev
  • 313
  • 4
  • 12
  • The real error is logged before the snippet you posted. I guest it's the `${env...`. If so, have a look at http://stackoverflow.com/questions/3965446/how-to-read-system-environment-variable-in-spring-applicationcontext – Hannes Feb 14 '15 at 22:35
  • Thank you for your comment. I tried replace real value(comments) like " value="jdbc:postgresql://127.11.140.130:5432/test"/> . I got this result too. – Boris Zhguchev Feb 15 '15 at 07:44
  • http://stackoverflow.com/questions/13189371/exception-when-running-tomcat-server-org-apache-catalina-deploy-webxml-addservle – Hannes Feb 15 '15 at 08:37
  • Thank you Hannes. But i got another error.INFO: Starting service Catalina i updated logs...what can i do? – Boris Zhguchev Feb 15 '15 at 16:50
  • Have a look at http://stackoverflow.com/questions/438146/hibernate-hbm2ddl-auto-possible-values-and-what-they-do. – Hannes Feb 15 '15 at 17:28
  • Hannes, thank you for help me very much. But it has not worked yet. :( ...I have tryed different value of hibernate.hbm2ddl.auto. May be, this problem is connect with web.xml(cors -filter). i put link to github. – Boris Zhguchev Feb 15 '15 at 20:24
  • and i do not understand what happened, because at my local machine the project is good. – Boris Zhguchev Feb 15 '15 at 20:34

2 Answers2

0

You have either a bug in you Category to Product mapping or a inconsistent db state

 2015-02-15 11:39:12 INFO SchemaExport:343 - HHH000227: Running hbm2ddl schema export 
 2015-02-15 11:39:13 ERROR SchemaExport:425 - HHH000389: Unsuccessful: alter table Product add constraint FK_4pyli7u3k5igu1skcb1g7x5xe foreign key (type_id) references Categorpr 
 2015-02-15 11:39:13 ERROR SchemaExport:426 - ERROR: constraint "fk_4pyli7u3k5igu1skcb1g7x5xe" for relation "product" already exists

Hibernate tries to create a new foreign key constraint and fails, because another one already exists. Check you database about constraint fk_4pyli7u3k5igu1skcb1g7x5xe. You can try to delete it and use hbm2ddl = update to let hibernate add the constraint. Another step could be to try hbm2ddl = verify. This way hibernate will tell you what's wrong with you models compared to the db table relations.

Anyways, you have fixed your inital problem, but now face another/the next one.

Hannes
  • 2,018
  • 25
  • 32
0

The problem was an incorrected version of tomcat. I built in verion 8 , but server wanted version 7.

Boris Zhguchev
  • 313
  • 4
  • 12