You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Nijisha <ni...@gmail.com> on 2012/08/01 09:19:27 UTC

Error in deploying war file

Hi,
  I am new to maven...
I created java spring hibernate project.. and i kept all .java files in this
path
Myapplication\src\main\java\com\mycompany
and create resources, webapp folders in Myapplication\src\main
 and inside resources i created 3 folders hibernate, properties and spring.
in hibernate i kept all .hbm.xml files, in properties all properties files,
and in spring again i created 3 folders beans, config and database.
in beans i kept dispatch-servlet.xml  and in database i kept
hibernate.cfg.xml.
    in webapp i created WebINF\pages inside WebINF i kept web.xml and inside
the pages folder i kept all jsp pages...
 
After this using the command mvn clean install -U -U and it shows BUILD
SUCCESS.
then using this command mvn war : war. for creating the war.
then i deployed the war file in localhost 8080. then I got the index page of
my application.. then after clicking any link on the index page it shows 500
error..
My pOM.xml is

<project xmlns="http://maven.apache.org/POM/4.0.0" 
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
  http://maven.apache.org/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>com.mindtree.entity</groupId>
  <artifactId>Simple</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>Simple</name>
  
 <repositories>
		<repository>
			<id>java.net</id>
			<url>http://download.java.net/maven/2</url>
		</repository>
		<repository>
    <id>com.springsource.repository.bundles.release</id>
    <name>SpringSource Enterprise Bundle Repository - SpringSource Bundle
Releases</name>
    <url>http://repository.springsource.com/maven/bundles/release</url>
</repository>
<repository>
    <id>com.springsource.repository.bundles.external</id>
    <name>SpringSource Enterprise Bundle Repository - External Bundle
Releases</name>
    <url>http://repository.springsource.com/maven/bundles/external</url>
</repository>
  <repository>
        <id>Version99</id>
        <name>Version 99 Does Not Exist Maven repository</name>
        <layout>default</layout>
        <url>http://no-commons-logging.zapto.org/mvn2</url>
    </repository>
	</repositories>
  
	 <dependencies>
 	  <dependency>

         <groupId>org.hibernate</groupId> 
  <artifactId>hibernate-core</artifactId> 
  <version>4.1.5.SP1</version> 


      </dependency>

      <dependency>
	<groupId>org.aspectj</groupId>
	<artifactId>aspectjweaver</artifactId>
	<version>1.6.8</version>
</dependency>
       <dependency>        
      
<groupId>org.aspectj</groupId> 
  <artifactId>aspectjrt</artifactId> 
 
  <version>1.7.0</version> 

  </dependency>



      <dependency>

        <groupId>dom4j</groupId>

        <artifactId>dom4j</artifactId>

        <version>1.6.1</version>

      </dependency>

      <dependency>

        <groupId>javassist</groupId>

        <artifactId>javassist</artifactId>

        <version>3.4.GA</version>

      </dependency>

      <dependency>

        <groupId>javax.transaction</groupId>

        <artifactId>jta</artifactId>

        <version>1.1</version>

      </dependency>

      <dependency>

        <groupId>org.slf4j</groupId>

        <artifactId>slf4j-api</artifactId>

        <version>1.5.6</version>

      </dependency>

      <dependency>

        <groupId>org.slf4j</groupId>

        <artifactId>slf4j-log4j12</artifactId>

        <version>1.5.6</version>

      </dependency>
	  



<dependency>
	<groupId>ant</groupId>
	<artifactId>ant-antlr</artifactId>
	<version>1.6.5</version>
</dependency>
            

<dependency>
	<groupId>ant</groupId>
	<artifactId>ant-junit</artifactId>
	<version>1.6.5</version>
</dependency>
            

<dependency>
	<groupId>ant</groupId>
	<artifactId>ant-launcher</artifactId>
	<version>1.6.5</version>
</dependency>
            

<dependency>
	<groupId>antlr</groupId>
	<artifactId>antlr</artifactId>
	<version>2.7.6</version>
</dependency>
            

<dependency>
	<groupId>ant</groupId>
	<artifactId>ant-swing</artifactId>
	<version>1.6.5</version>
</dependency>
            

<dependency>
	<groupId>asm</groupId>
	<artifactId>asm-all</artifactId>
	<version>2.2</version>
</dependency>
            

<dependency>
      <groupId>asm</groupId>
      <artifactId>asm-attrs</artifactId>
      <version>1.5.3</version>
    </dependency>


<dependency>
      <groupId>aspectj</groupId> 
  <artifactId>aspectjrt</artifactId> 
  <version>1.5.4</version>
    </dependency>


<dependency>
	<groupId>org.aspectj</groupId>
	<artifactId>aspectjweaver</artifactId>
	<version>1.6.2</version>
</dependency>
            

<dependency>
	<groupId>c3p0</groupId>
	<artifactId>c3p0</artifactId>
	<version>0.9.1</version>
</dependency>
            

<dependency>
<groupId>cglib</groupId> 
  <artifactId>cglib</artifactId> 
  
  <version>2.2.2</version> 

    </dependency>


    <dependency>
      <groupId>commons-collections</groupId>
      <artifactId>commons-collections</artifactId>
      <version>2.1.1</version>
    </dependency>


<dependency>
	<groupId>javax.servlet</groupId>
	<artifactId>jstl</artifactId>
	<version>1.2</version>
</dependency>

<dependency>
	<groupId>taglibs</groupId>
	<artifactId>standard</artifactId>
	<version>1.1.2</version>
</dependency>

<dependency>
	<groupId>org.springframework</groupId>
	<artifactId>spring-webmvc</artifactId>
	<version>3.0.3.RELEASE</version>
</dependency>
            

<dependency>
	<groupId>org.springframework</groupId> 
  <artifactId>spring</artifactId> 
 
  <version>2.5.6.SEC03</version> 
</dependency>
            


 <dependency>
     <groupId>org.springframework</groupId> 
  <artifactId>spring-web</artifactId> 
  
  <version>3.1.2.RELEASE</version> 

    </dependency>


 <dependency>
      <groupId>org.springframework</groupId> 
  <artifactId>spring-tx</artifactId> 
  
  <version>3.1.2.RELEASE</version> 

    </dependency>


  <dependency>
      <groupId>org.springframework</groupId> 
  <artifactId>spring-test</artifactId> 
  
  <version>3.1.2.RELEASE</version> 

    </dependency>

  <dependency>
      <groupId>org.springframework</groupId> 
  <artifactId>spring-orm</artifactId> 
  
  <version>3.1.2.RELEASE</version> 

    </dependency>

   <dependency>
       
<groupId>org.springframework</groupId> 
  <artifactId>spring-jdbc</artifactId> 
 
  <version>3.1.2.RELEASE</version> 


    </dependency>

    <dependency>
      <groupId>org.springframework</groupId> 
  <artifactId>spring-expression</artifactId> 
 
  <version>3.1.2.RELEASE</version> 

    </dependency>

   <dependency>
      <groupId>org.springframework</groupId> 
  <artifactId>spring-core</artifactId> 
 
  <version>3.1.2.RELEASE</version> 

    </dependency>

 <dependency>
      <groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>3.1.2.RELEASE</version>
    </dependency>

    <dependency>
      <groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>

<version>3.1.2.RELEASE</version>
 </dependency>

 <dependency>
      <groupId>org.springframework</groupId>
<artifactId>spring-aspects</artifactId>

<version>3.1.2.RELEASE</version>
    </dependency>

 <dependency>
      <groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>

<version>3.1.2.RELEASE</version>
    </dependency>

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.1.9</version>
	
  </dependency>
  <dependency>
    <groupId>org.apache.tomcat</groupId>
	<artifactId>servlet-api</artifactId>
	<version>6.0.35</version>
	
  </dependency>
<dependency>
  
	<groupId>ant</groupId>
	<artifactId>ant-swing</artifactId>
	<version>1.6.5</version>
  </dependency>
<dependency>
	<groupId>log4j</groupId>
	<artifactId>log4j</artifactId>
	<version>1.2.11</version>
</dependency>
            
 
  </dependencies>
  <build>
	   <plugins>
		
		<plugin>
			<groupId>org.apache.maven.plugins</groupId>
			<artifactId>maven-war-plugin</artifactId>
			<configuration>
				<webResources>
					<resource>
						<directory>${basedir}/src/main/java</directory>
						<targetPath>WEB-INF/classes</targetPath>
						<includes>
							<include>**/*.properties</include>
							<include>**/*.xml</include>
							<include>**/*.css</include>
							<include>**/*.html</include>
						</includes>
					</resource>
				</webResources>
			</configuration>
		</plugin>
 
		
		<plugin>
			<artifactId>maven-compiler-plugin</artifactId>
			<configuration>
				<source>1.6</source>
				<target>1.6</target>
			</configuration>
		</plugin>
	<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.4</version>
    </plugin>
   <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <executions>
          <execution>
            <goals>
              <goal>java</goal>
            </goals>
          </execution>
        </executions>
 
        
      </plugin>

	   </plugins>
	</build>
	

</project>



and my localhosterror.log file is 




Aug 1, 2012 11:41:53 AM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Aug 1, 2012 11:41:53 AM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Aug 1, 2012 11:42:06 AM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'dispatch'
Aug 1, 2012 11:42:06 AM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
java.lang.NoSuchFieldError: APPLICATION_CONTEXT_ID_PREFIX
	at
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:430)
	at
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)
	at
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)
	at
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)
	at
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
	at javax.servlet.GenericServlet.init(GenericServlet.java:212)
	at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
	at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:806)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	at java.lang.Thread.run(Unknown Source)
Aug 1, 2012 11:42:06 AM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Allocate exception for servlet dispatch
java.lang.NoSuchFieldError: APPLICATION_CONTEXT_ID_PREFIX
	at
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:430)
	at
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)
	at
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)
	at
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)
	at
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
	at javax.servlet.GenericServlet.init(GenericServlet.java:212)
	at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1161)
	at
org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:806)
	at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
	at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
	at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
	at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
	at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
	at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
	at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
	at java.lang.Thread.run(Unknown Source)




I am not able to solve this problem.... :(



--
View this message in context: http://maven.40175.n5.nabble.com/Error-in-deploying-war-file-tp5715524.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Error in deploying war file

Posted by Paul French <pa...@kirona.com>.
Yes go to Spring forums. But I thought Spring MVC  3 requires Spring 
core 3  and there was artifact name change from spring 2 to 3

You could try removing the maven reference to spring core and see what 
gets pulled in by spring mvc 3

*Paul French
Technical Lead/Research & Development
* Kirona Solutions Ltd
Tel: 01625 585511
E-Mail: paul.french@kirona.com
Web: www.kirona.com <http://www.kirona.com>

This email and any attachments are confidential and should only be read 
by those to whom they are addressed. If you are not the intended 
recipient, please contact us on 01625 585511, delete the email 
(including any attachment) from your computer and destroy any copies. 
Any distribution or copying without our prior permission is prohibited. 
Internet communications are not always secure and may be subject to 
delays, non-delivery and unauthorised alterations. Therefore, 
information expressed in this message is not given or endorsed by Kirona 
Solutions Limited ("Kirona") unless otherwise notified by our duly 
authorised representative independent of this message. No warranty is 
given that this email (including any attachment) is virus free. Any 
views or opinions presented are solely those of the author and do not 
necessarily represent those of Kirona.

Registered addresses: Kirona Solutions Limited, Barrington House, Heyes 
Lane, Alderley Edge, Cheshire. SK9 7LA Registered in England and Wales 
No: 04678711

On 01/08/2012 13:38, Wayne Fay wrote:
>> Aug 1, 2012 11:42:06 AM org.apache.catalina.core.ApplicationContext log
>> INFO: Initializing Spring FrameworkServlet 'dispatch'
>> Aug 1, 2012 11:42:06 AM org.apache.catalina.core.ApplicationContext log
>> SEVERE: StandardWrapper.Throwable
>> java.lang.NoSuchFieldError: APPLICATION_CONTEXT_ID_PREFIX
>>          at
>> org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:430)
> Ignore everything else. This is your problem. Take this problem to the
> Spring people and ask them to help you solve it.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


Re: Error in deploying war file

Posted by Wayne Fay <wa...@gmail.com>.
> Aug 1, 2012 11:42:06 AM org.apache.catalina.core.ApplicationContext log
> INFO: Initializing Spring FrameworkServlet 'dispatch'
> Aug 1, 2012 11:42:06 AM org.apache.catalina.core.ApplicationContext log
> SEVERE: StandardWrapper.Throwable
> java.lang.NoSuchFieldError: APPLICATION_CONTEXT_ID_PREFIX
>         at
> org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:430)

Ignore everything else. This is your problem. Take this problem to the
Spring people and ask them to help you solve it.

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Error in deploying war file

Posted by Nijisha <ni...@gmail.com>.
Hi,
That was a typing mistake. It is WEB-INF...
:)



--
View this message in context: http://maven.40175.n5.nabble.com/Error-in-deploying-war-file-tp5715524p5715554.html
Sent from the Maven - Users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Error in deploying war file

Posted by Thorsten Heit <th...@gmx.de>.
Hi,

> and create resources, webapp folders in Myapplication\src\main
> and inside resources i created 3 folders hibernate, properties and spring.
> in hibernate i kept all .hbm.xml files, in properties all properties files,
> and in spring again i created 3 folders beans, config and database.
> in beans i kept dispatch-servlet.xml  and in database i kept
> hibernate.cfg.xml.
>    in webapp i created WebINF\pages inside WebINF i kept web.xml and inside
> the pages folder i kept all jsp pages...

I don't know if this is simply a spelling error in your mail, but that folder is normally called WEB-INF, not WebINF...

Apart from that, why do you add lots of repository entries to your pom.xml? This is generally considered a bad idea, and I recommend to install a repository manager such as Nexus, Artifactory, Archiva etc. somewhere on your environment and point your Maven installation to that instance...


HTH

Thorsten