not able to deploy portlet war in liferay - java

I am tying to place war file into tomcat's deploy folder. It is not getting deployed. When I try to deploy it using install plugins from control panel, I am getting error like.
eDeployer:971] Not updating SamplePorject because version 6.2.1 is newer than version 6.2.0.1
I noticed that, I am using Liferay 6.2 GA1 sdk and try to deploy in folder. Later on I changed my SDK to Liferay 6.2 GA2. but Still I am getting the error.
Do I need to change the run time environment as well.
my generated war is having version 6.2.0.1.

Add liferay-versions=6.2.0+ in .../WEB-INF/liferay-plugin-package.properties file.

Liferay appears to store its own version in the RELEASE_ table in the database (BUILDNUMBER column) and compare artifacts that you try to deploy against that version. I ran into a similar error trying to deploy a .lar file. I was able to work around it - you can try to update the database, or find the manifest or other entries in your artifact that have 6.2.1, but ultimately that will end in tears and you probably are best off updating your runtime, unless the SDK provides some way to target previous versions at build time.

Old thread, but maybe it still helps anyone.
The error you are getting is at AutoDeploy process. In that process, Liferay takes your war and injects some files in it. Finally the generated war goes to your auto deploy destination dir (auto.deploy.dest.dir).
By default this dest dir is the same as your hot deploy dir, and in your case there is already one war for the same plugin in that folder, as you tried the autodeploy first. That's why you're getting versioning conflicts.
You should remove the war from autodeploy folder before trying to deploy it from Control Panel. And then look for the actual reason of your hot deploy not working.

Uninstall the portlet with the higher version.Log in as admin then go to:
Control Panel > Manage Apps
Find portlet with higher version
Click on the Actions button then select uninstall
Then click Control Panel > Install
Install portlet with the lower version

Related

Run an application from workspace

I'm working with a big project with eclipse and WebSphere plugin. Normally, when I run or debug the project from eclipse, the workspace folders where used. But recently I changed something or maybe was an update of eclipse that broke it, I don't know. Now when I run the project it deploys it to a temporary folder and then WebSphere serves it from the temporary folder instead from the workspace.
That breaks every simlink that i have to serve content from out of the workspace.
Does any one knows why the behavior change in eclipse ?
Is there any way to change it back ?
Is there any alternative solution to
keep the simlinks in the temporary folder ?
As to why it switched, I have no idea. But for changing it back, if you're describing what I think you are, try double-clicking on the WebSphere server definition (or right-click > Open), and see the section "Publishing settings for WebSphere Application Server":

Tomcat inside of eclipse doesnt take into account my modifications

I'm using a Eclipse and have embedded Tomcat. My issue is that sometimes when I edit my servlet, even when restarting tomcat inside of eclipse, the deployed project doesn't update, and seems to me that it's using a cached version of the files compiled.
How do I do efficiently to make eclipse & tomcat take my modifications into consideration? What folder do I need to clean?
I have found a good solution that doesnt need me to clean project each time. With it the context is reloaded whenever I modify my servlet.
In eclipse, Goto Project and activate the checkbox Build Automatically.

Running JSP application using tomcat 6.0 and Eclipse

I am working on an academic project using Eclipse 3.X , jsp's, servlet's etc. The server i chosed to deploy my application is "Tomcat 6.0".
when i change any of my code in the application, i am facing problem with running the application. the changes in the code are not showing any affect even though i restart the server. the changes only get affected, if i restart my eclipse. i tried lot of ways by googling about integration of eclipse with tomcat but nothing worked?. I always have to restart the eclipse, to see my changes.
Please help me with this issue.
thanks in advance.
You should simply be able to use the "republish" feature after saving/building.
1, If the development path and deployment path is the same dictionary, make sure that the "Build Automatically" is checked, it's in "Project->Build Automatically", it can help you deploy the files which are changed.
2, If the development path and deployment path is not the same dictionary, you can write an ant task to deploy project.
if u are running in eclipse it is running the tomcat server of eclipse so for changes to be affected it should be refresh so u have to restart eclipse better way is to use outside eclipse and use localhost and tomcat manager u can restart and can see the changes or use ajax

How to deploy portlets to Liferay?

I have faced problems in trying to install new portlets to Liferay running on Glassfish domain. I figured out the flow very lately and want to share it with others also. So, please read the answer and hope this helps someone :)
(Pre requisites for the problem is that I knew that adding projects running on Glassfish is done with a autodeploy folder, but making them visible on Liferay was another story.)
So, you make first a .war file let's say a portlet of name your_file.war. You wanna have it running on a glassfish domain under Liferay portal.
Steps to success:
1) Navigate to Control Panel -> Plugins Installation on Liferay
2) hit Install new portlets
3) hit Configuration
4) Fill in to Deploy Directory a new place for deployment let's say [your domain]/autodeploy2
5) Check that in the next line target is [your domain]/autodeploy (it is the Glassfish default deployment directory)
6) hit save
Now deployment will be done by copy pasting files to that new directory [your domain]/autodeploy2. The rest of it is handled automatically. Setting takes action imediatedly.
Done with deployment: Make a victory jig and enjoy :)
..you stop dancing and face a bug. You want a new revision to be deployed.. In this case, continue reading.
So, you have built your war again and want to re-deploy. Do the following:
1) undeploy old stuff from (your domain)/autodeploy folder by deleting the war file. Don't delete any other file.
2) result is that your_file.war_UnDeployed file will appear.
3) deploy new file by copying the newly built war in (your domain)/autodeploy2 folder.
4) result is that your_file.war_deployed will appear in (your domain)/autodeploy folder.
Make a dance again :)
There is several methods to deploy plugins (portlets, hooks, filters...) into your Liferay Portal.
If you're using Administration you can do it as Mico descripted. but if you're using Maven, Gradle, Ant, Ivi... you can configure their deployment descriptors and redirect their outputs (that are the wars) to the hotdeploy server folder (If you're using Tomcat, JBoss, Glassfish...).
This approach is quite better because you can create backup webapp folder and restore it whenever you want easily.
Below are not for Glassfish but common startup steps:
To install a portlet in lliferay portal
• first install liferay portal from below link
http://www.liferay.com/en_GB/community/wiki//wiki/Main/Liferay+IDE+Getting+Started+Tutorial
this requires installation of
liferay ide
liferay portal bundled with tomcat
add this tomcat as run server time and start it, it will start liferay portal
• create a portlet application
• open liferay at localhost:8080 and goto Admin -> control panel
• goto Plugins Configuration
• goto Intall tab and give location of war file (some logging error might come
at tomcat console, ignore it)
• again goto home page at localhost:8080 and click + button
• go at the bottom in the list and u will find ur portlet
• click add button present at the right side of it and ur portlet would be added to the page.
Modifying code of portel requires to uninstall and install again the portlet from war file.
All existing added portlets would also be modified.

Eclipse and JBoss not refreshing or rebuilding

I'm having this problem in eclipse (EE) when I change things in my code (even something as simple as the text I'm printing using println) it doesn't get applied. I'm using JBoss and when I rerun the servlet, nothing happens.
Any idea how I can force JBoss/Eclipse to do this? I can't preview anything so it's really annoying if I want to test some new code.
Thanks!
Eclipse publishes the newer versions of your application periodically (its called the automatic publish feature). Either the interval is too large, or you're not waiting sufficiently long enough for re-deployment, or automatic publishing of the application has been disabled.
Sometimes, despite ensuring the above, Eclipse might still not publish the newer classes, in which case you might want to perform a clean build, which causes the newly built classes to be loaded into JBoss.
Sorry to ask such a basic question: Do you save your changes before testing?
Eclipse uses its own compiler to check for syntax errors while you are editing, but you have to save the file before the edits take effect in the application.
I only ask because this could be confusing if you are new to Eclipse, having changed from a different IDE. File permission settings can also prevent your files from being saved or built.
Working on EJB deployed in JBoss with Eclipse IDE.
We have ANT build file, in which first old project is deleted from JBoss,
then compiling classes, & building proper directory structure & deploy as .ear - .sar again in JBoss directory.
Stop JBoss, run build file, start JBoss.
Its a good practice to have a build file to deploy project.

Categories

Resources