what port can use on OpenShift for org.apache.felix.shell.remote? - osgi

I would like to use bot web admin and gogo command line interface for Felix on OpenShift.
I can get web admin working, but to log into a running felix I need the remote shell.
I start felix with:
java -Dosgi.shell.telnet.port=15000 -Dorg.ops4j.pax.web.listening.addresses=127.7.77.1 -jar bin/felix.jar
and it throws:
ERROR: Bundle org.apache.felix.shell.remote [7] Error starting file:/var/lib/openshift/xxxxx/app-root/runtime/repo/osgi/felix-framework-4.4.1/bundle/org.apache.felix.shell.remote-1.1.2.jar (org.osgi.framework.BundleException: Activator start error in bundle org.apache.felix.shell.remote [7].)
java.net.BindException: Permission denied
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:376)
at java.net.ServerSocket.bind(ServerSocket.java:376)
Any idea how I can get that to work?
Thank you.

There are four externally available ports for your OpenShift Online application. Two web ports 80 (http)/ 443 (https), and two websocket ports 8000 (ws)/8443 (wss).
From the looks of your command you're trying to connect to 15000 which will result in the
java.net.BindException: Permission denied error
You could try replacing your port=15000 and listening.addresses= with the proper OpenShift Environment variables (see https://developers.openshift.com/en/managing-environment-variables.html for more information)

Related

How to deploy a spring boot application to tomcat server from jenkins?

Sample Spring boot application is created and build on Jenkins.
For Deployment of war file in tomcat server ,
I am facing a several issues.
Error :
Credentials At Jenkins :
tomcat-users.xml File :
Still I am facing the same issue. I had searched in google and stackoverflow but still i can't found the correct answer.
Can Any one help me in this ?
Your error message is a connection refused: connect exception. You should check the following:
Your Tomcat server is up and running on port 8082 at the same server where your jenkins server is running (localhost). To make sure, run: telnet localhost 8082 from the same server commandLine ( I see you are in windows). If it connects then your Tomcat server is OK.
Check if the manager application of Tomcat is deployed. Try to load the following web page and check if exists: http://localhost(or hostname of server):8082/manager/html
Try to disable the windows firewall and any other firewall you may have (or antivirus firewall) and check if it prevents jenkins to connect to Tomcat (again check with telnet command)

Getting " Logs eventsource failed with: 400 Bad Request" in Heroku logs

I am trying to understand why my JHipster app is not working when i deploy it to Heroku (It does locally) so my first thought was going to the logs. However when i type $ heroku logs i receive back the following error.
571 borgesan:~/bitbucket/eureka $ heroku logs -n 200
▸ Logs eventsource failed with: 400 Bad Request
What could be causing this error?
I encounter exactly the same log message when deploying a kotlin app that works locally with 'heroku local web'. The web app is based on a jetty server running on port 5000 (same port as in the kotlin-getting-started example, but different web server).
In parallel, all requests to server are refused with 503 Service available
Is there a parameter to set somewhere in the heroku configuration or procfile to declare internal port 5000 (to allow mapping between outside port 80 or 443 to internal port 5000)?
Is it a problem due to CORS or so ? In other words, shall the application accept specific fields of request header ?
other thing to take care of ?
Thanks

Running wamp 3.1.3 Apache 2.4.33 fails with make_sock: could not bind to address [::]:80 NT Kernel and System has taken it

I have done a fresh installation of wamp server, checked all distributable dependencies, killed skype, ran as Administrator...
It fails to start Apache...
In event log it fails with following 4 messages:
The Apache service named reported the following error:
AH00015: Unable to open logs .
The Apache service named reported the following error:
AH00451: no listening sockets available, shutting down .
The Apache service named reported the following error:
(OS 10013)An attempt was made to access a socket in a way forbidden by its access permissions. : AH00072: make_sock: could not bind to address 0.0.0.0:80 .
The Apache service named reported the following error:
(OS 10013)An attempt was made to access a socket in a way forbidden by its access permissions. : AH00072: make_sock: could not bind to address [::]:80
So port 80 is taken, and whatever is using it has to be killed...
Here's the twist, it is used by NT Kernel and System which the way I read this is Windows core. Now obviously I can't just kill windows and begone with it...
I am not sure how to debug this further... How to figure out which system service (or whatever) I need to disable to free up the port 80 when it is marked as used by NT Kernel and System?
Figured out by myself by running cmd as admin and using netstat -bano
My mistake was that I had disabled IIS and Skype so I thought I was safe, turns out it was SQL Server Reporting Services (MSSQLSERVER) that had to be also killed.
After this wamp turned green.

Bluemix Docker Container deployment results in "No route to host"

we are deploying a docker-image using this command:
cf ic run -p 8080 -m 512 -e SPRING_PROFILES_ACTIVE=test -e logging.config=classpath:logback-docker-test.xml --name <container-name> registry.eu-gb.bluemix.net/<repository_name>/<container-name>:latest
Within that container we are starting a Java8 Spring-Boot application that uses a connection-pooling provider. The connection-pooling provider connects to an existing PostgreSQL-Database that is accessible on the standard port. We do not use any domain name to connect to PostgreSQL-Database. We only use the IP-Address and the standard postgresql port.
The deployment is working on a machine that uses the standard Docker container daemon and is also working on Amazon WebServices (AWS) without any problems and using the same deployment mechanism.
However, if we are deploying the image to the Bluemix-Container-Service we do get the following error at startup of the spring-boot application:
Caused by: java.net.NoRouteToHostException: No route to host
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.postgresql.core.PGStream.<init>(PGStream.java:61)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:129)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:65)
at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Connection.java:146)
at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Connection.java:35)
at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gConnection.java:22)
at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Connection.java:47)
at org.postgresql.jdbc42.AbstractJdbc42Connection.<init>(AbstractJdbc42Connection.java:21)
at org.postgresql.jdbc42.Jdbc42Connection.<init>(Jdbc42Connection.java:28)
at org.postgresql.Driver.makeConnection(Driver.java:415)
at org.postgresql.Driver.access$100(Driver.java:47)
at org.postgresql.Driver$ConnectThread.run(Driver.java:325)
... 1 more
We don't know why this happens, because if we do a telnet on another Bluemix-Docker-Machine to the PostgreSQL-Database server with the desired port everything is fine.
This is very annoying, since we cannot use this Docker-Image on Bluemix currently and is currently obstructing our planned roll-out.
Can you help us with details what might be wrong and how can fix this?
Any help will be appreciated.
Regards,
Christian
Is this error raised when the container is starting up?
If so, the Docker/IBM Containers on Bluemix take about between 30 up to 60 seconds in networking status: during this phase the container is not able to connect to the network.
It should be really probably the root cause of the error you are getting: if the Java SpringBoot application is trying to connect to the PostgreSQL database when the container is still in networking phase, it will fail with this error.
You should start your application running on the container when the container has completed the networking phase (for example through a bash script that checks the availability of the PostgreSQL server, or simply configure your springboot to manage this exception)
Official bluemix support gave the hint to wait for 120 seconds before starting the Java-Application that needs network access. The suggested way is:
CMD ["/bin/sh", "-c", "sleep 120; exec java $JVM_ARGS -cp /app org.springframework.boot.loader.JarLauncher --spring.main.show_banner=false"]
With that we have got network access and everything is fine.

Failure to run commands from apache karaf client

I have downloaded apache karaf2.3.3 (on felix) on several CentOS6.4 machines. I see this issue only in a few machines. When I try to install a feature using the following commands
$KARAF_HOME/bin/start
$KARAF_HOME/bin/client "features:install myfeature"
I get the following stack trace:
WARN org.apache.sshd.client.session.ClientSessionImpl - Exception caught
java.io.IOException: Connection reset by peer
at sun.nio.ch.FileDispatcherImpl.read0(Native Method)
at sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
at sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:223)
at sun.nio.ch.IOUtil.read(IOUtil.java:197)
at sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:379)
at org.apache.mina.transport.socket.nio.NioProcessor.read(NioProcessor.java:273)
at org.apache.mina.transport.socket.nio.NioProcessor.read(NioProcessor.java:44)
at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:690)
at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:664)
at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:653)
at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$600(AbstractPollingIoProcessor.java:67)
at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1124)
at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:744)
Looks like client fails to connect to karaf. Firewall is shutdown on all of the machines. Anyone knows why this could be failing? The feature gets happily installed if run karaf in console mode with /bin/karaf and type in the same command
My guess is that the port you defined for the remote Karaf console was already in use by another application before the Karaf installation. As such the wrong application accepts the link, cannot make anything of the data and resets the connection. I would suggest to stop Karaf, check with netstat or via telnet localhost <port> whether the port Karaf is configured to listen on is already in use, and find the related application. As an alternative, you can configure Karaf to use a different (not used) port. See for example this page

Resources