Greetings, I have a web application that uses spring and JPA. logs tell me everything is running fine. However, I used Netbeans to create this application and so am using it for deployment on the server too.
During deployment I get this error:
Starting Tomcat process...
Waiting for Tomcat...
Tomcat server started.
In-place deployment at /root/NetBeansProjects/FYPTest/build/web
Deployment is in progress...
deploy?config=file%3A%2Ftmp%2Fcontext9072106357139916321.xml&path=/FYPTest
Server returned HTTP response code: 400 for URL: http://localhost:8084/manager/deploy?config=file%3A%2Ftmp%2Fcontext9072106357139916321.xml&path=/FYPTest
/root/NetBeansProjects/FYPTest/nbproject/build-impl.xml:706: The module has not been deployed.
BUILD FAILED (total time: 50 seconds)
My applicationContext.xml
<?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:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<!--bean id="propertyConfigurer"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
p:location="/WEB-INF/jdbc.properties" />
-->
<!-- Container Manager Persistence (CMP) Config using Spring+JPA and EclipseLinkProvider-->
<!--
Container Provider: Spring
Persistence Provider: EclipseLinkJPAProvider
SPI: Weaving Done by Tomcat (included tomcat-spring-weaver.jar in /lib)
-->
<bean id="userService" class="org.seecs.beans.UserDAO"/>
<bean id="fileService" class="org.seecs.beans.FileDAO"/> <!--Automatic injection of entityManager by container-->
<!--Bean to load application.properties file -->
<bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="location" value="classpath:application.properties"/>
</bean>
<bean id="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource"
p:driverClassName="${driverClass}"
p:url="${dbURL}"
p:username="${dbUserName}"
p:password="${dbPassword}" />
<!-- ADD PERSISTENCE SUPPORT HERE (jpa, hibernate, etc)LocalContainerEntityManagerFactoryBean -->
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="persistenceXmlLocation" value="classpath:META-INF/persistence.xml"/>
<property name="persistenceUnitName" value="entity-PU"/>
<property name="dataSource" ref="dataSource"/>
<property name="loadTimeWeaver">
<bean class="org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver"/>
</property>
<property name="jpaVendorAdapter" ref="vendorAdapter"/>
</bean>
<!--PlaceHolder Values are taken from /classes/application.properties-->
<bean id="vendorAdapter" class="org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter">
<!--placeholder:${platform}-->
<property name="databasePlatform" value="${platform}"/>
<property name="showSql" value="true"/>
<!--property name="generateDdl" value="true"/ recreares DB schema each time when loaded-->
</bean>
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory"/>
</bean>
<bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
<!-- To tell spring to look for @Transactional <tx:annotation-driven mode="aspectj" /> -->
<tx:annotation-driven/>
<!-- If you don't add this, entityManager is not injected and throws NullPointerException-->
<context:annotation-config />
<!--<context:load-time-weaver aspectj-weaving="on" >-->
<!--tx:jta-transaction-manager-->
<context:load-time-weaver aspectj-weaving="on"/>
</beans>
My context.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--Context antiJARLocking="true" path="/FYP"/-->
<Context docBase="FYPTest" path="/FYPTest">
<Loader loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader"/>
</Context>
My persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" 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">
<persistence-unit name="entity-PU" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<properties>
</properties>
</persistence-unit>
</persistence>
Its causing me inconvenience because I have to restart the server every time I make changes to any one of my servlets.
right im gonna answer this myself. probably a netbeans bug. It deploys fine on another version of netbeans on windows.