Jetty deletes log file every day - java

I have a fresh install of Jetty 9.4.4.v20170414. I enabled logging with:
java -jar start.jar --add-to-start=console-capture
and configured its settings in start.ini. java -jar start.jar --list-config gives this output:
...
jetty.console-capture.append = true
jetty.console-capture.dir = logs
jetty.console-capture.retainDays = 90
...
When jetty starts it creates log file in logs directory, it works just fine.
But the file is gone the next day and no new file for following day is created.
When I was using 9.3.x every day jetty just created another file to log into.

Upgrade to Jetty 9.4.5.v20170502
There was a nasty side effect of a different bug that is causing this, that was fixed with the 9.4.5 release.

Related

How to pass configuration argument on jboss

I added db2 driver, edited module.xml in JBOSS_HOME/modules/com/ibm/main.
In this folder, I have
db2jcc4.jar
db2jcc_lecense_cu.jar
db2jcc_license_cisuz.jar
module.xml
After having these, I tried to launch JBoss console on Powershell
.\standalone.bat --server-config=standalone-full-ha.xml -Dcom.sun.CORBA.ORBDynamicStubFactoryFactoryClass=com.sun.corba.se.impl.presentation.rmi.StubFactoryFactoryStaticImpl
which I tried to handle ORB exception(related to this https://bugs.openjdk.java.net/browse/JDK-6497156)
But my jboss container is not launched. I checked the log file,
2019-09-17 296 FATAL [org.jboss.as.server] (main) WFLYSRV0239: Aborting with exit code
and error display on Powershell
WFLYSRV0073: Invalid option '.sun.CORBA.ORBDynamicStubFactoryFactoryClass=com.sun.corba.se.impl.presentation.rmi.StubFactoryFactoryStaticImpl'
It works on command prompts though. I am wondering it is correct way to pass argument like this. Thanks in advance!
Edit
I am using Java8, JBoss7.1
Powershell has issues with -D. Try this instead, notice the " around -D
.\standalone.bat --server-config=standalone-full-ha.xml "-Dcom.sun.CORBA.ORBDynamicStubFactoryFactoryClass=com.sun.corba.se.impl.presentation.rmi.StubFactoryFactoryStaticImpl"

Weblogic 12.2.1.3 Error: Could not find or load main class com.oracle.cie.wizard.WizardController

I was trying to configure Weblogic 12.2.1.3 on Linux account.
After going through oracle documentation, I understood we setup Weblogic by running config.sh script located in /opt/weblogic12213/wlserver_12.2.1.3/installation/oracle_common/common/bin folder.
But this script is giving error as :
Error: Could not find or load main class
com.oracle.cie.wizard.WizardController
Below is the last command which it executes in setup script and it is giving an error :
/usr/java/jdk1.8.0_192/bin/java -Dpython.cachedir=/tmp/cachedir
-Xms32m -Xmx1024m -Dweblogic.alternateTypesDirectory=/opt/weblogic12213/wlserver_12.2.1.3/installation/wlserver/../oracle_common/modules/oracle.oamprovider,/opt/weblogic12213/wlserver_12.2.1.3/installation/wlserver/../oracle_common/modules/oracle.jps
com.oracle.cie.wizard.WizardController -target=config-oneclick
scripts provided by weblogic doesn't set CLASSPATH correctly.
com.oracle.cie.wizard.WizardController comes under com.oracle.cie.wizard_7.8.2.0.jar .
Steps done.
1. Copied config_internal.sh script on some local path. (Because I didn't have the root permission.)
2. Appended this jar in CLASSPATH varibale like this :
CLASSPATH="${FMWCONFIG_CLASSPATH}${CLASSPATHSEP}${DERBY_CLASSPATH}:/opt/weblogic12213/wlserver_12.2.1.3/installation/oracle_common/modules/com.oracle.cie.wizard_7.8.2.0.jar"

using tinylog to write loggings into tomcat's log-folder

I want to write logging-messages to a defined file into the tomcat's log-folder, using eclipse, maven, tinylog.
Problem: There is no webapp.log as soon as I run the app in tomcat.
In eclipse everything works fine.
What I did:
add Maven-dependency tinylog-1.2.jar
set configuration-parameter in Run Configuration (Main-Tab) so the tinylog-properties can be found for the build-process:
name: -Dtinylog.configuration
value: C:\Program
Files\Tomcat\apache-tomcat-9.0.0.M13\webapps\folder\subfolder\tinylog.properties
in Java-Class:
import org.pmw.tinylog.Logger;
...
Logger.info(message);
tinylog.properties looks like:
tinylog.writer = file
tinylog.writer.filename = webapp.log
tinylog.writer.buffered = true
tinylog.writer.append = true
tinylog.level = info
I also tried different file-references but none of them worked:
tinylog.writer.file = C:\Program Files\Tomcat\apache-tomcat-9.0.0.M13\logs\webapp.log
tinylog.writer.file= "C:\Program Files\Tomcat\apache-tomcat-9.0.0.M13\logs\webapp.log"
Does anybody know how to write the logs into the named path-file?
Thanks for any valuable hint.
I propose to use the tinylog-jul artifact instead of the usual tinylog artifact. tinylog-jul provides the tinylog API, but uses the Tomcat logging back end. So, you don't need to configure tinylog. All log entries will be automatically output as you are used to with other logging APIs on Tomcat.

java.lang.ClassCircularityError: java/util/logging/LogRecord from Tomcat8

I have configured logback.xml for my spring boot application. My spring boot version - 1.3.3.RELEASE, java version - 1.8 update 45, tomcat version - 8.
I have put logback.xml file in my local tomcats /lib folder.
Whenever I am running my tomcat without debug configuration it works fine.
But whenever I am trying run server with debug configured in catalina.bat file (with this option - set "JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket...... ) it displays java.lang.ClassCircularityError: java/util/logging/LogRecord and tomcat window closes.
Detailsed error trace :
java.lang.ClassCircularityError: java/util/logging/LogRecord
at org.slf4j.bridge.SLF4JBridgeHandler.getSLF4JLogger(SLF4JBridgeHandler.java:200)
at org.slf4j.bridge.SLF4JBridgeHandler.publish(SLF4JBridgeHandler.java:289)
at java.util.logging.Logger.log(Logger.java:458)
at java.util.logging.Logger.doLog(Logger.java:480)
at java.util.logging.Logger.logp(Logger.java:596)
I have tried all the solutions given in thread - ClassCircularityError when running Tomcat 6 from Eclipse
But nothing is working.
Does anyone faced this issue recently? Is there any solution or workaround for this issue?
Thanks.
Solution
There are two workarounds:
In your project, move the <contextListener ...> line in your logback.xml configuration file to the end of the file.
Instead of step 1 above, another workaround exists for those who are running Tomcat from Eclipse. Don't. Instead, run Tomcat from the terminal:
./catalina.sh start

Glassfish hangs on OS X 10.5/Java 6

I want to play around with glassfish on a Mac, but I'm having trouble getting it to start.
I've followed the installation instructions and created a default domain, which seemed to go fine, but when I try to start it (asadmin start-domain domain1) it just sits there:
[kris#Macintosh-2:~/glassfish] ./bin/asadmin start-domain domain1
Starting Domain domain1, please wait.
Default Log location is /Users/kris/glassfish/domains/domain1/logs/server.log.
Redirecting output to /Users/kris/glassfish/domains/domain1/logs/server.log
The log contains nothing but the command to launch the server:
Mar 12, 2009 7:09:40 PM com.sun.enterprise.admin.servermgmt.launch.ASLauncher buildCommand
INFO:
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java
<crapload of system properties>
-client
-XX:+UnlockDiagnosticVMOptions
-XX:MaxPermSize=192m
-Xmx512m
-XX:NewRatio=2
-XX:+LogVMOutput
-XX:LogFile=/Users/kris/glassfish/domains/domain1/logs/jvm.log
-cp
/Users/kris/glassfish/lib/jhall.jar:/Users/kris/glassfish/lib/appserv-launch.jar
com.sun.enterprise.server.PELaunch
start
Eventually, asadmin gives up waiting:
Timeout waiting for domain domain1 to go to starting state.
CLI156 Could not start the domain domain1.
This is using glassfish v2.1, but I get similar behaviour on v3 prelude. I've also tried both java 5 and 6. I'm at a loss as to what sort of debugging to do as it doesn't seem to be even getting off the ground.
I was able to start my glassfish for the first time, but the second time, it just gives me that weird error message that it could not start the domain.
Googling around, there was mention of a lock file in the imq.
Check if you have a file 'lock' in "/glassfish/domains/domain1/imq/instances/imqbroker/". If there is one, delete it, and then try to start glassfish again.
Also on the JMS front, have you tried changing your broker from EMBED to LOCAL in your domain.xml? I seem to remember that help on OS X.
Have you perhaps moved the glassfish installation dir since you first started it up? GF gets very confused about caching when you do this. Solution here.

Categories