Home » Eclipse Projects » Virgo » Need help in deploying war file in virgo(Getting exception while accessing the rest based service)
| |
Re: Need help in deploying war file in virgo [message #714026 is a reply to message #714024] |
Tue, 09 August 2011 16:14 |
Pradeep Messages: 9 Registered: August 2011 |
Junior Member |
|
|
I added this to manifest file now I am getting following exception
org.springframework.context.ApplicationContextException: Fatal initialization error in servlet with name 'DataAPI': custom WebApplicationContext class [org.eclipse.virgo.web.dm.ServerOsgiBundleXmlWebApplicationContext] is not of type ConfigurableWebApplicationContext
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:407)
org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:458)
org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:339)
org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:306)
org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:127)
javax.servlet.GenericServlet.init(GenericServlet.java:212)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
org.eclipse.virgo.web.tomcat.ApplicationNameTrackingValve.invoke(ApplicationNameTrackingValve.java:29)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:554)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
java.lang.Thread.run(Thread.java:662)
And this is my manifest file
Manifest-Version: 1.0
Export-Package: com.org.my.data.bll.external.controllers;uses:=
"com.org.my.data.bll.external.response,com.org.my.data.
common.external.dto,com.org.my.data.common.external.exception"
,com.org.my.data.bll.external.response;uses:="com.org.my.data.common.external.exception,com.org.my.data.common.extern
al.interfaces,javax.xml.bind.annotation.adapters",com.org.my.d
ata.bll.internal.controllers;uses:="com.org.my.data.bll.extern
al.controllers,com.org.my.data.bll.external.response,com.click
able.pro.data.common.external.dto,com.org.my.data.common.exter
nal.exception,com.org.my.data.common.external.interfaces,org.s
pringframework.stereotype,org.springframework.web.bind.annotation",co
m.org.my.data.bll.internal.response;uses:="com.org.my.d
ata.bll.external.response,com.org.my.data.common.external.exce
ption,com.org.my.data.common.external.interfaces,javax.xml.bin
d.annotation,org.codehaus.jackson.map,org.codehaus.jackson.type,org.s
pringframework.http,org.springframework.http.converter"
Bundle-Version: 1.0.0
Tool: Bundlor 1.0.0.RELEASE
Bundle-ManifestVersion: 2
Import-Package: com.org.my.data.common.e
xternal.adapters.jaxb,com.org.my.data.common.external.dto,com.
org.my.data.common.external.exception,com.org.my.data.c
ommon.external.interfaces,javax.xml.bind.annotation,javax.xml.bind.an
notation.adapters,org.codehaus.jackson,org.codehaus.jackson.map,org.c
odehaus.jackson.map.type,org.codehaus.jackson.type,org.springframewor
k.http,org.springframework.http.converter,org.springframework.stereot
ype,org.springframework.util,org.springframework.web.bind.annotation,
org.springframework.web.servlet.mvc.annotation,org.springframework.we
b.servlet.view,org.springframework.web.servlet.view.json,org.eclipse.virgo.web.dm;version="[2.0.0, 3.0.0)"
Bundle-SymbolicName: bll
|
|
| |
Re: Need help in deploying war file in virgo [message #714442 is a reply to message #714053] |
Wed, 10 August 2011 14:20 |
Pradeep Messages: 9 Registered: August 2011 |
Junior Member |
|
|
Hi Dmitry
First of all thanks a lot for giving me the directions. It was helpful. I have added import statements as you suggested and modified the web.xml file but as of now I am getting 404 error once I try to access my rest service. I am again reproducing Manifest.Mf and Web.xml file below. I am using Spring 3.0.5 and Virgo 3.0.0.RC2
Manifest.mf
Manifest-Version: 1.0
Export-Package: com.org.prod.data.bll.external.controllers;uses:=
"com.org.prod.data.bll.external.response,com.org.prod.data.
common.external.dto,com.org.prod.data.common.external.exception"
,com.org.prod.data.bll.external.response;uses:="com.org.pr
o.data.common.external.exception,com.org.prod.data.common.extern
al.interfaces,javax.xml.bind.annotation.adapters",com.org.prod.d
ata.bll.internal.controllers;uses:="com.org.prod.data.bll.extern
al.controllers,com.org.prod.data.bll.external.response,com.click
able.prod.data.common.external.dto,com.org.prod.data.common.exter
nal.exception,com.org.prod.data.common.external.interfaces,org.s
pringframework.stereotype,org.springframework.web.bind.annotation",co
m.org.prod.data.bll.internal.response;uses:="com.org.prod.d
ata.bll.external.response,com.org.prod.data.common.external.exce
ption,com.org.prod.data.common.external.interfaces,javax.xml.bin
d.annotation,org.codehaus.jackson.map,org.codehaus.jackson.type,org.s
pringframework.http,org.springframework.http.converter"
Bundle-Version: 1.0.0
Tool: Bundlor 1.0.0.RELEASE
Bundle-ManifestVersion: 2
Import-Library: org.springframework.spring
Import-Package: com.org.prod.data.common.external.adapters.jaxb,com.org.prod.data.common.external.dto,com.
org.prod.data.common.external.exception,com.org.prod.data.c
ommon.external.interfaces,javax.xml.bind.annotation,javax.xml.bind.an
notation.adapters,org.codehaus.jackson,org.codehaus.jackson.map,org.c
odehaus.jackson.map.type,org.codehaus.jackson.type,org.springframewor
k.http,org.springframework.http.converter,org.springframework.util,
org.springframework.web.servlet.mvc.annotation,org.springframework.we
b.servlet.view,org.springframework.web.servlet.view.json,org.eclipse.virgo.web.dm,org.springframe
work.beans.factory.annotation;version="[3.0, 3.1)",org.springframewor
k.stereotype;version="[3.0, 3.1)",org.springframework.web.bind.annota
tion;version="[3.0, 3.1)"
Excluded-Imports: org.springframework.*
Bundle-SymbolicName: bll
Web.xml file
<?xml version="1.0" encoding="UTF-8"?>
<display-name>Business Logic Layer</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<context-param>
<param-name>contextClass</param-name>
<param-value>org.eclipse.virgo.web.dm.ServerOsgiBundleXmlWebApplicationContext</param-value>
</context-param>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:*context.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>DataAPI</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:*servlet.xml</param-value>
</init-param>
<init-param>
<param-name>contextClass</param-name>
<param-value>org.eclipse.virgo.web.dm.ServerOsgiBundleXmlWebApplicationContext</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>DataAPI</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
</web-app>
and servlet file is
<beans>
<context:component-scan base-package="com.org.prod.data" />
<!-- Configures the @Controller prodgramming model -->
<mvc:annotation-driven />
<!-- To enable @RequestMapping prodcess on type level and method level -->
<bean
class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" />
<bean
class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter">
<prodperty name="messageConverters">
<list>
<ref bean="jsonConverter" />
</list>
</prodperty>
</bean>
<bean id="jsonConverter"
class="com.org.prod.data.bll.internal.response.MyMappingJacksonHttpMessageConverter">
<prodperty name="supportedMediaTypes" value="application/json" />
<prodperty name="objectMapper" ref="jaxbJacksonObjectMapper" />
<prodperty name="prefixJson" value="true"></prodperty>
<prodperty name="prefixJsonString" value="while(1);"></prodperty>
</bean>
<bean
class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
<prodperty name="order" value="1" />
<prodperty name="mediaTypes">
<map>
<entry key="json" value="application/json" />
</map>
</prodperty>
<prodperty name="defaultViews">
<list>
<bean
class="org.springframework.web.servlet.view.json.MappingJacksonJsonView">
<prodperty name="objectMapper" ref="jaxbJacksonObjectMapper" />
</bean>
</list>
</prodperty>
</bean>
<bean id="methodHandlerExceptionResolver"
class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerExceptionResolver">
<prodperty name="messageConverters">
<list>
<ref bean="jsonConverter" />
</list>
</prodperty>
</bean>
<bean id="jaxbJacksonObjectMapper"
class="com.org.prod.data.common.external.adapters.jaxb.JaxbJacksonObjectMapper">
</bean>
</beans>
|
|
| | | |
Re: Need help in deploying war file in virgo [message #714900 is a reply to message #714562] |
Thu, 11 August 2011 17:44 |
Pradeep Messages: 9 Registered: August 2011 |
Junior Member |
|
|
Hi Dmitry,
As per Virgo documentation we can deploy a standard war file without any change. But I am not finding it that way. Before solving the previous problem I posted I want to understand fundamentals correctly. So I created a simple HelloWorld application in spring mvc using maven archetype provided. When I deploy the war helloworld.war on tomcat7 it is working absolutely fine. But when I deploy the same mvc in pickup directory of virgo tomcat server I am getting exception during bundle starting which is java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener.
So I am curious to know if there is anything need to be done before one deploy standard spring war on Virgo like creating a MANIFEST-INF folder parallel to WEB-INF folder and adding Manifest.mf file in it. If this is true that means I also need to import required bundles and packages. But then this means I am not able to deploy same war in standard tomcat and Virgo both without any change. I am attaching my sample for your reference(Removed dependent jars from lib to reduce size)
sorry for bugging you again and again.
Regards,
Pradeep
PS: few more data points.
After I got this exception while starting bundle I added a manifest file myself having following details...
Manifest-Version: 1.0
Bundle-Version: 1.0.0
Tool: Bundlor 1.0.0.RELEASE
Bundle-ManifestVersion: 2
Import-Library: org.springframework.spring
Bundle-SymbolicName: abc
After this I am getting 404 for all requests without any exception.
[Updated on: Thu, 11 August 2011 17:51] Report message to a moderator
|
|
| | | | | | | | | |
Goto Forum:
Current Time: Sat Oct 19 20:26:07 GMT 2024
Powered by FUDForum. Page generated in 0.12315 seconds
|