alpine linux docker image, console encoding trouble - java

I have a scala app that is running in docker container. I use image 'develar/java' which is based on alpine linux. My app is working, but i don't see cyrillic logs. Here what i have:
docker logs -f myApp
22:22:08.152 [main] INFO application - Creating Pool for datasource 'default'
22:22:09.213 [main] INFO play.api.db.DefaultDBApi - Database [default] connected at jdbc:postgresql://localhost/db
22:22:09.627 [main] INFO p.a.l.concurrent.ActorSystemProvider - Starting application default Akka system: application
22:22:09.698 [main] INFO application - ????????????? ??????? ???????
22:22:09.722 [main] INFO application - ????????????? ??????? 'direct
22:22:09.734 [main] INFO application - ????????????? ??????? 'adwords
22:22:09.761 [main] INFO play.api.Play$ - Application started (Prod)
22:22:09.866 [main] INFO play.core.server.NettyServer$ - Listening for HTTP on /0:0:0:0:0:0:0:0:9000
But logs that are delivered to elasticsearch server are ok. How can i force alpine linux to work with utf-8?

develar/java has an old bug of an old glibc 2.21 package. Andy Shinn (the creator and maintainer of glibc package for Alpine) and I have resolved this a long time ago in glibc 2.23 packaging, which I have integrated into frolvlad/alpine-glibc, which is the base image for frolvlad/alpine-oraclejre8. Just replace devalar/java with frolvlad/alpine-oraclejre8:slim and you should be fine.

Related

Spring boot app not available when deployed in EC2 using docker - Error 404

I'm using spring boot web app. It was working fine in tomcat server 8.0 running on my desktop PC
URL used: http://{desktop_ip}:8080/tennis/
Now i'm trying to deploy the same war using docker running in EC2 instance
i copied the war to EC2 instance and deployed using below command
sudo docker run -it -p 8080:8080 -v tennis.war:/usr/local/tomcat/webapps/tennis.war -d tomcat:8.0
when i try to access the application i'm getting Error 404
url used: http://{EC2_Public_ip}:8080/tennis/
but I'm able to access tomcat default examples app
http://{EC2_Public_ip}:8080/examples/
So i'm assuming the IP and port are accessible
In the logs i see the app is deployed with out any error
Logs
13-Sep-2019 05:33:39.587 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/docs] has finished in [53] ms
13-Sep-2019 05:33:39.590 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/examples]
13-Sep-2019 05:33:40.295 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/usr/local/tomcat/webapps/tennis.war]
13-Sep-2019 05:33:40.359 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/usr/local/tomcat/webapps/tennis.war] has finished in [64] ms
13-Sep-2019 05:33:40.369 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8080"]
Access Log
173.171.238.114 - - [13/Sep/2019:05:34:25 +0000] "GET /tennis/ HTTP/1.1" 404 1085
173.171.238.114 - - [13/Sep/2019:05:34:39 +0000] "GET /tennis/ HTTP/1.1" 404 1085
I have also tried in docker tomcat 9.0 , but no luck
Any suggestions please
try to change the -v like this:
-v /full/path/tennis.war:/usr/local/tomcat/webapps/tennis.war
I think Docker create a named volume here with empty folder

Spring boot application has a delay loading enviroment variables as an init.d service

We have a spring boot (version 1.3.3) application running as an init.d service. It's configurated as it's stated in the spring boot documentation for deployment here.
We use a ".conf" file to define the RUN_ARGS, the JVM arguments and the environment variables in the scope of the app.
We have no problem with the app functionality, but when we start the service (service myapp start) it creates a folder called "LOGS_PATH_IS_UNDEFINED" and it starts to log inside it. After a few lines, the app continues to log in the folder defined in the environment variable defined in the ".conf" file.
This is the myapp.conf content:
LOGS_PATH="/usr/logs"
JAVA_HOME="/usr/java/jdk1.8.0_77"
JAVA_OPTS="-Xms256m -Xmx512m"
RUN_ARGS="--spring.profiles.active=staging --server.port=8090"
This is the log content in the "LOGS_PATH_IS_UNDEFINED" (without sensible info):
2018-10-08 09:43:42,549 INFO [main] Application:? : Starting Application v1.0 on server with PID xxxx (/opt/myapp/myapp.jar started by server in /opt/myapp)
2018-10-08 09:43:42,552 INFO [main] Application:? : The following profiles are active: staging
2018-10-08 09:43:51,106 INFO [localhost-startStop-1] WebConfigurer:? : Web application configuration, using profiles: [staging]
2018-10-08 09:43:51,133 INFO [localhost-startStop-1] WebConfigurer:? : Web application fully configured
2018-10-08 09:43:59,435 INFO [localhost-startStop-1] Application:? : Running with Spring profile(s) : [staging]
2018-10-08 09:44:01,215 INFO [main] ThymeleafConfiguration:? : loading non-reloadable mail messages resources
2018-10-08 09:44:14,223 INFO [main] Application:? : Started Application in 33.926 seconds (JVM running for 35.172)
2018-10-08 09:44:14,223 INFO [main] Application:? : Access URLs:
----------------------------------------------------------
Local: http://127.0.0.1:8090
External: http://127.0.1.1:8090
----------------------------------------------------------
2018-10-08 09:44:27,844 INFO [http-nio-8090-exec-1] CustomPersistentRememberMeServices:? : presentedToken=xxxxx / tokenValue=xxxxx
The DevOps have no idea why and they are demanding us to fix it.
We do not have this problem running the app in the command line as an executable jar.
We use Logback for logging.
Thanks in advance for the help!
We fixed it!
The environment variable was not set in the server. A simple "export" before the LOGS_PATH="/usr/logs" line in the ".conf" fixed the problem.

Nifi commands on windows

In my current project, I have been using apache-nifi on Windows operating system.
I have extracted nifi-0.7.0-bin.zip file in C:\. Now, when I run \bin\run-nifi.bat as an administrator I see the following message on the command line and I am not able to run nifi. Could you please suggest what should I do in order to run the nifi.
the content of app.log file as follows
2016-08-08 11:41:57,716 INFO [main] org.apache.nifi.NiFi Launching NiFi...
2016-08-08 11:41:57,851 INFO [main] org.apache.nifi.BootstrapListener Started Bootstrap Listener, Listening for incoming requests on port 50050
2016-08-08 11:41:57,877 INFO [main] org.apache.nifi.BootstrapListener Successfully initiated communication with Bootstrap
2016-08-08 11:42:59,485 WARN [Timer-0] org.apache.nifi.NiFi NiFi has detected that this box is not responding within the expected timing interval, which may cause Processors to be scheduled erratically. Please see the NiFi documentation for more information.
The content of nifi-bootstrap.log file is as follows:
2016-08-08 11:41:57,279 INFO [main] o.a.n.b.NotificationServiceManager Successfully loaded the following 0 services: []
2016-08-08 11:41:57,286 INFO [main] org.apache.nifi.bootstrap.RunNiFi Registered no Notification Services for Notification Type NIFI_STARTED
2016-08-08 11:41:57,286 INFO [main] org.apache.nifi.bootstrap.RunNiFi Registered no Notification Services for Notification Type NIFI_STOPPED
2016-08-08 11:41:57,286 INFO [main] org.apache.nifi.bootstrap.RunNiFi Registered no Notification Services for Notification Type NIFI_DIED
2016-08-08 11:41:57,298 INFO [main] org.apache.nifi.bootstrap.Command Starting Apache NiFi...
2016-08-08 11:41:57,299 INFO [main] org.apache.nifi.bootstrap.Command Working Directory: C:\NIFI-0~1.0
2016-08-08 11:41:57,299 INFO [main] org.apache.nifi.bootstrap.Command Command: C:\Program Files\Java\jdk1.8.0_102\bin\java.exe -classpath C:\NIFI-0~1.0\.\conf;C:\NIFI-0~1.0\.\lib\jcl-over-slf4j-1.7.12.jar;C:\NIFI-0~1.0\.\lib\jul-to-slf4j-1.7.12.jar;C:\NIFI-0~1.0\.\lib\log4j-over-slf4j-1.7.12.jar;C:\NIFI-0~1.0\.\lib\logback-classic-1.1.3.jar;C:\NIFI-0~1.0\.\lib\logback-core-1.1.3.jar;C:\NIFI-0~1.0\.\lib\nifi-api-0.7.0.jar;C:\NIFI-0~1.0\.\lib\nifi-documentation-0.7.0.jar;C:\NIFI-0~1.0\.\lib\nifi-nar-utils-0.7.0.jar;C:\NIFI-0~1.0\.\lib\nifi-properties-0.7.0.jar;C:\NIFI-0~1.0\.\lib\nifi-runtime-0.7.0.jar;C:\NIFI-0~1.0\.\lib\slf4j-api-1.7.12.jar -Dorg.apache.jasper.compiler.disablejsr199=true -Xmx512m -Xms512m -Dsun.net.http.allowRestrictedHeaders=true -Djava.net.preferIPv4Stack=true -Djava.awt.headless=true -Djava.protocol.handler.pkgs=sun.net.www.protocol -Dnifi.properties.file.path=C:\NIFI-0~1.0\.\conf\nifi.properties -Dnifi.bootstrap.listen.port=50049 -Dapp=NiFi -Dorg.apache.nifi.bootstrap.config.log.dir=C:\NIFI-0~1.0\bin\..\\logs org.apache.nifi.NiFi
2016-08-08 11:41:57,866 WARN [NiFi Bootstrap Command Listener] org.apache.nifi.bootstrap.RunNiFi Failed to set permissions so that only the owner can read status file C:\NIFI-0~1.0\bin\..\run\nifi.pid; this may allows others to have access to the key needed to communicate with NiFi. Permissions should be changed so that only the owner can read this file
2016-08-08 11:41:57,876 INFO [NiFi Bootstrap Command Listener] org.apache.nifi.bootstrap.RunNiFi Apache NiFi now running and listening for Bootstrap requests on port 50050
I recommend running NiFi with the current directory context in the bin directory:
Open a new command prompt window
Change to the NiFi bin directory, cd c:\nifi-0.7\bin
From c:\nifi-0.7\bin, execute run-nifi.bat
I believe run-nifi.bat depends on finding nifi-env.bat in the current directory, rather than finding it relative to its own path. If you ran C:\...\nifi-0.7.0\bin\run-nifi.bat, I think you would see that error.

Raspberry PI & Tomcat

I need help setting up my Tomcat server on my Rasp. The majo problem is, i can run Tomcat from its directory with startup.sh. It than says that tomcat is running ... what a lie. If i test it with configtest.sh i get a few exceptions thrown at me.
further when i look # catalina.out i get somthing like this:
23-Nov-2015 17:11:52.997 INFO [localhost-startStop-1] org.apache.catalina.start$
23-Nov-2015 17:11:52.999 INFO [localhost-startStop-1] org.apache.catalina.start$
23-Nov-2015 17:11:53.201 INFO [localhost-startStop-1] org.apache.catalina.start$
23-Nov-2015 17:11:53.204 INFO [localhost-startStop-1] org.apache.catalina.start$
23-Nov-2015 17:11:55.521 INFO [localhost-startStop-1] org.apache.catalina.start$
23-Nov-2015 17:11:55.523 INFO [localhost-startStop-1] org.apache.catalina.start$
23-Nov-2015 17:11:55.642 INFO [localhost-startStop-1] org.apache.catalina.start$
23-Nov-2015 17:11:55.680 INFO [main] org.apache.coyote.AbstractProtocol.start S$
23-Nov-2015 17:11:55.735 INFO [main] org.apache.coyote.AbstractProtocol.start S$
23-Nov-2015 17:11:55.740 INFO [main] org.apache.catalina.startup.Catalina.start$
23-Nov-2015 17:11:55.751 SEVERE [main] org.apache.catalina.core.StandardServer.$
java.net.BindException: Cannot assign requested address
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.AbstractPlainSocketImpl.bind(AbstractPlainSocketImpl.java:3$
at java.net.ServerSocket.bind(ServerSocket.java:375)
at java.net.ServerSocket.<init>(ServerSocket.java:237)
at org.apache.catalina.core.StandardServer.await(StandardServer.java:42$
at org.apache.catalina.startup.Catalina.await(Catalina.java:713)
at org.apache.catalina.startup.Catalina.start(Catalina.java:659)
I'm not able to understand the error... There is nothing else running, i rebootet several times, checkt the processes, checked the ports but nothing is in use as far as i can see it.
I tried tomcat per apt-get as a service and as a simple package from tomcats website. Both without any sucess.
I than deletet all and installed apache just for testeng. Apache runs without any errors and is accesable via the browser after installation.
I got two questions.
1: What is the problem with tomcat? Any suggestions why tomcat may not be able to get a adress.
2: The main reson i want tomcat is to run a RESTFUL webaplication on the Rasp.Is there maby a other Webserver that can hold on to Java servlets or war files?
Setup: Raspberry PI2
Java 1.8
Tomcat 7 or 8 tried them both.
thanks in advance and a nice Monday too you

Selenium RC doesn't run the test suite by BAT file

I've tried to run my test suite by Selenium RC through a BAT file.
Actually it worked OK until yesterday morning and it stopped to run my test suite.
Probably because I've added user-extensions.js and since that I can't run my test suite by the selenium RC.
How can I add this script to my test suite?
I'm using Selenium IDE for to write my test cases, so I guess that make this more complex problem..
This is the console log of the BAT file during the execution:
>
C:\automation>cd C:\automation\screenshots\
C:\automation\screenshots>del *.png
Could Not Find C:\automation\screenshots\*.png
10:46:38.926 INFO - Launching a standalone server
10:46:39.098 INFO - Java: Oracle Corporation 25.25-b02
10:46:39.098 INFO - OS: Windows 8.1 6.3 amd64
10:46:39.113 INFO - v2.44.0, with Core v2.44.0. Built from revision 76d78cf
10:46:39.238 INFO - RemoteWebDriver instances should connect to: http://127.0.0.
1:4444/wd/hub
10:46:39.238 INFO - Version Jetty/5.1.x
10:46:39.238 INFO - Started HttpContext[/selenium-server,/selenium-server]
10:46:39.379 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler#6e3c1e
69
10:46:39.379 INFO - Started HttpContext[/wd,/wd]
10:46:39.379 INFO - Started HttpContext[/selenium-server/driver,/selenium-server
/driver]
10:46:39.379 INFO - Started HttpContext[/,/]
10:46:39.379 INFO - Started SocketListener on 0.0.0.0:4444
10:46:39.379 INFO - Started org.openqa.jetty.jetty.Server#b1bc7ed
jar:file:/C:/automation/selenium-server-standalone-2.44.0.jar!/customProfileDirC
USTFFCHROME
10:46:39.535 INFO - Preparing Firefox profile...
10:46:42.666 INFO - Launching Firefox...
10:46:44.245 INFO - Checking Resource aliases
This is the code line from the BAT file:
java -jar C:\automation\selenium-server-standalone-2.44.0.jar -htmlSuite "*firefox C:\Program Files (x86)\Mozilla Firefox\firefox.exe" "https://www.mywebsite.com" "C:\automation\emailSanity.html" "C:\automation\testing_results.html" -port 4444
This is the screenshot of the actual result of the Selenium RC in action:
http://i57.tinypic.com/28u71jl.png
Please your help!
Thanks a lot.
Considering your app is at the splash screen, I can only assume that you forgot to put in your URL to initially open.
Since you are using RC, then your first statement of your test script should be:
selenium.open("http://example.com"); // where example.com is the app is your SUT.

Categories

Resources