Portlet not getting deployed - liferay

I have this strange problem at which I have spent stupid amount of time.
To build my portlet, I haven't used sdk and I am using my own ant script do the job. It works all well till this wierd situation.
I am basically using a lot class from portal-service.jar to change role settings etc. When I include it in my build path and deploy it again. It doesn't get deployed. On shell it shows the deployment, below is the log:
Copying 1 file to C:\liferay-portal\tomcat-6.0.29\webapps\ch1_HelloWorld
Deleting directory C:\liferay-portal\tomcat-6.0.29\temp\20121016060846753
06:08:47,887 INFO [PortletAutoDeployListener:81] Portlets for C:\liferay-portal\tomcat-6.0.29\deploy\ch1_HelloWorld.war copied successfully.
Deployment will start in a few seconds.
16 Oct, 2012 6:08:56 AM org.apache.catalina.startup.HostConfig checkResources
INFO: Reloading context [/ch1_HelloWorld]
That's it! Later it doesnt show (as it does normally) that the portlet is available to use. In browser, under the "add tab", the option is never shown. What can be the issue for this. The portlet is a simple hello world portlet that access role information

I am basically using a lot class from portal-service.jar to change role settings etc. When I include it in my build path and deploy it again. It doesn't get deployed. On shell it shows the deployment, below is the log:
Did you put portal-service.jar to WEB-INF/lib? If so remove it from there and add it to some other (my_project/lib) directory than add it to build path.
Also make sure that after deployment portal-service.jar is not in your deployed WEB-INF/lib.
Better yet, first undeploy than redeploy.

Is this properly set in your liferay-display.xml ?
<display>
<category name="yourCategoryUnderAddMenu">
<portlet id="yourPortletId"></portlet>
</category>
</display>

Late answer, but maybe it will help someone:
- just shutdown your server;
- delete the portlet from the "webapps" tomcat folder;
- you should delete "temp" and "work" folders content;
- restart your server and deploy your portlet.
Everything should be OK.
I do not know why this happens, but I encounter this problem many times and fix it with the same solution.
Bye!

This is normally the case when the auto.deploy.dest.dir is pointing to the wrong place. Firstly, i came to realise the common mistake is to make this point to liferay_home/deploy which is not correct. This property specifies the destination of exploded files. For tomcat, it would be the webapps directory e.g. /opt/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/webapps
In other words, tomcat, on receiving the exploded files,carries on. In your case, tomcat was never realising any changes.

Delete the old war from the webapps, and put your new war manually in the Deploy folder.
It looks like you might be deploying by copying it to the webapps folder, instead of the deploy?

go to plugins-sdk folder.
open build.userName.properties (In my case name of file is build.asif.properties)
open it..
add the below line
auto.deploy.dir = D:\\nWorkSpace\\liferay-portal-6.2.0-ce-ga1\\deploy
"D:\nWorkSpace\liferay-portal-6.2.0-ce-ga1\deploy" is the path of my deploy direcotory.
where nWorkSpace is my workspace. My problem is resolve.

I tried all of the above solutions but my issue was not resolved on a Liferay 6.2 EE sp2 bundle.
I was finally able to resolve portlet deployment issue by cleaning all the portlet xml files except the ROOT.xml from the Tomcat home/conf/Catalina/localhost folder.
This tip above was provided on the following post - how ever the blog post no longer exits and had to find in the archives below with google search in case someone is interested. It saved me hours of effort.
https://www.liferay.com/community/forums/-/message_boards/message/2124111
http://archive-ro.com/page/754918/2012-11-26/http://blog.ropardo.ro/2010/08/09/liferay-deployment-will-start-in-a-few-seconds-and-how-to-realy-start/

Related

Liferay7 - module (portlet-provider) not refreshing

Im working with Liferay 7 and module development.
I created a module of type "portlet-provider" for can change the view of personalBar.
When I deploy it first time, it deploys ok, but after that, new deploys are not refreshing jsp files.
Is important to said that when I deploy the module, via blade or via gradle in Intellij, it deploys ok and also change the OSGI related folder, deleting old version and creating a new one with new jsp ok.
Even with that in a clear browser (recent removed all cache and temp) does no not refresh the personalBar view, related to new jsp file.
I saw this thread: https://web.liferay.com/community/forums/-/message_boards/message/88515142 , and tested the following.
1) Changed the tomcat timeZone, put the same timezone that I had in my desktop. (GMT-3 ) , it didn't work .
2) The only thing that seems to work is to clear all osgi state content and $liferay_home/work content and restart server as David said in above post.
But I need a way to can deploy theses modules without having to restart the server
Any help on this?
Thanks in advance
About my problem, I had a problem with the priority of the module so the module been deployed were not the same showed in portal.
At the beginning I set the "service.ranking:Integer="+Integer.MAX_VALUE , but I don't know why it was removed and for that the portlet showed was the portal default personal bar.

Tomcat not deploying new version of files at all - linux / eclipse

I am having issue with the way tomcat deploys my files to the server.
I have installed Tomcat 7 to /opt/tomcat7.
In my eclipse i have specified this path as my tomcat server.
my workspace directory is /home/maciej/workspace/<projects here>
now if I edit a class file and i add simply log statement
log.info("blabla"); and then deploy 'NEW' version of the file via - run on server, i do not see this 'blabla' in my output. It seems like although i have modified the class file, it was not properly deployed into tomcat. Tomcat is reading god knows what but certainly not the file it should read.
EDIT: I have recofnigured my tomcat in eclipse and now:
Server Path = /opt/tomcat7
Deploy Path = /opt/tomcat7/webapps <- used to be .metadata/blablabla default
eclipse tomcat location
When I open 'Open Lunch Configuration' under arguments/working directory the default option is ticket with greyed out path /home/maciej/Desktop
Should this also be changed?
Isn't tomcat working directory /opt/tomcat7/work ?
Any suggestions / ideas? As this issue is slightly getting on my nerves as i can not develop the app.
The Server Path is the same as the Tomcat installation directory in the modal you see in Window > Preferences > Server > Runtime Environments after hitting Edit. That should be set to /opt/tomcat7 or wherever the root of your Tomcat installation lives.
The Deploy Path is relative to the Server Path. It should be webapps, unless you already have stuff there and you want a separate directory. You will not be able to edit this until you shut down Tomcat and remove all webapps underneath it through the Servers view.
Try unchecking Modules auto reload by default if you trust the JDK hot-swapping, which you should if you're using JDK 1.7 or 1.8 and just want to see a log statement inserted.
The working directory you mentioned is just the root directory that Tomcat uses to spit out thread dumps on crashes and the like. It has nothing to do with the Tomcat "work" directory.
Open server view: Window->Show view->Other->Servers. The select correct server, right click, select "Clean" and then restart tomcat. It should help.
If you change something in the project then Eclipse will build automatically and "deploy" the files to the location you have specified. By default, Eclipe's work stops there and the rest is up to tomcat.
Tomcat, like any Java web server, detects changes in JSPs and recompiles them. Nevertheless, changes in classes have no effect because of the way Java class loading works. For the new version of a class to be used by tomcat you need to:
Not have loaded the class before. For example, you start tomcat but then see an error before doing any request. If you change the class then that change will be used because the class was not yet loaded.
Reload the application. This means that all classes are discarded and everything starts fresh.
The easiest way to reload an application, by default, is to make a change to web.xml. If you look into tomcat's configuration conf/context.xml you can see that WEB-INF/web.xml is monitored. Any change will trigger a reload of the context. So you can either make an artificial change in the file or add a resource like WEB-INF/version.properties and generate a different version.properties with any build.
In any case, reloading a complex application takes time. That is why there are plugins like JRebel. But before you go down that path (which adds another moving piece to your setup) you can also try to use Eclipe's support for hot code replacement. You start tomcat in debug, connect to it with Eclipse, and then change some class. Eclipse will try to recompile the class and upload the new definition to tomcat. If it fails it will tell you. As a general rule it will fail when you change the structure of the program and succeed when you just change method's implementations.

Unable to view deployed Liferay portlet in the add >> more option

I have created a sample Liferay portlet and it has successfully deployed. But, the eclipse console didn't say "1 portlet is ready for use". And, I couldn't find this portlet in the Add >> More.. option on a Liferay page.
As Mark mentioned, it is undeterministic and it sometimes happen. I usually follow the following steps and after this it works normally.
Steps:
remove all the references of the portlet from webapps.
stop the server
deploy the portlet's WAR
restart the server
check the logs if the portlet is deployed.
If possible try to build the WAR again and deploy the new WAR, and follow the previous steps.
Also if this doesn't work try to clear the temp and work directory and again try the previous steps.
Hope this helps.
I have been fighting with this problem for a day. For me it was two things: wrong property of
liferay.home
inside
portal-setup-wizard.properties
Only after correction I was able too see in tomcat logs that my liferay-plugins had higher version than liferay itself. I redownload plugins with correct version and new plugin deployed correctly.
If you've done all the cleaning etc. and it still does not work, there may be another reason for not showing. If you have - for some reson - deactivated the portlet in Liferay, it will remember the setting even though you have undeployed it several times.
So, you must go to Control Panel > App Manager > All Apps > Your portlet name and activate it again!
That is undeterministc but usual error. Try to undeploy the portlet - delete portlet directory under tomcat/webapps and try to deploy again.

Project folder name in NetBeans interfering with JSF/GlassFish deployment

I am not sure if this is a JSF issue or a NetBeans issue. I am very new to both. I am also not sure if stackoverflow is the best SE site for this, so if I am wrong please help me out and migrate it. Thanks.
I have a project in a folder, let's say C:\Folder1, and when I try to "deploy" it on the GlassFish server, I get strange errors about a missing class... though that class is not even a part of this project. I believe that C:\Folder1 may have been something I used in the past for a different project but that is long gone. So this new project, if I move it to folder C:\Folder1a or C:\Folder2 or ANYTHING else but C:\Folder1... then it will deploy fine. But if I move it back to Folder1 (i.e. the exact same directory structure underneath that level), I get the mysterious error messages from GlassFish server about being unable to find the class that it doesn't even need.
I got a suggestion elsewhere to try "cleaning" and re-building the project, but that did not work. Here is more detail about the steps I followed.
Create new project in Netbeans, point it to an empty folder called Ex2605. After that, I bring a couple source files (.java and .xhtml) into that Ex2605 directory structure. When I clean and build, it says ok. When I try to deploy, I get this error:
Error occurred during deployment: Exception while loading the app :
java.lang.IllegalStateException: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: java.lang.RuntimeException:
java.lang.NoClassDefFoundError: LShoppingCart;. Please see server.log
for more details. C:\\Ex2605\nbproject\build-impl.xml:721: The
module has not been deployed. See the server log for details. BUILD
FAILED (total time: 16 seconds)
"ShoppingCart" is a class from a different project, that I once long ago had in a directory named Ex2605 at the same location. But that directory is long gone, it has been removed from the Netbeans project list, and there are NO references to the ShoppingCart class anywhere in any of the files currently in the Ex2605 folder. So that fact that Netbeans apparently is looking for something called LShoppingCart tells me it maintains a history somewhere else of what I used to have in the Ex2605 folder, and apparently I need to purge that history but have no idea how.
If I try all of the above with any directory NOT named Ex2605, it works fine.
Any ideas? Obviously I can work around it, but it still irks me.
Netbeans has a compile cache that sometimes causes problems. You could delete the compile cache and see if it helps.
Here are the steps from the answer to my question:
Stop the server
Clean the project
Stop NetBeans
Delete %HOME%.netbeans\6.9\var\cache
Start NetBeans

SharePoint 2010 Web part Deployment Error

When I deploy my web part locally everything is fine. The web part is registered as safe, and is completely usable.
When I deploy the wsp to another server the web part comes back with the following error although everything appears to be deployed correctly (and the SafeControls appear within the web.config). :
Web Part Error: A Web Part or Web Form Control on this Page cannot be displayed or imported. The type XXXXX could not be found or it is not registered as safe.
It is almost the exact same issue as this question. The only difference being that when I look at my web.config on the server I am deploying to I DO see the SafeControls.
Any thoughts on things that I could try to fix the issue? Server settings, how I package or deploy, etc.
I was able to solve my issues by manually removing the solution from the GAC. Then I just tried to add the solution again and everything works well.
I had added the web part in question after the initial upload of the solution (sorry about leaving that part out of the description). Before doing this I was trying to retract and delete from the Central Admin then retry the addition. Apparently this didn't actually delete the solution from the GAC.
The site was using the old version of the solution which did indeed not include a SafeControl for the new web part. Once the old version was removed the addition of the new version went without a hitch and all is well.
Thanks to all for their suggestions.

Resources