Foros de discusión

Problems developing my first Portlet

Lior Hadaya, modificado hace 12 años.

Problems developing my first Portlet

Regular Member Mensajes: 138 Fecha de incorporación: 24/01/12 Mensajes recientes
Hi,

I've just installed my 30 day trail of Liferay EE 6.0-ee-sp2, Tomcat 6.0.32 bundle (on a machine with JDK 7), as I am trying to evaluate the product for possible usage.
I am trying to follow the Developer's guide - http://docs.liferay.com/portal/6.0/official/liferay-developer-guide-6.0.pdf - in order to create my first portlet, using the Liferay Plugin SDK & Ant.

I've created a simple Portlet, I can compile it but before the BUILD SUCCESSFUL message appears I see this:
build-css:
     [java] Error: Could not find or load main class com.liferay.portal.tools.SassToCssBuilder

What does this mean and how can I fix it?

When I run liferay and try to load my portet on one of my pages I see this:
ERROR [MVCPortlet:340] null is not a valid include

And the portlet loads without any content (it's supposed to show some text inside). What does this error mean?

I believe I followed all the configuration guidelines, I created my own build.user properties file and placed the following inside it:
app.server.dir=D:/liferay-portal-6.0-ee-sp2/tomcat-6.0.32

I haven't changed any of the XML files.

What am I missing? Please advise, thank you in advance

Lior
thumbnail
Hitoshi Ozawa, modificado hace 12 años.

RE: Problems developing my first Portlet

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
I haven't tried developing on EE but it may be that EE has a different SDK from CE. Can you try it with CE source code?
Examples worked on CE 6.0.6 for me with JDK 6
Lior Hadaya, modificado hace 12 años.

RE: Problems developing my first Portlet

Regular Member Mensajes: 138 Fecha de incorporación: 24/01/12 Mensajes recientes
Hi Hitoshi, thanks for your reply.
Since we're interested in the EE I don't really see the point in installing the CE.
I did try to reinstall everything but with JDK 6 instead of JDK 7, I still get the same error when trying to deploy the portlet but with a bit more information:
build-css:
     [java] java.lang.NoClassDefFoundError: com/liferay/portal/tools/SassToCssBu
ilder
     [java] Caused by: java.lang.ClassNotFoundException: com.liferay.portal.tool
s.SassToCssBuilder
     [java]     at java.net.URLClassLoader$1.run(Unknown Source)
     [java]     at java.security.AccessController.doPrivileged(Native Method)
     [java]     at java.net.URLClassLoader.findClass(Unknown Source)
     [java]     at java.lang.ClassLoader.loadClass(Unknown Source)
     [java]     at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
     [java]     at java.lang.ClassLoader.loadClass(Unknown Source)
     [java] Could not find the main class: com.liferay.portal.tools.SassToCssBui
lder.  Program will exit.
     [java] Exception in thread "main"
     [java] Java Result: 1


I must admit I'm new to java, does this message make sense to you? what could be the problem?

Thanks,

Lior
thumbnail
David H Nebinger, modificado hace 12 años.

RE: Problems developing my first Portlet (Respuesta)

Liferay Legend Mensajes: 14914 Fecha de incorporación: 2/09/06 Mensajes recientes
Lior Hadaya:
I've created a simple Portlet, I can compile it but before the BUILD SUCCESSFUL message appears I see this:
build-css:
     [java] Error: Could not find or load main class com.liferay.portal.tools.SassToCssBuilder

What does this mean and how can I fix it?


The error is what it is - no SassToCssBuilder class.

The reason you're getting it is you're using the 6.1 SDK trying to build your portlet for a 6.0 portal.

Download the 6.0 SDK and use that one instead for building for 6.0 EE.
Lior Hadaya, modificado hace 12 años.

RE: Problems developing my first Portlet

Regular Member Mensajes: 138 Fecha de incorporación: 24/01/12 Mensajes recientes
Hi David,
Do you mean SDK 6.0 of Liferay plugins SDK? I only see a link to the 6.1 version:
http://www.liferay.com/downloads/liferay-portal/additional-files

Can you provide a link to the 6.0 SDK?

Thanks,

Lior
thumbnail
David H Nebinger, modificado hace 12 años.

RE: Problems developing my first Portlet (Respuesta)

Liferay Legend Mensajes: 14914 Fecha de incorporación: 2/09/06 Mensajes recientes
On the downloads page (Releases tab, not additional files), the first chunk is for 6.1 CE. Skip that one.

The second junk is 6.0 CE. Use the dropdown to get to the "Plugins SDK" option, then click Download.
Lior Hadaya, modificado hace 12 años.

RE: Problems developing my first Portlet

Regular Member Mensajes: 138 Fecha de incorporación: 24/01/12 Mensajes recientes
Thank you David! That indeed solved the problem emoticon

Lior
thumbnail
David H Nebinger, modificado hace 12 años.

RE: Problems developing my first Portlet

Liferay Legend Mensajes: 14914 Fecha de incorporación: 2/09/06 Mensajes recientes
Great! Can you mark the question as answered?
thumbnail
Hitoshi Ozawa, modificado hace 12 años.

RE: Problems developing my first Portlet

Liferay Legend Mensajes: 7942 Fecha de incorporación: 24/03/10 Mensajes recientes
David, thanks for the information. I wasn't sure if there was a EE version of the SDK or not.

So the SDK for the EE version is actually the same as the CE version.
thumbnail
David H Nebinger, modificado hace 12 años.

RE: Problems developing my first Portlet

Liferay Legend Mensajes: 14914 Fecha de incorporación: 2/09/06 Mensajes recientes
I don't think they're exactly the same. From my enterprise account I can go to 6.0 EE SP2 and (unlike the CE download area) I have a bunch of EE-specific links, and one of those is labeled "Liferay Plugins SDK 6.0 EE SP2", although I haven't checked to see if they are truly the same package or not.

But I do know that you can use the CE SDK to develop for EE, at least for evaluation purposes. Once you buy your license, you get the EE SDK so you might as well use it to maximize your chance of success.

There may be some forward compatibility (i.e. use 6.0 SDK to develop for 6.1), but there's definitely no guarantee of backward compatibility (6.1 SDK for 6.0 target), as the OP found out... emoticon