Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Bill Corley
Portlet OK in Windows Dev but ClassNotFoundException in Linux Test Server
October 26, 2012 10:27 AM
Answer

Bill Corley

Rank: New Member

Posts: 5

Join Date: October 26, 2012

Recent Posts

I developed a portlet on Windows server (Liferay EE 6.1, Windows 2008 Server, Tomcat, Liferay Developer Studio) in my personal development test bed. The portlet compiles, deploys and functions fine on my local Liferay development environment. So I exported the portlet to a WAR file and deployed it on a Linux test installation which is also EE 6.1, Tomcat. In that environment the protlet throws a ClassNotFoundException for the java class file that was written in the portlet and deployed with the portlet.

It feels like a classpath or file permissions issue. The java class file was deployed exactly as expected in the Linux environment (package to directory expansion) and permissions for the files seem sufficient. Any idea why the class file is not being found?

The portlet was deployed to ... tomcat/webapps/portlet-name/ and the class file is in tomcat/webapps/portlet-name/WEB-INF/classes/path/of/package/javafile.class.
David H Nebinger
RE: Portlet OK in Windows Dev but ClassNotFoundException in Linux Test Serv
October 26, 2012 10:42 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7470

Join Date: September 1, 2006

Recent Posts

In the SDK folder, you will find a 'dist' folder where all build artifacts are created. You should use the artifacts from here for deployment.

When deploying your artifact, you should be dropping it into the designated 'deploy' folder for Liferay to handle the deployment for you.

So basically you've used the wrong deployment artifact and tried to deploy it manually rather than following Liferay standards.
Bill Corley
RE: Portlet OK in Windows Dev but ClassNotFoundException in Linux Test Serv
October 31, 2012 2:56 PM
Answer

Bill Corley

Rank: New Member

Posts: 5

Join Date: October 26, 2012

Recent Posts

As it turned out, I had my test Liferay server running Java 1.7 and I compiled the portlet using Java 1.7. The other test Liferay server I was trying to deploy to was using Java 1.6. My deployment steps were just fine, but the java version wasn't. Recompiling to 1.6 solved the problem.

Thanks.
Bill
David H Nebinger
RE: Portlet OK in Windows Dev but ClassNotFoundException in Linux Test Serv
October 31, 2012 8:24 PM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7470

Join Date: September 1, 2006

Recent Posts

Note that I don't think Liferay is 1.7 ready yet due to a conflict with Lucene. You should be using 1.6 for all Liferay systems.