Forums de discussion

deployment javax.servlet.ServletException

Iñigo Boyano, modifié il y a 8 années.

deployment javax.servlet.ServletException

Junior Member Publications: 96 Date d'inscription: 04/02/14 Publications récentes
Hi,

Im trying to integrate an Spring MVC portlet inside of a Liferay Plugin Project with another non SpringMVC but MVCPortlets on it.

I have no compilation errors and deployment errors either. All the portlets of the plugin project are deployed including mine. But my portlet throws the following error when a open the page where it is:

JBWEB000236: Servlet.service() for servlet agregadoresContenidos threw exception: javax.servlet.ServletException: Could not complete render request: View is null

I am using JBOSS like aplicattion server.
My web.xml:
<servlet>
<servlet-name>agregadoresContenidos</servlet-name>
<servlet-class>org.springframework.web.servlet.ViewRendererServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>agregadoresContenidos</servlet-name>
<url-pattern>/33/*</url-pattern>
</servlet-mapping>


my portlet.xml:
<portlet>
<portlet-name>33</portlet-name>
<display-name>AgregadoresContenidos</display-name>
<portlet-class>org.springframework.web.portlet.DispatcherPortlet</portlet-class>
<init-param>
<name>contextConfigLocation</name>
<value>/WEB-INF/contexts/AgregadoresContenidos-portlet.xml</value>
</init-param>
<init-param>
<name>view-jsp</name>
<value>/portlets/33-agregadores-contenidos/confInicial.jsp</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
<portlet-mode>edit</portlet-mode>
</supports>
<resource-bundle>content.Language</resource-bundle>
<portlet-info>
<title>AgregadoresContenidos</title>
<short-title>AgregadoresContenidos</short-title>
<keywords>AgregadoresContenidos</keywords>
</portlet-info>
<security-role-ref>
<role-name>administrator</role-name>
</security-role-ref>
<security-role-ref>
<role-name>guest</role-name>
</security-role-ref>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
</portlet>


My liferay-porlet.xml
<portlet>
<portlet-name>33</portlet-name>
<icon>/icon.png</icon>
<instanceable>true</instanceable>
<private-session-attributes>false</private-session-attributes>
<header-portlet-css>/css/main.css</header-portlet-css>
<header-portlet-javascript>/js/jquery-1.12.1.min.js</header-portlet-javascript>
<footer-portlet-javascript>/js/main.js</footer-portlet-javascript>
</portlet>



Any idea how can i fix this problem?

Kind regards,

Iñigo
thumbnail
Vilmos Papp, modifié il y a 8 années.

RE: deployment javax.servlet.ServletException

Liferay Master Publications: 529 Date d'inscription: 21/10/10 Publications récentes
Hi,

Please check whether this path is correct or not:
<init-param>
<name>view-jsp</name>
<value>/portlets/33-agregadores-contenidos/confInicial.jsp</value>
</init-param> 


Further more, there was a change in parameter name, so please check the dtd whether it required view-jsp or view-template (or something similar)

Regards,
Vilmos
Iñigo Boyano, modifié il y a 8 années.

RE: deployment javax.servlet.ServletException

Junior Member Publications: 96 Date d'inscription: 04/02/14 Publications récentes
Hi Vilmos,

I've double check the path and i've tried the execution without <init-param> and with view.jsp or view-template. In the first case the error is the following:

Context initialization failed: org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from PortletContext resource [/WEB-INF/33-portlet.xml]; nested exception is java.io.FileNotFoundException: Could not open PortletContext resource [/WEB-INF/33-portlet.xml]

Can be SpringMVC portlets and MVC Portlets under the same LIferay Plugin Project or i m going to transform my SpringMVC Portlet in MVC Portlet to be included in the same Liferay Plugin Project?

Thanks
thumbnail
Vilmos Papp, modifié il y a 8 années.

RE: deployment javax.servlet.ServletException

Liferay Master Publications: 529 Date d'inscription: 21/10/10 Publications récentes
Hi,

Unfortunately I don't have experience with mixing SpringMVC portlets with basic MVC Portlets, so I cannot tell you whether it's possible or not. From the error, it seems somehow it tries to read 33-portlet.xml instead of portlet.xml what is a default descriptor for portlets. Probably somewhere you just added a leading "33-" accidentally.
Iñigo Boyano, modifié il y a 8 années.

RE: deployment javax.servlet.ServletException

Junior Member Publications: 96 Date d'inscription: 04/02/14 Publications récentes
This error refers to the aplication context file. Because i've deleted <init-param> of the path of my aplication context file, they search it under WEB-INF.

Only for double check, i've created the file 33-portlet.xml under /WEB-INF/ with the content of my aplicacion context file and the error is the same that if i put the <init-param> on my portlet.xml.

Servlet.service() for servlet ViewRendererServlet threw exception: javax.servlet.ServletException: Could not complete render request: View is null

Is too difficult to transform a SpringMVC portlet into a MVC Portlet?