spring - Error creating bean with name 'entityManagerFactory' defined in ServletContext resource -


i'm deploying webservice in weblogic, time i've following problem when activating instance in weblogic:

info  xmlbeandefinitionreader - loading xml bean definitions servletcontext resource [/web-inf/mvc-dispatcher-servlet.xml] localcontainerentitymanagerfactorybean - building jpa container entitymanagerfactory persistence unit 'gemmajpa' contextloader - context initialization failed org.springframework.beans.factory.beancreationexception: error creating bean name 'entitymanagerfactory' defined in servletcontext resource [/web-inf/mvc-dispatcher-servlet.xml]: invocation of init method failed; nested exception java.lang.nullpointerexception 

next, provide configuration files.

web.xml (inside web-inf folder)

web-inf     <?xml version="1.0" encoding="utf-8"?>     <web-app id="webapp_id" version="2.5"         xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"         xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">          <display-name>webserviceadjudicataris</display-name>             <welcome-file-list>             <welcome-file>index.jsp</welcome-file>         </welcome-file-list>           <context-param>             <param-name>contextinitializerclasses</param-name>             <param-value>net.atos.gemma.listener.gemmacontextinitializer</param-value>         </context-param>           <context-param>             <param-name>contextclass</param-name>             <param-value>org.springframework.web.context.support.xmlwebapplicationcontext</param-value>         </context-param>          <context-param>             <param-name>contextconfiglocation</param-name>             <param-value>/web-inf/mvc-dispatcher-servlet.xml</param-value>         </context-param>           <listener>             <listener-class>org.springframework.web.context.contextloaderlistener</listener-class>         </listener>          <listener>             <listener-class>org.springframework.web.context.request.requestcontextlistener</listener-class>         </listener>          <listener>             <listener-class>org.springframework.security.web.session.httpsessioneventpublisher</listener-class>         </listener>          <filter>             <filter-name>requestcontextfilter</filter-name>             <filter-class>org.springframework.web.filter.requestcontextfilter</filter-class>         </filter>          <servlet>             <servlet-name>cxfservlet</servlet-name>             <servlet-class>org.apache.cxf.transport.servlet.cxfservlet</servlet-class>             <load-on-startup>1</load-on-startup>         </servlet>     </web-app> 

mvc-dispatche-servlet.xml (inside web-inf folder since integrated spring + jpa)

    <beans xmlns="http://www.springframework.org/schema/beans"         xmlns:context="http://www.springframework.org/schema/context"         xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"         xmlns:mvc="http://www.springframework.org/schema/mvc"         xmlns:jaxws="http://cxf.apache.org/jaxws"         xmlns:p="http://www.springframework.org/schema/p"         xmlns:jee="http://www.springframework.org/schema/jee"         xsi:schemalocation="             http://www.springframework.org/schema/beans                  http://www.springframework.org/schema/beans/spring-beans-3.2.xsd             http://www.springframework.org/schema/context              http://www.springframework.org/schema/context/spring-context-3.2.xsd             http://www.springframework.org/schema/tx             http://www.springframework.org/schema/tx/spring-tx-3.2.xsd                     http://www.springframework.org/schema/mvc              http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd             http://cxf.apache.org/jaxws              http://cxf.apache.org/schemas/jaxws.xsd             http://www.springframework.org/schema/jee             http://www.springframework.org/schema/jee/spring-jee-2.0.xsd                     http://www.springframework.org/schema/aop             http://www.springframework.org/schema/aop/spring-aop-3.2.xsd             ">          <context:component-scan base-package="net.atos.gemma.session" />             <context:component-scan base-package="net.atos.gemma.dao.*base*" />          <context:component-scan base-package="net.atos.gemma.entity" />         <context:component-scan base-package="cat.salut.sem.ws.gemma.*" />         <!--  <context:component-scan base-package="cat.salut.sem.ws.gemma" /> -->               <!--  <mvc:resources mapping="/resources/**" location="/resources/" />         <mvc:annotation-driven /> -->          <!-- clase principal del webservice -->         <jaxws:endpoint id="wsdl" implementor="#adjudicatariservice" address="/wsdl">                </jaxws:endpoint>          <!-- clase principal del webservice -->          <!--  <context:component-scan base-package="cat.salut.einaldap.controller" /> -->          <!--  <import resource="classpath:meta-inf/cxf/cxf.xml" />           <import resource="classpath:meta-inf/cxf/cxf-servlet.xml" /> -->          <bean id="sessionfactory"             class="org.springframework.orm.hibernate4.localsessionfactorybean">             <property name="mappingresources">                 <list>                     <value>cat/salut/sem/ws/gemma/bbdd/hbm/ttsnuprescripcio.xml</value>                              </list>             </property>             <property name="hibernateproperties">                 <props>                     <prop key="hibernate.bytecode.use_reflection_optimizer">false</prop>                     <prop key="hibernate.current_session_context_class">thread</prop>                     <prop key="hibernate.connection.datasource">jdbc/poolgestorwsadjudicataris</prop>                     <prop key="hibernate.dialect">org.hibernate.dialect.oracledialect</prop>                     <prop key="hibernate.connection.characterencoding">iso-8859-1</prop>                     <prop key="hibernate.show_sql">false</prop>                 </props>             </property>         </bean>               <bean id="log4jinitialization"             class="org.springframework.beans.factory.config.methodinvokingfactorybean">             <property name="targetclass" value="org.springframework.util.log4jconfigurer" />             <property name="targetmethod" value="initlogging" />             <property name="arguments">                 <list>                     <value>file:///wlscfg/sem_domain/data/pandora/log4j_wsadjudicataris.properties</value>                  </list>             </property>         </bean>     <!-- hibernate -->         <jee:jndi-lookup id="realdatasource" jndi-name="jdbc/poolgestorwsadjudicataris"/>         <bean id="jdbcextractor" class="org.springframework.jdbc.support.nativejdbc.oraclejdbc4nativejdbcextractor">            </bean>          <!-- mla:: ini -->         <!-- ************ jpa configuration *********** -->         <!--   <tx:annotation-driven transaction-manager="transactionmanager" />   -->            <bean id="entitymanager" class="org.springframework.orm.jpa.support.sharedentitymanagerbean">             <property name="entitymanagerfactory" ref="entitymanagerfactory" />         </bean>         <bean id="entitymanagerfactory" class="org.springframework.orm.jpa.localcontainerentitymanagerfactorybean"                 p:datasource-ref="realdatasource"               p:persistencexmllocation="classpath*:persistence.xml">                  <property name="persistenceunitname" value="gemmajpa" />             <property name="datasource" ref="realdatasource" />             <property name="packagestoscan" value="net.atos.gemma.entity" />             <property name="jpavendoradapter">                 <bean class="org.springframework.orm.jpa.vendor.eclipselinkjpavendoradapter">                     <property name="showsql" value="true" />                     <property name="databaseplatform" value="org.eclipse.persistence.platform.database.oracleplatform" />                 </bean>             </property>         </bean>           <bean id="transactionmanager" class="org.springframework.orm.jpa.jpatransactionmanager">             <property name="entitymanagerfactory" ref="entitymanagerfactory" />         </bean>           <!--  <bean id="datasource" class="org.springframework.jndi.jndiobjectfactorybean">             <property name="jndiname" value="jdbc/poolgestorwsadjudicataris"/>         </bean> -->          <bean id=  "adjudicatariservice" name="adjudicatariservice" class="cat.salut.sem.ws.gemma.principal.adjudicatariserviceimpl">         </bean>       <!--    <bean id=  "contextbean"           name="contextbean" class = "net.atos.gemma.session.contextbean"> </bean>          <bean id=  "systemcontextbeandata"  name="systemcontextbeandata" class = "net.atos.gemma.session.systemcontextbeandata"></bean>            <bean id = "prescriptiondao" name="prescriptiondao" class = "cat.salut.sem.ws.gemma.persistencia.dao.prescriptiondao">                </bean>              <bean id = "prescriptionbean" name="prescriptionbean" class = "cat.salut.sem.ws.gemma.negoci.bean.prescriptionbean">         </bean>              <bean id = "prescriptionservice" class = "cat.salut.sem.ws.gemma.principal.prescriptionservice">         </bean>           <bean id=  "adjudicatariserviceimpl" name="adjudicatariserviceimpl" class="cat.salut.sem.ws.gemma.principal.adjudicatariserviceimpl">         </bean> -->              <!--  <bean id="entitymanagerfactory" class="org.springframework.orm.jpa.localcontainerentitymanagerfactorybean">         </bean> -->          <!--  <bean id="entitymanagerfactory"             class="org.springframework.orm.jpa.localcontainerentitymanagerfactorybean">               <property name="persistencexmllocation" value="classpath:meta-inf/persistence.xml"></property>          </bean> -->       </beans> 

persistence.xml (inside meta-inf folder. i've defined value of persistence unit: "gemmajpa")

    <?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_1_0.xsd" version="1.0">         <persistence-unit name="gemmajpa">              <properties>            <property name="javax.persistence.jdbc.url"                      value="jdbc/poolgestorwsadjudicataris"/>              </properties>        </persistence-unit>      </persistence> 

does know triggering problem? thank much.


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -