I develop a portlet using Liferay, JSF and JBoss and everything is running perfect. After a time my team decided to change the container to Tomcat and my problem began. My portlet doesn't deploy anymore, but just shows me this message during deploy:
12:07:35,599 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][AutoDeployDir:204] Processing my-portlet-1.0.war
12:07:35,602 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][PortletAutoDeployListener:79] Copying portlets for /portal/liferay-sdk/liferay-portal-6.2-ce-ga2/deploy/my-portlet-1.0.war
12:07:35,624 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][BaseDeployer:859] Deploying my-portlet-1.0.war
Expanding: /portal/liferay-sdk/liferay-portal-6.2-ce-ga2/deploy/my-portlet-1.0.war into /portal/liferay-sdk/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/temp/20150925120735727
Copying 1 file to /portal/liferay-sdk/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/temp/20150925120735727/WEB-INF/classes
Copying 1 file to /portal/liferay-sdk/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/temp/20150925120735727/WEB-INF/classes
Copying 1 file to /portal/liferay-sdk/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/temp/20150925120735727/WEB-INF/jsp
12:07:36,144 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][BaseDeployer:2383] Modifying Servlet 2.5 /portal/liferay-sdk/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/temp/20150925120735727/WEB-INF/web.xml
Copying 32 files to /portal/liferay-sdk/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/webapps/my-portlet-1.0
Copying 1 file to /portal/liferay-sdk/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/webapps/my-portlet-1.0
Deleting directory /portal/liferay-sdk/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/temp/20150925120735727
12:07:36,242 INFO [com.liferay.portal.kernel.deploy.auto.AutoDeployScanner][PortletAutoDeployListener:91] Portlets for /portal/liferay-sdk/liferay-portal-6.2-ce-ga2/deploy/my-portlet-1.0.war copied successfully. Deployment will start in a few seconds.
Set 25, 2015 12:07:42 PM org.apache.catalina.startup.HostConfig deleteRedeployResources
INFORMAÇÕES: Undeploying context [/my-portlet-1.0]
Set 25, 2015 12:07:42 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
GRAVE: The web application [/my-portlet-1.0] created a ThreadLocal with key of type [com.liferay.portal.kernel.util.CentralizedThreadLocal.ThreadLocalMapThreadLocal] (value [com.liferay.portal.kernel.util.CentralizedThreadLocal$ThreadLocalMapThreadLocal#1848e169]) and a value of type [com.liferay.portal.kernel.util.CentralizedThreadLocal.ThreadLocalMap] (value [com.liferay.portal.kernel.util.CentralizedThreadLocal$ThreadLocalMap#58c6c0f3]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Set 25, 2015 12:07:42 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
GRAVE: The web application [/my-portlet-1.0] created a ThreadLocal with key of type [com.liferay.portal.kernel.util.CentralizedThreadLocal.ThreadLocalMapThreadLocal] (value [com.liferay.portal.kernel.util.CentralizedThreadLocal$ThreadLocalMapThreadLocal#60a5bf0d]) and a value of type [com.liferay.portal.kernel.util.CentralizedThreadLocal.ThreadLocalMap] (value [com.liferay.portal.kernel.util.CentralizedThreadLocal$ThreadLocalMap#21a2200d]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
Set 25, 2015 12:07:43 PM org.apache.catalina.startup.HostConfig deployDirectory
INFORMAÇÕES: Deploying web application directory /portal/liferay-core/environment 6.2-ga2/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/webapps/my-portlet-1.0
Set 25, 2015 12:07:43 PM org.apache.catalina.loader.WebappClassLoader validateJarFile
INFORMAÇÕES: validateJarFile(/portal/liferay-sdk/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/temp/2-my-portlet-1.0/WEB-INF/lib/servlet-api-2.4.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
12:07:45,237 INFO [StartupListener:50] Context initialized for contextPath=[/my-portlet-1.0]
12:07:45,247 INFO [StartupListener:77] Copied input-editor.jsp from LiferayFaces JAR to context path file=[/portal/liferay-sdk/liferay-portal-6.2-ce-ga2/tomcat-7.0.42/temp/2-my-portlet-1.0/resources/liferay-ui/jsp/input-editor.jsp]
12:07:45,247 INFO [BridgeSessionListener:96] Context initialized for contextPath=[/my-portlet-1.0]
I tried to resolve the problem like this already:
Downgrading tomcat to version 7
Downgrading liferay to 6.2 GA3 and GA2
Removing any managed bean calls
Removing all JBOSS configuration from portlet (pom libs and web.xml)
Removing tomcat listeners for
MemoryLeak prevention
This kind of issue is probably due to the fact that JBoss provides certain jars to the global classpath and Tomcat does not. Since you are migrating from JBoss to Tomcat, it is likely that you need to include some more jars in your war's WEB-INF/lib. Make sure that you have the JSF API and Impl, and you may need a CDI implementation such as Weld as well. Check that the appropriate dependencies are included in your war's WEB-INF/lib, and then undeploy and redeploy your portlet.
Related
I have integration test in maven verify, that starts Apache Cassandra 3.11.13. I'm using cassandra-maven-plugin 3.7. I tried moving the project to Java 11. After adding Java 11 vm options to cassandra-maven-plugin:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cassandra-maven-plugin</artifactId>
<configuration>
<addJdk11Options>${runningJava11}</addJdk11Options>
.....
I've got Cassandra to start on Linux, but on Windows was crashing, unfortunately without logs.
I was able to craft the same JVM parameters used by the cassandra-maven-plugin, but added the slf4j-jdk14-1.7.32.jar to the class path. The JVM parameters can be printed when starting mvn -X, however the class path and main class can be found in git\software-app\target\cassandra\bin\cassandra.jar which is packed by the cassandra-maven-plugin. In the logs I found this error:
enter code here Aug 20, 2022 9:32:12 PM org.apache.cassandra.service.DefaultFSErrorHandler handleStartupFSError
SEVERE: Exiting forcefully due to file system exception on startup, disk failure policy "stop"
Aug 20, 2022 9:32:12 PM org.apache.cassandra.service.DefaultFSErrorHandler handleStartupFSError
SEVERE: Exiting forcefully due to file system exception on startup, disk failure policy "stop"
FSWriteError in C:\Users\pesho\git\software-app\target\cassandra\data\system\local-7ad54392bcdd35a684174e047860b377\me-8-big-Data.db
at org.apache.cassandra.db.lifecycle.LogTransaction.delete(LogTransaction.java:261)
at org.apache.cassandra.db.lifecycle.LogTransaction$SSTableTidier.run(LogTransaction.java:386)
at org.apache.cassandra.io.sstable.format.SSTableReader$GlobalTidy.tidy(SSTableReader.java:2333)
at org.apache.cassandra.utils.concurrent.Ref$GlobalState.release(Ref.java:326)
at org.apache.cassandra.utils.concurrent.Ref$State.release(Ref.java:225)
at org.apache.cassandra.utils.concurrent.Ref.release(Ref.java:119)
at org.apache.cassandra.io.sstable.format.SSTableReader$InstanceTidier$1.run(SSTableReader.java:2238)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.apache.cassandra.concurrent.NamedThreadFactory.lambda$threadLocalDeallocator$0(NamedThreadFactory.java:84)
at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: java.nio.file.AccessDeniedException: C:\Users\pesho\git\software-app\target\cassandra\data\system\local-7ad54392bcdd35a684174e047860b377\me-8-big-Data.db
at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
at java.base/sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:274)
at java.base/sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:105)
at java.base/java.nio.file.Files.delete(Files.java:1142)
at org.apache.cassandra.db.lifecycle.LogTransaction.delete(LogTransaction.java:243)
... 13 more
It seems Cassandra is trying to delete a file, that is still open for reading. I was able to start Cassandra after modifying target/cassandra/conf/cassandra.yaml by setting:
disk_failure_policy: ignore
Since this a this a test only instance, I decided, I'm fine with this option.
Unfortunately this yaml file is generated by cassandra-maven-plugin. After some digging in the code of the plugin, I found the yaml parameter, which merges configs from pom.xml and default config file:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cassandra-maven-plugin</artifactId>
<configuration>
<!-- required to start on Windows -->
<yaml>disk_failure_policy: ignore</yaml>
<addJdk11Options>${runningJava11}</addJdk11Options>
.....
The Java file I/O library that Cassandra uses has always been problematic on Windows particularly with NTFS. It has been a constant source of issues for users that we decided it wasn't good for the project to continue support (see the discussion in this thread).
We eventually dropped Windows support completely in Cassandra 4.0 (CASSANDRA-16171).
Also, Cassandra 3.1x (and earlier versions) only work with Java 8 (see Cassandra installation prerequisites). Cassandra 4.0.2 added full support (previously experimental) for Java 11 only recently (CASSANDRA-16894). This means that C* 4.x will work with either Java 8 or Java 11.
The recommended workarounds for Windows users are:
Deploy Cassandra in Docker
Deploy Cassandra in a VM using software like VirtualBox
Deploy Cassandra in a Kubernetes cluster with K8ssandra.io
Otherwise if you just want to learn how to build apps on Cassandra, Astra DB has a free tier where you can launch a cluster in just 5 clicks. Cheers!
My problem is that whenever I update or add any message in the ValidationMessages.properties, those messages won't reflected to the actual runtime validation message until restarting the application server (Just like the file being cached on the application server startup).
The only way to see the new changes is restarting the whole Websphere application server.
I tried to restart the application (EAR), republish it, clean and republish, change the "Publishing settings" on my IBM RAD, but none of them did the trick.
Noting that, I'm using the default implementation that's provided by IBM for JSF, CDI and Bean Validations.
I'm using IBM RAD 9.5.0.3 and Websphere 8.5.5.13 .
I have been following the tutorial in https://dev.liferay.com/develop/learning-paths/mvc/-/knowledge_base/6-2/writing-your-first-liferay-application and built the portlet for liferay as described. I have a working liferay environment and can add and remove all of the standard portlets.
When trying to push the porlet that I've made to the server I can see that it has correctly deployed to the server. See log below.
INFO: Deploying web application directory /Users/marc.thomas/Downloads/liferay/bundles/tomcat 7.0.62/webapps/guestbook-portlet
Mar 04, 2016 10:49:53 AM org.apache.catalina.startup.TldConfig execute
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
Mar 04, 2016 10:49:53 AM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deployment of web application directory /Users/marc.thomas/Downloads/liferay/bundles/tomcat-7.0.62/webapps/guestbook-portlet has finished in 900 ms
Mar 04, 2016 10:49:53 AM org.apache.catalina.startup.HostConfig deployDirectory
I have put the full log and the code in my github account here: https://github.com/marcthomas2013/liferay-portlet
In this log there is no presence of liferay picking up the portlet and deploying it, even though it is deployed to tomcat.
I can't see what else I can check now. Can anyone help?
When you deploy your portlet plugin, copy the WAR file to Liferay's deploy folder (find it in /Users/marc.thomas/Downloads/liferay/bundles/). Liferay will take care of injecting some required components and deploy it to tomcat itself.
Just deploying the build result to an application server typically does not work (unless you specifically change the build process to include the injected features)
Correction: According to the log file you seem to have moved your installation after the initial install:
10:49:49,077 INFO [localhost-startStop-1][AutoDeployDir:139] Auto deploy scanner started for /Users/marc.thomas/Downloads/liferay-portal-6.2-ce-ga6/deploy
That's where you need to drop your build result.
This is how we enable Tomcat Manager in a vanilla Tomcat 8.
I have a hardened Tomcat 8 that is split into CATALINA_HOME AND CATALINA_BASE which I was unable to deploy Tomcat Manager on, without having the following error:
org.apache.catalina.core.ContainerBase addChildInternal SEVERE:
ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: Failed to start component
[/manager]
and
SEVERE: The web application with context path [/manager] was not
deployed because it contained a deployment descriptor
[\webapps\manager\META-INF\context.xml] which may include
configuration necessary for the secure deployment of the application
but processing of deployment descriptors is prevented by the deployXML
setting of this host. An appropriate descriptor should be created at
[\conf\Catalina\localhost\manager.xml] to deploy this
application.
Similar posts (to list a few 1, 2, 3, 4) suggested solutions but did not help.
Here's how it was fixed:
After Tomcat Manager is set up, copy
%CATALINA_BASE%\webapps\manager\META-INF\context.xml to %CATALINA_BASE%\conf\Catalina\localhost\manager.xml
If you have another webapp other than manager, just replace the file name accordingly.
Another solution is to add deployXML="true" to the Host element in server.xml. Explanation.
Whenever I try to run the hazelcast management cluster I get the following error
org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [collector] in context with path [/mancenter-3.4.2] threw exception
com.hazelcast.com.eclipsesource.json.ParseException: Expected value at 1:0
I am running hazelcast management center on tomcat 8.0. I am able to login without any issues but when I try to add any value to "Update Cluster URL" I get the above error.
I just downloaded 3.4.2 from hazelcast website.
Then i copied mancenter.war to tomcat8/webapps directory.
In hazelcast-3.4.2 folder, there is demo folder and i executed console.sh.
When i put entries to map, i saw these entries also in mancenter.
I didn't encounter any problem.
My tomcat version 8.0.23
When you try tomcat7, do you see errors?
This might be due to version mismatch between your Hazelcast cluster and management center.
What's your hazelcast version?