我希望有人能指出这个问题。我从同一个Liferay项目部署了两个portlet,一个在控制面板中,另一个在更一般的添加更多类别中。
但是在门户上查看它们时,可以添加到页面的那个显示portlet暂时不可用,而另一个显示在控制面板中,但只显示标题。
我查看了liferay中的日志 - (今天的日期).log并且错误显示服务器找不到jsp的。错误是这样的:
ERROR [http-bio-8080-exec-5][PortletRequestDispatcherImpl:115] javax.servlet.ServletException: Archivo JSP "/registros/view.jsp" no encontrado
javax.servlet.ServletException: Archivo JSP "/registros/view.jsp" no encontrado
at org.apache.jasper.servlet.JspServlet.handleMissingResource(JspServlet.java:412)
etc... etc...
表示添加更多类别中的portlet,以及控制面板中的portlet:
ERROR [http-bio-8080-exec-3][MVCPortlet:366] null is not a valid include
15:54:51,434 ERROR [http-bio-8080-exec-3][ComboServlet:92] javax.servlet.ServletException: Resource /css/EContinuaAdmin.css does not exist in caja- virtual-portlet
javax.servlet.ServletException: Resource /css/EContinuaAdmin.css does not exist in caja-virtual-portlet
at com.liferay.portal.servlet.ComboServlet.getResourceURL(ComboServlet.java:364)
etc... etc...
ERROR [http-bio-8080-exec-3][status_jsp:769] javax.servlet.ServletException: Resource /js/EContinuaAdmin.js does not exist in caja-virtual-portlet
javax.servlet.ServletException: Resource /js/EContinuaAdmin.js does not exist in caja- virtual-portlet
at com.liferay.portal.servlet.ComboServlet.getResourceURL(ComboServlet.java:364)
etc... etc...
还有最后一个portlet:
ERROR [http-bio-8080-exec-3][MVCPortlet:366] null is not a valid include
15:55:43,057 WARN [http-bio-8080-exec-3][code_jsp:128] {code="404", msg="/caja- virtual-portleticon.png", uri=/caja-virtual-portleticon.png}
15:57:48,762 WARN [http-bio-8080-exec-1][code_jsp:128] {code="404", msg="/caja- virtual-portleticon.png", uri=/caja-virtual-portleticon.png}
15:57:50,002 WARN [http-bio-8080-exec-3][code_jsp:128] {code="404", msg="/caja- virtual-portleticon.png", uri=/caja-virtual-portleticon.png}
15:58:12,180 ERROR [http-bio-8080-exec-7][MVCPortlet:366] null is not a valid include
15:58:12,934 ERROR [http-bio-8080-exec-7][ComboServlet:92] javax.servlet.ServletException: Resource /css/EContinuaAdmin.css does not exist in caja- virtual-portlet
javax.servlet.ServletException: Resource /css/EContinuaAdmin.css does not exist in caja-virtual-portlet
at com.liferay.portal.servlet.ComboServlet.getResourceURL(ComboServlet.java:364)
etc... etc...
我可以理解我所展示的第二种情况中的大多数错误,因为项目中实际上没有这样的js或css文件,但我不明白为什么它找不到jsp。 我将展示我的portlet.xml,因此很清楚:
<portlet>
<portlet-name>caja-virtual</portlet-name>
<display-name>Caja Virtual</display-name>
<portlet-class>com.cide.cajaVirtual.EContinua.portlet.CajaVirtualPortlet</portlet-class>
<init-param>
<name>view-template</name>
<value>/registros/view.jsp</value>
</init-param>
我有两个文件夹,我有jsp:admin和registros,为什么会发生这种情况。而且,如何处理其他错误,我不确定。我应该在js和css文件夹中简单地删除EContinuaAdmin.css和EContinuaAdmin.js吗?最后,为什么要求这些文件的项目对我来说并不清楚,我只在Eclipse中为liferay插件项目自动创建的那些文件夹中有一个main.css和一个main.js.
Aditional(我很抱歉,如果这看起来应该是另一个问题,那就是我想要显示所有错误,因为日志对我来说太神秘了,我想丢弃选项)我看到最后两个错误在日志中,我不知道为什么会发生:
ERROR [http-bio-8080-exec-2][DefaultTransactionExecutor:93] Application exception overridden by commit exception
org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Object of class [com.liferay.portal.model.impl.PortalPreferencesImpl] with identifier [11178]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.liferay.portal.model.impl.PortalPreferencesImpl#11178]
etc... etc...
ERROR [http-bio-8080-exec-2][PortalPreferencesImpl:192] org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Object of class [com.liferay.portal.model.impl.PortalPreferencesImpl] with identifier [11178]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.liferay.portal.model.impl.PortalPreferencesImpl#11178]
org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException: Object of class [com.liferay.portal.model.impl.PortalPreferencesImpl] with identifier [11178]: optimistic locking failed; nested exception is org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [com.liferay.portal.model.impl.PortalPreferencesImpl#11178]
at
etc... etc...
答案 0 :(得分:1)
/registros/view.jsp
(对于tomcat,它应该在webapps/caja-virtual-portlet/registros/view.jsp
中)。如果没有,请确保您的项目包含在docroot/registros/view.jsp
liferay-portlet.xml
您提供的路径 - 例如对于css,js和图标。我在图标中看到的网址显示缺少&#34; /&#34; - 您应该添加到liferay-portlet.xml
caja- virtual-portleticon.png
中的空格来自哪里 - 在格式化xml文件后看起来像是换行符。 如果这没有帮助,请尝试检查部署是否按预期运行:例如如果您在WAR文件中找到了所需的所有资源 - 它们可能最终会出现在Ant(或您构建的任何内容)并不期望它们的目录中。