Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Tanaji Londhe
Can not find the tag library descriptor for "http://java.sun.com/portlet_2_
August 19, 2012 11:58 PM
Answer

Tanaji Londhe

Rank: Regular Member

Posts: 196

Join Date: April 25, 2012

Recent Posts

Hi,
I create simple dynamic web project (without maven) project -- spring mvc portlet which is annotation based. Simply it works properly means without using <portlet:defineObjects/>
when i include this snippets in my jsp file <%@ taglib uri="http://java.sun.com/portlet_2_0" prefix="portlet" %>
<portlet:defineObjects />
. It throws some error which is given below
Can not find the tag library descriptor for "http://java.sun.com/portlet_2_
Unknown tag (portlet:defineObjects).
Plugin package on context springDemo cannot be tracked because this WAR does not contain a liferay-plugin-package.xml file
06:47:37,717 INFO [PortletHotDeployListener:614] Registering portlets for springDemo
06:47:38,814 ERROR [HotDeployUtil:114] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portlets for springDemo
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portlets for springDemo
at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:46)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:118)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._doFireDeployEvent(HotDeployUtil.java:111)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(HotDeployUtil.java:188)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:40)
at com.liferay.portal.kernel.servlet.PortletContextListener.doPortalInit(PortletContextListener.java:101)
at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:42)
at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:61)
at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:53)
at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:52)
at com.liferay.portal.kernel.servlet.PortletContextListener.contextInitialized(PortletContextListener.java:55)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4765)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5260)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:842)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1581)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.ClassCastException: org.springframework.web.portlet.DispatcherPortlet cannot be cast to javax.portlet.Portlet
at com.liferay.portlet.PortletBagFactory.create(PortletBagFactory.java:131)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.initPortlet(PortletHotDeployListener.java:524)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.doInvokeDeploy(PortletHotDeployListener.java:302)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:115)
... 23 more

I follow this link also but not work.
http://www.liferay.com/community/forums/-/message_boards/message/11350704
Tejas Kanani
RE: Can not find the tag library descriptor for "http://java.sun.com/portle
August 20, 2012 12:48 AM
Answer

Tejas Kanani

Rank: Liferay Master

Posts: 653

Join Date: January 6, 2009

Recent Posts

Have you tried this ?
http://www.liferay.com/community/forums/-/message_boards/message/11350704
Tanaji Londhe
RE: Can not find the tag library descriptor for "http://java.sun.com/portle
August 20, 2012 1:10 AM
Answer

Tanaji Londhe

Rank: Regular Member

Posts: 196

Join Date: April 25, 2012

Recent Posts

Thanks Tejas.
I mention in my post I already tried this post.
Is it require to add portlet taglib in class path.
Here I add only portlet.jar in my lib folder.

web.xml
<web-app>
<servlet>
<servlet-name>ViewRendererServlet</servlet-name>
<servlet-class>
org.springframework.web.servlet.ViewRendererServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>ViewRendererServlet</servlet-name>
<url-pattern>/WEB-INF/servlet/view</url-pattern>
</servlet-mapping>
<taglib>
<taglib-uri>http://java.sun.com/portlet_2_0 </taglib-uri>
<taglib-location>/WEB-INF/tld/liferay-portlet.tld</taglib-location>
</taglib>

</web-app>
Tejas Kanani
RE: Can not find the tag library descriptor for "http://java.sun.com/portle
August 20, 2012 1:47 AM
Answer

Tejas Kanani

Rank: Liferay Master

Posts: 653

Join Date: January 6, 2009

Recent Posts

Sorry missed you last 2 lines in previous post. Thought it was part of error logs.
Well, If you've posted your entire web.xml. Then try replacing below code with yours. I guess you've missed <jsp-config>.

web.xml
 1<web-app>
 2<servlet>
 3<servlet-name>ViewRendererServlet</servlet-name>
 4<servlet-class>
 5org.springframework.web.servlet.ViewRendererServlet
 6</servlet-class>
 7<load-on-startup>1</load-on-startup>
 8</servlet>
 9<servlet-mapping>
10<servlet-name>ViewRendererServlet</servlet-name>
11<url-pattern>/WEB-INF/servlet/view</url-pattern>
12</servlet-mapping>
13[b]<jsp-config>[/b]
14<taglib>
15<taglib-uri>http://java.sun.com/portlet_2_0 </taglib-uri>
16<taglib-location>/WEB-INF/tld/liferay-portlet.tld</taglib-location>
17</taglib>
18[b]</jsp-config>[/b]
19</web-app>
Tanaji Londhe
RE: Can not find the tag library descriptor for "http://java.sun.com/portle
August 20, 2012 3:50 AM
Answer

Tanaji Londhe

Rank: Regular Member

Posts: 196

Join Date: April 25, 2012

Recent Posts

I use same above snippet in my apps still it generates error

Deploying configuration descriptor D:\Birdzi-Portal\liferay-portal-6.1.0-ce-ga1\tomcat-7.0.23\conf\Catalina\localhost\springDemo.xml
Aug 20, 2012 10:46:11 AM org.apache.catalina.startup.HostConfig deployDescriptor
WARNING: A docBase D:\Birdzi-Portal\liferay-portal-6.1.0-ce-ga1\tomcat-7.0.23\webapps\springDemo inside the host appBase has been specified, and will be ignored
Aug 20, 2012 10:46:11 AM org.apache.catalina.startup.SetContextPropertiesRule begin
WARNING: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:springDemo' did not find a matching property.
Aug 20, 2012 10:46:11 AM org.apache.catalina.startup.ContextConfig parseWebXml
SEVERE: Parse error in application web.xml file at jndi:/localhost/springDemo/WEB-INF/web.xml
java.lang.IllegalArgumentException: taglib definition not consistent with specification version
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2687)
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2719)
at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1279)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1363)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1537)
at org.apache.catalina.startup.ContextConfig.parseWebXml(ContextConfig.java:1742)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1174)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:828)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:302)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5148)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:842)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:649)
at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1581)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.IllegalArgumentException: taglib definition not consistent with specification version
at org.apache.catalina.startup.TaglibLocationRule.begin(WebRuleSet.java:1164)
at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1276)
... 30 more
Aug 20, 2012 10:46:11 AM org.apache.catalina.startup.ContextConfig parseWebXml
SEVERE: Occurred at line 430 column 10
Aug 20, 2012 10:46:11 AM org.apache.catalina.startup.ContextConfig configureStart
SEVERE: Marking this application unavailable due to previous error(s)
Aug 20, 2012 10:46:11 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error getConfigured
Aug 20, 2012 10:46:11 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context startup failed due to previous errors
Tejas Kanani
RE: Can not find the tag library descriptor for "http://java.sun.com/portle
August 20, 2012 4:14 AM
Answer

Tejas Kanani

Rank: Liferay Master

Posts: 653

Join Date: January 6, 2009

Recent Posts

SEVERE: Parse error in application web.xml file at jndi:/localhost/springDemo/WEB-INF/web.xml
java.lang.IllegalArgumentException: taglib definition not consistent with specification version

From the error looks like there is some version problem. Check your springDemo/WEB-INF/web.xml file.
Hitoshi Ozawa
RE: Can not find the tag library descriptor for "http://java.sun.com/portle
August 20, 2012 5:02 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7952

Join Date: March 23, 2010

Recent Posts

Try adding adding following to liferay-plugin-package.properties file:

portal-dependency-tlds=\
c.tld
Tanaji Londhe
RE: Can not find the tag library descriptor for "http://java.sun.com/portle
August 21, 2012 5:36 AM
Answer

Tanaji Londhe

Rank: Regular Member

Posts: 196

Join Date: April 25, 2012

Recent Posts

can you please give more information about the portal-dependency-tlds.
Here I am using spring MVC portlet to create portlet without using Maven.
Tanaji Londhe
RE: Can not find the tag library descriptor for "http://java.sun.com/portle
August 21, 2012 7:41 AM
Answer

Tanaji Londhe

Rank: Regular Member

Posts: 196

Join Date: April 25, 2012

Recent Posts

Tejas Kanani:
SEVERE: Parse error in application web.xml file at jndi:/localhost/springDemo/WEB-INF/web.xml
java.lang.IllegalArgumentException: taglib definition not consistent with specification version

From the error looks like there is some version problem. Check your springDemo/WEB-INF/web.xml file.



I made some changes in web.xml file

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">

<display-name>Sample Portal</display-name>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<servlet>
<servlet-name>view-servlet</servlet-name>
<servlet-class>org.springframework.web.servlet.ViewRendererServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>view</servlet-name>
<url-pattern>/WEB-INF/servlet/view</url-pattern>
</servlet-mapping>
<jsp-config>
<taglib>
<taglib-uri>http://java.sun.com/portlet_2_0</taglib-uri>
<taglib-location>/WEB-INF/tld/liferay-portlet.tld</taglib-location>
</taglib>
</jsp-config>

</web-app>


but still I got this error
14:27:26,812 WARN [PluginPackageUtil:1058] Plugin package on context springDemo cannot be tracked because this WAR does not contain a liferay-plugin-package.xml file
..................................
Caused by: java.lang.ClassCastException: org.springframework.web.portlet.DispatcherPortlet cannot be cast to javax.portlet.Portlet
at com.liferay.portlet.PortletBagFactory.create(PortletBagFactory.java:131)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.initPortlet(PortletHotDeployListener.java:524)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.doInvokeDeploy(PortletHotDeployListener.java:302)
at com.liferay.portal.deploy.hot.PortletHotDeployListener.invokeDeploy(PortletHotDeployListener.java:115)
... 23 more
Anil T
RE: Can not find the tag library descriptor for "http://java.sun.com/portle
January 27, 2014 4:39 AM
Answer

Anil T

Rank: Regular Member

Posts: 231

Join Date: January 14, 2012

Recent Posts

Hi Tanaji,

Have you found any solution for the above problem. I am also facing the same.