Webapp Logback Logging Does Not Work Using Tomee Plus 1.6.0 on Linux - linux

I am able to get logback logging to work correctly on my development environment (Windows) using Tomee 1.6.0.1; however, whenever I try to deploy the webapp on my Tomee server on Linux, it never creates the "test.app.log" file specified in the logback.xml configuration file inside of the WEB-INF/classes directory of the webapp.
Using maven, I have included logback-classic-1.1.2 and logback-core-1.1.2 in the WEB-INF/lib directory of the webapp.
I double check permissions for the directory to which I wish to write (CATALINA_BASE/logs), but it is set to rw for all users so I doubt that is the problem.
No matter what I try, all of my logs keep getting pushed to catalina.out. Can anybody solve the mystery as to why logging with logback works correctly on Windows (development environment) but not Linux?

It turns out that we were separating our EJB's into another directory and adding that directory as a "Deployment dir" in tomee.xml. This unhooks the webapp independent logging.
Romain, from Tomee fame, suggested I use either VirtualWebappLoader or jars.txt implementations.

Related

How to change Jenkins home directory (~/.jenkins) when there is no jenkins installed

I never installed Jenkins on my server. All I have done was downloading .war file and tomcat is hosting it. By default it made a directory under my home directory (~/.jenkins) which Jenkins using for its own config and parameters.
Is there anyway to change the directory that Jenkins is pointing to? I need to move this directory.
I searched for that a lot but people all gave a solution for the case that Jenkins is installed already.
The server is running 'Red Hat Enterprise Linux Server release 6.7', and Jenkins version is 1.642.4.
You can easily change the JENKINS_HOME location by adding an environment entry in the context container used by tomcat for the jenkins webapp (typically in /etc/tomcat[VERSION]/Catalina/localhost/[context-name].xml), like this:
<Context (..)>
(..)
<Environment name="JENKINS_HOME" value="[your jenkins home]" type="java.lang.String"/>
</Context>
In case of Apache Tomcat you can specify startup parameters, including JENKINS_HOME for specifying Jenkins directory, in $CATALINA_BASE/bin/setenv.sh file:
$ cat setenv.sh
CATALINA_PID="${CATALINA_BASE}/tomcat.pid"
CATALINA_OPTS="-Duser.language=en -Duser.country=US -Djava.awt.headless=true -DJENKINS_HOME=${JENKINS_HOME} -Xms1024m -Xmx8192m -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true"
In above example ${JENKINS_HOME} is set an environment variable, but you can replace it by absolute path.
Please refer to Apache Tomcat documentation for more details.

logs are still showing "Starting Servlet Engine: Apache Tomcat/7.0.42" after upgrading tomcat to 7.0.054

i just upgraded tomcat to 7.0.54 from 7.0.42 and started it.. Everything is looking as expected but while starting the tomcat it showing "Starting Servlet Engine: Apache Tomcat/7.0.42" this line in logs..
i checked all my configurations again and but couldn't found from where that line is coming.
Please help me with this
Are you sure you have upgraded correctly. If you unpacked new tomcat to new location, but left the CATALINA_HOME variable unchanged most likely you still start up the old tomcat and hence the logs.
So check if you don't have system variables set to point to wrong paths. If you overwrote the old instalation check if you really did it, in linux there would be typically read only.
Thanks for the advise. I found the issue. I was overriding new tomcat on old tomcat. But i didn't replace new lib with old lib. After doing so, issue resolved

Tomcat Intellij Idea: Remote deploy

RackSpace Cloud Server Ubuntu-12.04, Intellij Idea-11.1.2, Windows-8, Tomcat-7.0.26, JDK-6.
On Intellij Idea when i try to run jsf project on my remote Tomcat 7 server it says:
Error running servername: Unable to connect to the ip-address:1099
It seems problem is about JNDI port which is 1099 but I couldn't activate it I guess. Tomcat config is sth. like that:
What I've tried?
Setting CATALINA_OPTS or JAVA_OPTS on the server side with:
CATALINA_OPTS=-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=1099
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
and
JAVA_OPTS=-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=1099
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
But this one did not work, any ideas?
My answer to my question:
The correct way to deploy remotely is editing JAVA_OPTS environment variable on the remote server. Just enter the command below:
export JAVA_OPTS="-Dcom.sun.management.jmxremote=
-Dcom.sun.management.jmxremote.port=1099
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false"
If that's not going to work and if you don't have any obsession to deploy your website via Intellij Idea, I've got the solution for this problem. To be able to run your website under Tomcat, you can/should get artifact in form of .war file.
It can be done in Intellij from project settings(ctrl+alt+shift+s) then hit the plus button and add new artifact(web:application archieve)
After rebuilding the artifact, .war file can be seen in project-folder\out\artifacts. Next, you should place this file into your tomcat/webapps folder.
For example if you are using Tomcat-7, the folder that I mean exists in /var/lib/tomcat7/webapps. Before copying your .war file you should rename it as ROOT.war. This provides to access your site directly by http://youripaddress:8080. After restarting Tomcat7 service you can access the site.
But not finished yet, you can debug your project remotely like you are debugging your project at your local machine with Intellij Idea. Open Run/Debug Configuration in Idea, hit the plus button and there must be Remote. This is the way to debug your projects for application servers like JBoss, Glassfish as well in Idea. Enter your host and port numbers, select your project as a module.
Before starting to debug, as Intellij says you should give the following parameter to your server JVM:
JAVA_OPTS="$JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005"
To be able to do that in Ubuntu and for Tomcat-7, modified the catalina.sh file in usr/share/tomcat7 folder. I inserted the parameter above of the if [ -z "$LOGGING_MANAGER" ]; then line. It must be on the middle part of the file. Then you should be able to debug your project with Intellij Idea.

Debug Node.js - The iisnode module is unable to deploy supporting files necessary to initialize the debugger

I get the following error when I try to debug a node.js application using Azure SDK for Node.js:
The iisnode module is unable to deploy supporting files necessary to initialize the debugger. Please check that the identity of the IIS application pool running the node.js application has read and write access permissions to the directory on the server where the node.js application is located.
I have installed the full version of iisnode and added the config settings in web.config. Here is an example of what I type in the browser:
http://server:81/server.js/debug
. The application is using IIS Express to run that is provided in the latest Windows Azure SDK for Node.js - August 2012.
Any help will be appreciated!
There are two possible issues here, depending on which version of the Azure SDK for Node you are running:
(1) If you are running a version < 0.6, then this is almost certainly a permissions issue with your webrole directory. Note that, in IIS, it's the actual web role directory and not the directory in local_package.csx that is actually used in the web role. Make sure that iiS_IUSRS has write access to this directory and it should work.
(2) If you are running a version >= 0.6, then the problem is that you are using an iisnode version that isn't iis full inside iisexpress. You can get around this by editing setup_web.cmd to use the path to the iisnode dll in your iisnode directory (rather than the iisnode-dev directory or the SDK directory).

Where is the log file using Production profile with NServiceBus GenericHost and default log4net settings when installed as a service?

I have a very simple NServiceBus.Host.exe application that is using the default logging and the Production profile. According to the documentation, this should result in an appending file log that should appear in the same folder as the EXE. However, when I run the application as a service, the log file doesn't appear in the same folder as the EXE, and thus far I've been unable to locate it at all. The service is running as Local System. Do I need to run it as a user account and look for the file in the AppData folder somewhere? Is it under c:\windows somewhere? Where is it and is there a way for me to have it actually log to a file in the same folder as the EXE as advertised?
Update:
Using ProcMon and ProcExp from SysInternals, I can see that there is no attempt to create any log file in the folder where my EXE exists, nor are there any file permission errors while trying to create a log file anywhere, at least not from the PID of the service (if for some reason log4net spins up another process to do this work then I might have missed it).
It turns out that the service wasn't actually running in the Production profile. I had for some reason gotten it into my head that services would run in the production profile by default, while running it in interactive mode would use Lite by default. Not so - the service will use the Lite profile unless you specify otherwise. I changed my command to install the service from:
NServiceBus.Host.exe /install /displayName:MyService
to
NServiceBus.Host.exe /install /displayName:MyService NServiceBus.Production
and this fixed the issue.

Resources