Forum

Accueil » Liferay Portal » English » 3. Development

Vue combinée Vue Plate Arborescence
Sujets [ Précédent | Suivant ]
toggle
Sunil Kulkarni
java.lang.ClassNotFoundException com.liferay.util.ContentUtil
12 septembre 2013 03:27
Réponse

Sunil Kulkarni

Rang: Junior Member

Publications: 94

Date d'inscription: 24 juin 2011

Publications Récentes

Hello All,

I am using LR 6.1.1 CE version.

I have created package named with com.book and create an xml into it.

To read this xml file, I have written following code in my portlet

1String fileData = ContentUtil.getContent("com/book/book.xml",true)


I am getting following error :
1java.lang.ClassNotFoundException com.liferay.util.ContentUtil


Any help on this.
Sunil Kulkarni
RE: java.lang.ClassNotFoundException com.liferay.util.ContentUtil
12 septembre 2013 05:22
Réponse

Sunil Kulkarni

Rang: Junior Member

Publications: 94

Date d'inscription: 24 juin 2011

Publications Récentes

I did following and able to read content from file.

1String filePath = "com/book/book.xml"
2MethodKey key = new MethodKey("com.liferay.util.ContentUtil","get", String.class);
3
4String data = (String) PortalClassInvoker.invoke(true, key,filePath);