Tomcat 8.5 not starting after upgrading Ubuntu version - tomcat8.5

I have just upgraded my Ubuntu distro from 16.04 to 18.04. Now the Tomcat 8.5 which used to work just fine, does not start up properly. The error I get is
30-Apr-2018 19:24:25.195 SEVERE [http-nio-8080-exec-1] org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.
java.lang.NoSuchMethodError: java.nio.ByteBuffer.limit(I)Ljava/nio/ByteBuffer; │
at org.apache.coyote.http11.Http11InputBuffer.recycle(Http11InputBuffer.java:280) │
at org.apache.coyote.http11.Http11Processor.recycle(Http11Processor.java:1709) │
at org.apache.coyote.AbstractProtocol$ConnectionHandler.release(AbstractProtocol.java:972) │
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:940) │
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459) │
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) │
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) │
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) │
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) │
at java.lang.Thread.run(Thread.java:748)
Does anyone know why this is happening?

As it turns out this is an issue with an update in Debian upstream. So basically the tomcat version 8.5.30-1 which is available in the Ubuntu 18.04 repositories was compiled on Java 9. So if you are still running your application on Java 8 like I do, you will face this issue.
Reference: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=895866

Tomcat8 in Ubuntu 18.04 work correct with JDK10 which is set as default after upgrade of Ubuntu.

Related

elasticsearch not started on macOS

When I try to start elasticsearch on my macOS laptop, it does not appear to have started. So much of the answers I find on the internet do not relate to using brew on macOS.
See this command line history of trying to start it.
:>brew services stop elasticsearch
Stopping `elasticsearch`... (might take a while)
==> Successfully stopped `elasticsearch` (label: homebrew.mxcl.elasticsearch)
:>brew services start elasticsearch
==> Successfully started `elasticsearch` (label: homebrew.mxcl.elasticsearch)
:>curl http://localhost:9200
curl: (7) Failed to connect to localhost port 9200: Connection refused
:>curl https://localhost:9200
curl: (7) Failed to connect to localhost port 9200: Connection refused
:>lsof -i :9200
:>sudo ps -ef | grep elastic
501 85360 68989 0 9:51AM ttys000 0:00.00 grep elastic
Also using the Network Utility I see nothing is listening at the port 9200.
I am using Catalina Version 10.15.7 (19H1030).
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)
My elasticsearch version is
Version: 6.0.1, Build: 601be4a/2017-12-04T09:29:09.525Z, JVM: 1.8.0_121
The location of the binary on my PATH is /usr/local/bin/elasticsearch
EDIT:
There was a comment to include any error messages or the output. If this was not clear, what I wrote is the only output. The only output to stdout or stderr from brew services start elasticsearch is "Successfully started elasticsearch".
However, when trying elasticsearch -d from the command line I get this:
:>elasticsearch
2021-05-24 09:33:08,875 main ERROR Could not register mbeans java.security.AccessControlException: access denied ("javax.management.MBeanTrustPermission" "register")
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
at java.lang.SecurityManager.checkPermission(SecurityManager.java:585)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.checkMBeanTrustPermission(DefaultMBeanServerInterceptor.java:1848)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:322)
at com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:522)
at org.apache.logging.log4j.core.jmx.Server.register(Server.java:389)
at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:167)
at org.apache.logging.log4j.core.jmx.Server.reregisterMBeansAfterReconfigure(Server.java:140)
at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:556)
at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:261)
at org.apache.logging.log4j.core.impl.Log4jContextFactory.getContext(Log4jContextFactory.java:206)
at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:220)
at org.apache.logging.log4j.core.config.Configurator.initialize(Configurator.java:197)
at org.elasticsearch.common.logging.LogConfigurator.configureStatusLogger(LogConfigurator.java:172)
at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:141)
at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:120)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:290)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:130)
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:121)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:69)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:134)
at org.elasticsearch.cli.Command.main(Command.java:90)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85)
ERROR: no log4j2.properties found; tried [/usr/local/etc/elasticsearch] and its subdirectories
The /usr/local/etc/elasticsearch directory exists but is empty.
:>ls -l /usr/local/etc
...
drwxr-xr-x 2 marlpier admin 64 May 19 16:30 elasticsearch
...
:>find /usr/local/etc/elasticsearch
/usr/local/etc/elasticsearch
Maybe my jvm.options file is not found. Where should it be?
Answer was that brew reinstall elasticsearch was not working.
Doing brew uninstall elasticsearch gave a java error. So to uninstall java, brew uninstall java also gave a java error.
Answer to uninstall java was here by removing the java directory.
After that I was able to uninstall elasticsearch and then install it again with brew. Now it works.

Could not create the DispatcherResourceManagerComponent

Hello I have started to learn Apache Flink. I have tried to install Flink version 1.7.2 in my Macosx 10.14.3 and for checking purpose, i started local cluster mode by writing start-cluster.sh from my cmd by the reference of flink doc.when I have opened Dispatcher’s web frontend at http://localhost:8081 in my browser it shows 403 forbidden error. I have gone through the Flink log file and I have found
Caused by: org.apache.flink.util.FlinkException: Could not create the DispatcherResourceManagerComponent.
Caused by: java.net.BindException: Address already in use
Here is my screenshot of my log file . kindly help me to solve this problem . I am running java 1.8
From reference of Jira, It was bug in version 1.7 but It is now resolved in 1.7.2 . The Dispatcher frontend is working after changing rest port value into 8089(since 8081 very common port the default value might conflict ) in flink-conf.yml .
http://www.alternatestack.com/development/apache-flink-change-port-for-web-front-end/

Facing issue in PAX exam with karaf 4.1.4

We have recently upgraded our production environment from Karaf 3 to Karaf 4.1.4. Everything seems to be fine in production. But we are facing issue when upgrading our "pax-exam" to use Karaf 4.1.4. After upgrading , our test suit is always inconsistent. Simply put, we are not able to make a REST call. Getting "Connection refused" error. On debugging more we found the port is not listening and that the CONNECTION is not established between our application and the Karaf container. Test suit fails 6 out of 10 times because of this issue. How to resolve this inconsistency ? Why is the port not getting binded sometimes ?
Note: No issues with Firewall / security
More Details :
Karaf version - 4.1.4
org.ops4j.pax.exam version - 4.11.0
Jetty server version - 9.3.21.v20170918
org.ops4j.pax.web version - 6.0.9
org.glassfish.jersey.version - 2.25.1
Once the container starts , all the bundles are up and ACTIVE and all the features are in STARTED state. We then fetch the customized port (available port) and update the corresponding osgi properties. But the update is not successful and getting the below error.
2018-06-05 13:53:39,065 ERROR [Activator.java:380] Unable to start pax web server: null - o.o.p.w.s.i.Activator
java.lang.NullPointerException: null
at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl$Stopped.start(ServerControllerImpl.java:527)
at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl.start(ServerControllerImpl.java:81)
at org.ops4j.pax.web.service.jetty.internal.ServerControllerFactoryImpl$1.start(ServerControllerFactoryImpl.java:164)
at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl$Unconfigured.configure(ServerControllerImpl.java:787)
at org.ops4j.pax.web.service.jetty.internal.ServerControllerImpl.configure(ServerControllerImpl.java:97)
at org.ops4j.pax.web.service.internal.Activator.updateController(Activator.java:347)
at org.ops4j.pax.web.service.internal.Activator.lambda$scheduleUpdateConfig$1(Activator.java:287)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

No mxbeans found - MobileFirst Console

I have installed MobileFirst Console at WebSphere Application Server 8.5.5.0.
Next I've installed my MobileFirst application. Unfortunately console shows message:
No runtime enviroment deployed in this server.
I found these errors in logs:
000000ab WASRuntimeMBe I Bean '*' does not exist.
000000ab RuntimeServic I No mxbeans found
SEVERE: Received status 500 for GET http://localhost:8080/worklightadmin/management-apis/1.0/loginAudit
java.io.IOException: Server returned HTTP response code: 500 for URL: http://localhost:8080/worklightadmin/management-apis/1.0/loginAudit
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessor>Impl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1676)
************ Start Display Current Environment ************
WebSphere Platform 8.5.5.0 [BASE 8.5.5.0 gm1319.01] running with process name >localhostNode01Cell\localhostNode01\server1 and process id 19180
Host Operating System is Linux, version 3.10.0-123.el7.x86_64
Java version = 1.6.0, Java Compiler = j9jit26, Java VM name = IBM J9 VM
was.install.root = /opt/IBM/WebSphere/AppServer
user.install.root = /opt/IBM/WebSphere/AppServer/profiles/AppSrv01
Java Home = /opt/IBM/WebSphere/AppServer/java/jre
You did not supply enough information nor replied back to any of the additional questions asked.
Therefore I will assume you are using MobileFirst Server 7.0, which is not recommended to deploy on WebSphere 8.5.5.0; you should first upgrade to WebSphere 8.5.5.4 or 8.5.5.5 and re-deploy again. If failure occurs still, be more responsive and provide the requested information.

Error in sonar startup, Unable to start JVM: No such file or directory (2)

I am facing strange issue with sonarqube 5.0.1 , one one of the machine it is not starting. Here is the error log - sonar.log -
--> Wrapper Started as Daemon
Launching a JVM...
Unable to start JVM: No such file or directory (2)
JVM exited while loading the application.
JVM Restarts disabled. Shutting down.
<-- Wrapper Stopped
Machine is x86_64 GNU/Linux - Centos 5.1.
this box has java installed -
$java -version
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
The same sonarqube package works on another machine.
Any idea what could be the issue here?
Thanks.
Issue was in the wrapper.conf where the java wrapper command was not getting resolved. It worked if I give the absolute path - ‘wrapper.java.command=/path/to/my/jdk/bin/java’
This could be an issue with an environment on a host.. not sure.
Few things that helped me in troubleshooting this -
log level changed to DEBUG in wrapper.conf
comments given in the wrapper.conf!
Thanks all for chiming in! Appreciate your inputs.
1.Just close all running jvm from task manager
2. Change the port of the sonar runner from the properties
I had the same symptoms (wrapper starts then immediately stops).
I tried these steps and finally succeeded (on a windows 10 pc):
1) in wrapper.conf, specified the java command:
wrapper.java.command=C:\Program Files\Java\jdk1.7...\bin\java.exe
That did not help.
2) Finally this fixed the problem. In the windows Services, open the Sonar service and then open Log On tab.
Changed the Log On to myself as follows:
I was facing the same issue on sonar startup. After reading this post , i modified the JDK path in below file and it works.
Modify the JDK path in wrapper.conf
wrapper.java.command=%JAVA_HOME%/bin/java
Install jdk 11
sudo yum install java-11-openjdk -y
sudo alternatives --config java
Select the JDK 11 version
Set the JDK 11 version in wrapper.conf
vi /opt/sonar/conf/wrapper.conf
wrapper.java.command=/usr/lib/jvm/java-11-openjdk-11.0.13.0.8-3.el8_5.x86_64/bin/java
Could you verify the Java version on the machine starting?
Java 6 is no more supported http://docs.sonarqube.org/display/SONAR/Requirements#Requirements-Prerequisite but from your error message, I don't know if this is the problem you meet.
Solution 1
Set java path globally
Solution 2
Go to sonarqube-{version}/conf directory
Edit wrapper.conf file
Replace wrapper.java.command=java with wrapper.java.command= {path-to-your-java-bin-directory}/java
eg: wrapper.java.command=/usr/java/bin/java
Try using a relative path, if your Sonar Folder is located in the same root folder as your jdk. For me my sonar and jdk are both under "Program Files", which has restrictive permission, hence the error.
E.g:
wrapper.java.command=../../../Java/jdk-11.0.4/bin/java

Resources