Fórum

Unable to open resource in class loader

Joern Muehlencord, modificado 13 Anos atrás.

Unable to open resource in class loader

New Member Postagens: 2 Data de Entrada: 22/12/10 Postagens Recentes
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 13 Anos atrás.

RE: Unable to open resource in class loader

Liferay Master Postagens: 758 Data de Entrada: 27/09/07 Postagens Recentes
Did you add them directly in the webapps or trying to build and deploy your test portlet?
Joern Muehlencord, modificado 13 Anos atrás.

RE: Unable to open resource in class loader

New Member Postagens: 2 Data de Entrada: 22/12/10 Postagens Recentes
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 12 Anos atrás.

RE: Unable to open resource in class loader

Junior Member Postagens: 25 Data de Entrada: 13/01/11 Postagens Recentes
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 12 Anos atrás.

RE: Unable to open resource in class loader

Liferay Legend Postagens: 1449 Data de Entrada: 10/10/07 Postagens Recentes
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 11 Anos atrás.

RE: Unable to open resource in class loader

Junior Member Postagens: 57 Data de Entrada: 13/03/12 Postagens Recentes
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 11 Anos atrás.

RE: Unable to open resource in class loader

Regular Member Postagens: 104 Data de Entrada: 27/07/11 Postagens Recentes
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 11 Anos atrás.

RE: Unable to open resource in class loader

Junior Member Postagens: 57 Data de Entrada: 13/03/12 Postagens Recentes
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 11 Anos atrás.

RE: Unable to open resource in class loader

Liferay Master Postagens: 522 Data de Entrada: 29/08/11 Postagens Recentes
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 11 Anos atrás.

RE: Unable to open resource in class loader

Regular Member Postagens: 104 Data de Entrada: 27/07/11 Postagens Recentes
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 11 Anos atrás.

RE: Unable to open resource in class loader

Junior Member Postagens: 62 Data de Entrada: 26/02/13 Postagens Recentes
I am also getting the same problem....Can anyone help....

Thanks in advance..

Thanks & Regards
Rahul Saraswat
thumbnail
Sushil Kumar Saini, modificado 11 Anos atrás.

RE: Unable to open resource in class loader

Regular Member Postagens: 104 Data de Entrada: 27/07/11 Postagens Recentes
Hi Abhimanyu ,.... Have you checked whether configuration files are properly deployed in the tomcat webapps/{portlet_war} folder ?
Marko Perić, modificado 8 Anos atrás.

RE: Unable to open resource in class loader

Junior Member Postagens: 52 Data de Entrada: 03/09/14 Postagens Recentes
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 9 Anos atrás.

RE: Unable to open resource in class loader

New Member Mensagem: 1 Data de Entrada: 05/08/14 Postagens Recentes
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 9 Anos atrás.

RE: Unable to open resource in class loader

New Member Postagens: 20 Data de Entrada: 25/10/13 Postagens Recentes
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 8 Anos atrás.

RE: Unable to open resource in class loader

Expert Postagens: 427 Data de Entrada: 12/08/09 Postagens Recentes
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