Foros de discusión

Unable to open resource in class loader

Joern Muehlencord, modificado hace 13 años.

Unable to open resource in class loader

New Member Mensajes: 2 Fecha de incorporación: 22/12/10 Mensajes recientes
Hi all,

I just started to check out some things on Liferay 6.0.5 (Tomcat bundle) and I tried to add friendly url mapping to a test portlet as described in "Develpopment Documentation" on page 23. But it does not work as I get the following exception:

com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering portlets for my-greeting-portlet
Caused by: java.io.IOException: Unable to open resource in class loader com/sample/mygreeting/portlet/mygreeting-friendly-url-routes.xml


I added the following to liferay-portlet.xml
<friendly-url-mapper-class>
  com.liferay.portal.kernel.portlet.DefaultFriendlyURLMapper
</friendly-url-mapper-class>
<friendly-url-mapping>mygreeting</friendly-url-mapping>
<friendly-url-routes>
  com/sample/mygreeting/portlet/mygreeting-friendly-url-routes.xml
</friendly-url-routes>


And in WEB_INF/src/com/sample/mygreeting/portlet I created the file mygreeting-friendly-url-routes.xml with the following content:
<!--?xml version="1.0"?-->

<routes>
  <route>
    <pattern>/{jspPageName}</pattern>
    <generated-parameter name="jspPage">/{jspPageName}.jsp</generated-parameter>     
  </route>
</routes>


Anyone an idea why it working as soon as I add the values to liferay-portlet.xml?

Regards
Joern
thumbnail
Shagul Khajamohideen, modificado hace 13 años.

RE: Unable to open resource in class loader

Liferay Master Mensajes: 758 Fecha de incorporación: 27/09/07 Mensajes recientes
Did you add them directly in the webapps or trying to build and deploy your test portlet?
Joern Muehlencord, modificado hace 13 años.

RE: Unable to open resource in class loader

New Member Mensajes: 2 Fecha de incorporación: 22/12/10 Mensajes recientes
Hi,


I tried this using build / deploy - but after your post I also tried to update it directly - both without success.

Regards
Joern
Roy Brondgeest, modificado hace 12 años.

RE: Unable to open resource in class loader

Junior Member Mensajes: 25 Fecha de incorporación: 13/01/11 Mensajes recientes
Have you ever found a fix to this?
Please share with us, as I have the same problem.

Thanks!
thumbnail
Thiago Leão Moreira, modificado hace 12 años.

RE: Unable to open resource in class loader

Liferay Legend Mensajes: 1449 Fecha de incorporación: 10/10/07 Mensajes recientes
Have you checked if the xml file is available in your classes directory? If so put a / in front of the path in the liferay-portlet.xml file. Something like /com/sample/mygreeting/portlet/mygreeting-friendly-url-routes.xml
thumbnail
mukesh kumar, modificado hace 11 años.

RE: Unable to open resource in class loader

Junior Member Mensajes: 57 Fecha de incorporación: 13/03/12 Mensajes recientes
Hi All
I have also the same problem.
Unable to open resource in class loader

Can anybody please resolve it.
Regards
Mukesh Kumar
thumbnail
Sushil Kumar Saini, modificado hace 11 años.

RE: Unable to open resource in class loader

Regular Member Mensajes: 104 Fecha de incorporación: 27/07/11 Mensajes recientes
Hi All,

I have tried to implement the friendly URL. And it is working fine for me in liferay version 6.0.6 CE and 6.1.1 CE GA2. And i am using the tomcat 6.0.35 as application server.

Added the following configuration in the liferay-portlet.xml
<friendly-url-mapper-class>
com.liferay.portal.kernel.portlet.DefaultFriendlyURLMapper
</friendly-url-mapper-class>
<friendly-url-mapping>mygreeting</friendly-url-mapping>
<friendly-url-routes>
com/sample/mygreeting/portlet/mygreeting-friendly-url-routes.xml
</friendly-url-routes>

And placed the mygreeting-friendly-url-routes.xml in the following directory.
{liferay-plugins-sdk}\portlets\{myportlet}\docroot\WEB-INF\src/com/sample/mygreeting/portlet
thumbnail
mukesh kumar, modificado hace 11 años.

RE: Unable to open resource in class loader

Junior Member Mensajes: 57 Fecha de incorporación: 13/03/12 Mensajes recientes
Hi Sushil
thanks for your response. i want to discuss one more thing whether it is possible to achieve same task by using ` Liferay v6.1 CE Server (Tomcat 7) as a application server.
Regards
mukesh
thumbnail
Bart Simpson, modificado hace 11 años.

RE: Unable to open resource in class loader

Liferay Master Mensajes: 522 Fecha de incorporación: 29/08/11 Mensajes recientes
I have tried to implement the friendly URL. And it is working fine for me in liferay version 6.0.6 CE and 6.1.1 CE GA2

So it should be possible
thumbnail
Sushil Kumar Saini, modificado hace 11 años.

RE: Unable to open resource in class loader

Regular Member Mensajes: 104 Fecha de incorporación: 27/07/11 Mensajes recientes
Hi Mukesh,
Yeah, same thing is possible with the 6.1.1 CE GA2.
Actually, In my case first, implemented with 6.0.6. Then we upgraded the version of the liferay 6.1.1. And it worked fine.
Thanks
thumbnail
Abhimanyu Saraswat, modificado hace 11 años.

RE: Unable to open resource in class loader

Junior Member Mensajes: 62 Fecha de incorporación: 26/02/13 Mensajes recientes
I am also getting the same problem....Can anyone help....

Thanks in advance..

Thanks & Regards
Rahul Saraswat
thumbnail
Sushil Kumar Saini, modificado hace 11 años.

RE: Unable to open resource in class loader

Regular Member Mensajes: 104 Fecha de incorporación: 27/07/11 Mensajes recientes
Hi Abhimanyu ,.... Have you checked whether configuration files are properly deployed in the tomcat webapps/{portlet_war} folder ?
Marko Perić, modificado hace 8 años.

RE: Unable to open resource in class loader

Junior Member Mensajes: 52 Fecha de incorporación: 3/09/14 Mensajes recientes
mukesh kumar:
Hi All
I have also the same problem.
Unable to open resource in class loader

Can anybody please resolve it.
Regards
Mukesh Kumar


Hi to everybody,

as I see there is many people struggling with this problem, and I am one of them also. Could anyone explain where is the problem with referencing friendly-url-routes.xml. I've tried to put it in WEB-INF/src/com/... and also in WEB-INF, on the same level as liferay-portlet.xml from where it is called, but problem persists.

Is there anyone who has clear vision howshould it look alike and why is this same error happening to so many people?

Thanks,

Marko
khosro makari, modificado hace 9 años.

RE: Unable to open resource in class loader

New Member Mensaje: 1 Fecha de incorporación: 5/08/14 Mensajes recientes
hi ,
if you are working on maven project , you should copy -url-routes.xml into resources folder.
when you copy this file in src folder then it does not appear in classes folder.
Tameez Lal, modificado hace 9 años.

RE: Unable to open resource in class loader

New Member Mensajes: 20 Fecha de incorporación: 25/10/13 Mensajes recientes
Yes makri your correct i was also facing problem with friendly url with maven build we need to place friendlyur.xml file under resource folder then the class loader will look into this
thumbnail
Anil Sunkari, modificado hace 8 años.

RE: Unable to open resource in class loader

Expert Mensajes: 427 Fecha de incorporación: 12/08/09 Mensajes recientes
Hi Tameez,

Please find the below blog for maven.I resolved the issue.

https://www.liferay.com/community/forums/-/message_boards/message/56845479

Regards,
Anil Sunkari