I have liberty server running on redhat linux for my java batch application. When I liberty start server, logs gets generated with the permission of 640(messages.log). My splunk configuration not able to access this logs and expects 755 permission. what is the configuration change required to change log file permission to 755.
I have tried changing server.env with the below parameter. But didn't work as expected.
WLP_SKIP_UMASK=true
LogFilePermissions=755
Related
UPDATE 8/12/2020 approx. 11:00 AM - I checked my logs folder catalina.2020-08-12.log log in the tomcat9 ($CATALINA_BASE) folder and I found three exceptions "org.apache.catalina.LifecycleException: Protocol handler intialization failed", "java.net.BindException: Address already in use (bind failed)","java.lang.IllegalArgumentException: Invalid character found in the HTTP protocol [HTTP/1.10x0aHost:]".
Here is the full error log here: https://drive.google.com/file/d/1pSk5ESHLIRP5Srxwr4R1Tp_1TTcYMf2Y/view?usp=sharing and https://drive.google.com/file/d/1C-RALR3066_hYKeoo4dIJqTKwNDOQ0R0/view?usp=sharing.
UPDATE 8/12/2020 approx. 11:30 AM - I found that there are two servlet dispatchers running by checking the localhost.2020-08-12.log log when I restarted tomcat and tried to access my api again: https://drive.google.com/file/d/1GFKUIDLtZrAraHyMjyyWV9kXK33gQ-Mu/view?usp=sharing.
UPDATE 8/12/2020 approx. 11:35 AM - HA HAAAA I looked in the catalina.out log (finally some of you guys were probably yelling at the screen like "CHECK THE CATALINA.OUT FILE"). I checked it and I found the exception: "java.lang.IllegalArgumentException: dataSource or dataSourceClassName or jdbcUrl is required": https://drive.google.com/file/d/1A7ZLh70IHOmWXfQ56bgtq951EE_AX68P/view?usp=sharing. Now if I go to my PostgresDataSource class which is where my Hikari config is: https://drive.google.com/file/d/1lYN1dTqiAM4ZqliRGC5J5_VWhNeN-k2d/view?usp=sharing, and I review my application.yaml file from earlier: https://drive.google.com/file/d/1xvPhPneVjMU4BoN6F0Q63l2wCnF20BYq/view?usp=sharing, the jdbc url is present because it is the same one I used for developing. Now postgres is already set up and I manually made all of the tables on the ubuntu droplet. I did not download the jdbc postgresql driver for tomcat yet.
UPDATE 8/12/2020 approx. 1:20 PM - After setting up the jdbc driver now I get this error from catalina.out logs: " Failed to get driver instance for jdbcUrl=java:/comp/env/jdbc:postgresql://localhost:5432/****" and then I get "Caused by: java.sql.SQLException: No suitable driver". I used the postgresql section of this link to set it up: https://tomcat.apache.org/tomcat-9.0-doc/jndi-datasource-examples-howto.html.
Hi I am using Digital Ocean with apache tomcat 9 to deploy a war file that is generated using IntelliJ. I have the war file generated using mvn clean install and I get the default tomcat page when I go to the droplet IP address on port 8080. I am not sure why I get a 500 error with no stack trace information even though my spring boot application works fine when I run it in IntelliJ. My CSS styling also does not show up when I go to my hosted application I have tried to configure a few things in my application.yml file and it still does not work. I figured it might have to do with a spring security issue with CORS, but I am not knowledgeable enough in that area to know for sure. I started my server by using sudo $CATALINA_HOME/bin/startup.sh and it said tomcat started and it showed the default tomcat page when I went there in the browser. I used the hobynapi.war file in my target folder a picture of my target folder directory can be viewed here https://drive.google.com/file/d/1XXga1Bgf5-_81gceuWjpvVIX6J0jiNgQ/view?usp=sharing. I copied the war file that was generated after using mvn clean install to the /var/lib/tomcat9/webapps folder. I then ran sudo $CATALINA_HOME/bin/startup.sh again and it ran tomcat successfully again. Then the error happened as I tried to log in with the admin account with spring security basic authentication where I get the 500 error. I also have no artifacts in the artifact section of the project structure settings if that means anything.
UPDATE 8/12/2020 approx. 10:00 AM - I've removed the exclusions tag in the pom.xml file as well as the profiles tag at the bottom of the file. This is because I read here that using the spring-boot-starter-tomcat dependency removes the embedded server for you: https://developer.okta.com/blog/2019/04/16/spring-boot-tomcat.
This is the screen without the CSS styling that should be there:
https://drive.google.com/file/d/1CEKuB556ek8pTZspvprNTa9M5XCI7qtT/view?usp=sharing
This is the error I get without a stack trace:
https://drive.google.com/file/d/19gYGQFhZdZ_4IwwGE5tQzb4dTqlBpg9L/view?usp=sharing
These are pictures of my pom.xml file:
https://drive.google.com/file/d/1ir5uBuBuJqCb_U8Jarly9mraO468QA_y/view?usp=sharing
https://drive.google.com/file/d/1ma1_EPro4NvJiOy8lWPrAmGLMrVWHZPS/view?usp=sharing
https://drive.google.com/file/d/11NDIwA9g02zkCKnsmYSLSNF5R-BrFpgt/view?usp=sharing
https://drive.google.com/file/d/1p6T9-oOwyfj7NUsLxTRLtqXKHU4qHrZx/view?usp=sharing
https://drive.google.com/file/d/1spD7KT-3WBo7KFF0Hb_WgJ5dVKRHF-un/view?usp=sharing
https://drive.google.com/file/d/16QtJQtT9zaU7nGcpnm2KXJ6jiLywNt5s/view?usp=sharing
https://drive.google.com/file/d/1cnZJshFS5xW-HbeaH_C_e6KcDo9xYRdY/view?usp=sharing
This is my application.yml file:
https://drive.google.com/file/d/1xvPhPneVjMU4BoN6F0Q63l2wCnF20BYq/view?usp=sharing
https://drive.google.com/file/d/1B9_5WueRvqQv4ODsJAfbUzGIm-xaaSYV/view?usp=sharing
This is my main application java file:
https://drive.google.com/file/d/1K9lzzlzIKT8irqXsPY1WeiBvN-9vsoWT/view?usp=sharing
This is my web config file in my config package:
https://drive.google.com/file/d/19EYa2kkqqPu9Wh8nN-U02szSVBT30lOP/view?usp=sharing
https://drive.google.com/file/d/11Zw8dLrAu6c_OI29j0NsljvXdeDam0-t/view?usp=sharing
This is my spring security config file in my config package:
https://drive.google.com/file/d/1inqlTjfxahcF6ZeJ_xkJM18UgsDu119n/view?usp=sharing
https://drive.google.com/file/d/1nTeYiKhiNOH71Km-s_T4IT1BKRyJG4mS/view?usp=sharing
I hope that these pictures help for diagnosing the issue.
I figured it out. First I changed the postgres jdbc url back to the original one that I had and then I altered my data source config file to the following: https://drive.google.com/file/d/1Zmv8cfnVzW8NcQfjNxN14D4aKFaXpdfU/view?usp=sharing. One important thing I also messed up on was not setting a password for the default user "postgres" when downloading postgresql. I did this my calling "ALTER USER postgres PASSWORD 'myPassword';" in the postgresql command line. Also make sure that you use systemctl restart postgresql after any changes are made to postgresql in the postgresql command line.
I tried to install confluence on my own ubuntu server, but always failed. The error is:
com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.IllegalStateException: Spring Application context has not been set
at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:149)
caused by: java.lang.IllegalStateException: Spring Application context has not been set
at com.atlassian.spring.container.SpringContainerContext.getComponent(SpringContainerContext.java:48)
I saw some solutions in the jira confluence forum saying try to fix the permission of installed directory and home directory. I tried but failed again. How can I fix the problem.
In my case the issue was corrupted confluence.cfg.xml file (contains DB connection stings and other settings). The file size was 0 bytes.
I would suggest to use a VM to create a new installation and borrow confluence.cfg.xml from that installation.
It's embarrassing that this behavior has been allowed to exist for nearly 7 years in a commercial product. This is a basic stuff...
I wish that was on instructions somewhere:
Make single backup copy of confluence.cfg.xml immediately before any writes to it by the application. Application should be able to restore from backed up copy if it gets corrupted.
Atlassian documentation lists the following causes of this problem:
The user running Confluence does not have write permissions to the home folder defined in <install>/confluence/WEB-INF/classes/confluence-init.properties or the install directory.
You are running Confluence as the root user or if you have an application firewall enabled (SeLinux or AppArmor).
The database driver is not located in the <install>/confluence/WEB-INF/lib folder or you are using a database version that is incompatible with the bundled driver.
The hostname of the server can not be resolved.
In my case I was running it as root user inside docker container.
I have created logs for my project in a log file. I have provided the location of log file as 'logs/LogFile.log' in the java code. When run on a local server(Tomcat or Websphere), a new folder named 'logs' is created in the classpath of the server and i can find the 'LogFile.log' with logs in it.
Now my project is converted to EAR and it is up in the Dev Server. Where will my log file be created? How can i see those logs?
For a local server, the logs will be appended in the destined log file, which will be in the server installed directory or a remote user created directory.
In case of a remote server, say Unix server, the logs will be generated in the specified location inside the server. We need to login to the unix server via putty or Techtia and can view the logs in the specified locations.
I have problem with starting Apache Tomcat 6 from Netbeans IDE 7.4 (on 7.3 version I had the same troubles. Other people mentioned that this problem exist also in other versions, like 8.0 etc).
What did I do:
remove installed Tomcat 7 (without removing it, I had the same difficulties)
add new server, downloaded from Apache Tomcat website (version apache-tomcat-6.0.39, with other version I had the same problems)
my server location: D:\apache-tomcat-netbeans
system variable CATALINA_HOME: D:\apache-tomcat-netbeans
system variable JAVA HOME: C:\Program Files\Java\jdk1.7.0_51\
tomcat user: I let netbeans creating new user, called tomcat with password tomcat. When I open {tomcat}\conf\tomcat-users.xml file after adding server, there is info about my user:
< user password="tomcat" roles="manager,admin" username="tomcat"/ >
When I now click "start", I got "Starting of Tomcat failed".
My suspicions:
I'm working on Windows 7 as administrator, so I think this is not a problem with privileges to files.
Disabling proxy didn't helps.
Logs: There is only one log file created: localhost.2014-03-06.log and it is totally empty.
Starting Netbeans "as administrator" didn't helps.
From command line everything is all right, I have no problems with starting in normal or debug mode (catalina.bat jpda start or startup.bat)
It affects at least NetBeans versions 7.4 through 8.0.2. It was first reported from version 8.0 and fixed in NetBeans 8.1. It would have had the problem for any tomcat version (confirmed for versions 7.0.56 through 8.0.28).
Specifics are described as Netbeans bug #248182.
This problem is also related to postings mentioning the following error output:
'127.0.0.1*' is not recognized as an internal or external command, operable program or batch file.
For a tomcat installed from the zip file, I fixed it by changing the catalina.bat file in the tomcat bin directory.
Find the bellow configuration in your catalina.bat file.
:noJuliConfig
set "JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%"
:noJuliManager
set "JAVA_OPTS=%JAVA_OPTS% %LOGGING_MANAGER%"
And change it as in below by removing the double quotes:
:noJuliConfig
set JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG%
:noJuliManager
set JAVA_OPTS=%JAVA_OPTS% %LOGGING_MANAGER%
Now save your changes, and start your tomcat from within NetBeans.
This affects:
All versions of Tomcat starting from 8.5.3 onwards.
All versions of Netbeans up to 8.1 (It is fixed in Netbeans 8.2).
This is because Netbeans does not 'see' that tomcat is started, although it started just fine.
I have filed Bug #262749 with NetBeans.
Workaround
In the server.xml file, in the Connector element for HTTP/1.1, add the following attribute: server="Apache-Coyote/1.1".
Example:
<Connector
connectionTimeout="20000"
port="8080"
protocol="HTTP/1.1"
redirectPort="8443"
server="Apache-Coyote/1.1"
/>
Cause
The reason for that is that prior to 8.5.3, the default was to set the server header as Apache-Coyote/1.1, while since 8.5.3 this default has now been changed to blank. Apparently Netbeans checks on this header.
Maybe in the future we can expect a fix in netbeans addressing this issue.
I was able to trace it back to a change in documentation.
Tomcat 8.5:
"Overrides the Server header for the http response. If set, the value
for this attribute overrides any Server header set by a web
application. If not set, any value specified by the application is
used. If the application does not specify a value then no Server
header is set."
Tomcat 8.0:
"Overrides the Server header for the http response. If set, the value
for this attribute overrides the Tomcat default and any Server header
set by a web application. If not set, any value specified by the
application is used. If the application does not specify a value then
Apache-Coyote/1.1 is used. Unless you are paranoid, you won't need
this feature."
That explains the need for explicitly adding the server attribute since version 8.5.3.
Also, it is very likely, that problem with proxy settings.
Any who didn't overcome Tomact starting problrem, - try in NetBeans choose No Proxy in the Tools -> Options -> General tab.
It helped me.
None of the answers here solved my issue (as at February 2020), so I raised an issue at https://issues.apache.org/jira/browse/NETBEANS-3903 and Netbeans fixed the issue!
They're working on a pull request so the fix will be in a future .dmg installer soon, but in the meantime you can copy a file referenced in the bug and replace one in your netbeans modules folder.
Tip - if you right click on Applications > Netbeans and choose Show Package Contents then you can find and replace the file org-netbeans-modules-tomcat5.jar that they refer to in your Netbeans folder, e.g. within /Applications/NetBeans/Apache NetBeans 11.2.app/Contents/Resources/NetBeans/netbeans/enterprise/modules
For NetBeans to be able to interact with tomcat, it needs the user as setup in netbeans to be properly configured in the tomcat-users.xml file. NetBeans can do so automatically.
That is, within the tomcat-users.xml, which you can find in ${CATALINA_HOME}/conf, or ${CATALINA_BASE}/conf,
make sure that the user (as chosen in netbeans) is added the script-manager role
Example, change
<user password="tomcat" roles="manager,admin" username="tomcat"/>
To
<user password="tomcat" roles="manager-script,manager,admin" username="tomcat"/>
make sure that the manager-script role is declared
Add
<role rolename="manager-script"/>
Actually the netbeans online-help incorrectly states:
Username - Specifies the user name that the IDE uses to log into the server's manager application. The user must be associated with the manager role. The first time the IDE started the Tomcat Web Server, such as through the Start/Stop menu action or by executing a web component from the IDE, the IDE adds an admin user with a randomly-generated password to the tomcat-base-path/conf/tomcat-users.xml file. (Right-click the Tomcat Web server instance node in the Services window and select Properties. In the Properties dialog box, the Base Directory property points to the base-dir directory.) The admin user entry in the tomcat-users.xml file looks similar to the following: <user username="idea" password="woiehh" roles="manager"/>
The role should be manager-script, and not manager.
For a more complete tomcat-users.xml file:
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="manager-script"/>
<role rolename="manager-gui"/>
<user password="tomcat" roles="manager-script" username="tomcat"/>
<user password="pass" roles="manager-gui" username="me"/>
</tomcat-users>
There is another nice posting on why am I getting the deployment error?
I had the same problem but none of the answers above worked.
The solution for me was to restore the Manager web application that is bundled with Tomcat.
When i debug my application in net beans, oracle weblogic server displays below exception in console.
Connecting to t3://localhost:7001 with userid weblogic ...
This Exception occurred at Wed Oct 16 16:56:01 IST 2013.
javax.naming.AuthenticationException
Problem invoking WLST - Traceback (innermost last):
File "D:\Weblogic\Middleware_1\base_domain\shutdown.py", line 3, in ?
File "<iostream>", line 22, in connect
File "<iostream>", line 648, in raiseWLSTException
WLSTException: Error occured while performing connect :
User: weblogic, failed to be authenticated.
Use dumpStack() to view the full stacktrace
my application uses oracle weblogic server and results will published into orale Bi publisher
My shutdown.py:
wlsUserID = java.lang.System.getenv('wlsUserID') wlsPassword = java.lang.System.getenv('wlsPassword') connect(username=wlsUserID, password=wlsPassword, url='t3://localhost:7001', adminServerName='AdminServer') shutdown('AdminServer','Server', ignoreSessions='true') exit()
I think your WebLogic AdminServer is locked when you try shutdown. Can you delete .lok files in your AdminServer directory or check Lock & Edit function in WebLogic console?
EDIT: If not able to delete .lok files and you want to stop WebLogic you can use the nmkill command. I don't know what type of OS you use. I always use kill -9command in Unix to stop WebLogic. To start WebLogic server you first need to start NodeManager and after the AdminServer. Here is nmStart command.
Normally you will have to define your userid and password in boot.properties file in security folder of your Admin/Managed Server. In your case the location will be "D:\Weblogic\Middleware_1\base_domain\servers\AdminServer\security". If the file boot.properties is not existent create one in that location and mention the following in plain text:
username=weblogic
password=password123
If the server startup is successful it will be encrypted automatically.
We too faced the same issue earlier. Just i reloaded the .bash_profile or .bash_rc files where i have placed the JAVA, ORACLE_HOME paths. After re-loading the files, the issues is resolved and I am able to shutdown the weblogic server.