two log4j library in tomcat within different folder level - oop

all, now i have trouble with shooting - why logs didn't got printed out correctly problem.
There are 4 projects inside tomcat/webapps.
3 of them are using log4j library in the tomcat level lib directory and the other one is having its own log4j library inside its own project.
Each of them are reading their own log4j properties within their project.
I am the owner of the project which has its own log4j within the project classes folder.
and today a senior programmer accuse me because I dont use the tomcat level log4j library and the system get confused with which library should it be used, so the other three projects missing printing out the log.
Would this be true?
If yes, why? Cause my log4j read my own properties and it prints my project information correctly.
Thanks in advance to those who answer this question.

A default tomcat 7 installation does not provide a log4j library. Thus if your project needs this library it is a good idea (IMHO) to include this in your own webapp. If you depend on a specific tomcat server setup it will be hard to use the webapp in another container without changes.
By the way a statement form the tomcat documentation site regarding "using Log4j":
Note: The steps described in this section are needed when you want to
reconfigure Tomcat to use Apache log4j for its own logging. These
steps are not needed if you just want to use log4j in your own web
application. — In that case, just put log4j.jar and log4j.properties
into WEB-INF/lib and WEB-INF/classes of your web application.
I short words - I think you are doing it right and the others are doing it wrong (without knowing the details).

Related

Mule4 with Open JRE 11 - Adding additional file module-info.java?

I have downloaded fresh Mulesoft studio and changed configuration to point Open JRE- 11 and compiler to point 11.
Studio version - 7.8
When I try creating the mule project it is now also adding module-info.java along with mule.xml files.
Wonder why it is creating module-info.java I don't used to see when i was working with 1.8 version or before.
Any Idea ?? Thanks in advance.
Java 9 introduced a whole new level of encapsulation. Larger than packages, and more robust too. These are modules.
Chances are you should in the long term, migrate your project to use modules (for additional security, and for better code organization). However, the chances are also high that you won't want to do it right now, just because.
In that latter case, it would be reasonable to simply delete the module-info.java file. Provided you don't have any other module-info.java files in the system, and provided you run with everything on the classpath rather than module path (there's a good chance that's your default anyway) you should not have any problem.
Meanwhile, you have some homework to do, so you can decide if you will migrate to modules, and if so, how to do it.

Is there a simple SQL example for Apache Ignite?

I am trying to learn Apache Ignite and SQL and could not find simplest example. All examples seems bloated code with 10s of libraries needed before getting started.
Looking for complete Hello World (e.g. just pom.xml file and another 1 java file, not dependency of dependencies). I found several Github codes but they seem too big and complex for start.
Ignite package contains examples folder which is a standalone Maven project. Among others, it has a CacheQueryExample.

Intellij Java Webstart Basics

My question is "How do you get a Java Web Start project started in the IntelliJ IDEA IDE?"
First Attempt
IntelliJ's default JavaFX Project Template includes an artifact configuration that (when the native bundle is set to exe) seems to set you up to deploy your application using Java Webstart (or at least test it on your machine).
Once you Build Artifacts, it gives you a .jnlp file, as well as an HTML file containing a link to run the .jnlp file.
Yet! With even the most basic application, it's not getting off the ground.
In order to provide exact detail, I'll include the code for the HTML and .jnlp files as well as a video that shows what happens.
HTML File
.jnlp File
Video
Progress
Swing on Tomcat
I was able to successfully launch a Swing application from the local Tomcat server I just installed using some help from a tutorial—confusingly, using the similar steps of jarring, signing, and putting on webserver with a JavaFX application results in a stupid blocked window even though the file is included in the Exception Site List.
This makes me wonder if it's a signing issue. (I signed the jar with a homemade keystore, but notably without certificate or timestamp—this caused no problems with Swing; could it be causing problems with JavaFX? If I need a more-legitimate certificate and timestamp, how do I get them?)
Surely I'm missing something. What other steps need to be taken to deploy a JavaFX application using Webstart? Is anyone willing to provide a SSCCE?

Mule - Updating third party library in runtime

I'm using Mule Server 3.8 EE which brings commons-lang 2.4 with it. A third-party library in my project needs commons-lang 2.6, because it uses a method that was introduced in this version.
So when I just start my application, I get a java.lang.NoSuchMethodError
Is there a way to update the dependency in the runtime? What I tried so far:
including commons-lang 2.6 in my app -> no effect, the one from the runtime is picked up first
replacing the jar directly in the runtime -> errors in studio, that the 2.4 jar is missing
so maybe i am late BUT -- this is your answer. Add the libraries that are newer in the jar distribution to the Build Path. Under Java Build Path screen you should see the libraries listed. I needed to use Apache http-client 4.5.6 and that's very interesting because it brings with it a lot of other dependencies, so your question was VERY relevant. The solution is to rely on JAVA (and not mule -- oops Anypoint or whatever) conventions and make sure the JVM loads my class files first. Then, it won't load the old ones from mule's jar. And so I went to the tab Order and Export, and moved Mule to the bottom. This simple, trivial change makes it work. I think if we would work with command line and vim, we would all know this. But all the IDE gui and everything else makes us forget the simplest things. Please use it in good health. :)

Worklight console app, update

We're using Worklight 6.1.0.0 / WebSphere 8.0.0.2 (ND/aix).
This seemed pretty close to my question too, but for version 6.0.
I've successfully done uninstall/install to our worklight console war package. However, there is some extra work on re-deploying adapters and such. I was looking for a way to just update the console. Among the ant tasks there is a target 'minimal-update', which sounds like what I'm looking for (is it?). However when all other pieces fell into place, I have an error for mapping the datasources:
ADMA0007E: A validation error occurred in task Mapping resource references to resources. The Java Naming and Directory Interface (JNDI) name is not specified for resource reference jdbc/WorklightDS in module Worklight with EJB name .
Contents of the 'minimal-update' task is pretty much the same as for 'install'.
I tried that as update from websphere admin console (but i should use the ant task - right?), that gave me a wizard screen to map jdbc/WorklightDS from package to jdbc/WorklightDS on server. This left me wondering how could I tell this using the ant task.
The ant target minimal-update of the sample configuration files documented at http://pic.dhe.ibm.com/infocenter/wrklight/v6r1m0/topic/com.ibm.worklight.deploy.doc/devref/c_ant_tasks_sample_config_files.html is meant to update a WAR file already deployed (and not uninstalled). In particular, on WAS, it assumes that the JNDI datasources are in place.
If you have uninstalled the WAR file, you should use the target install instead, provided that your databases were created for Worklight 6.1.
If they were created for a previous version of worklight you must upgrade their schema as well running the target 'databases' (and if it's a production installation, you might want to read all the steps in detail at http://pic.dhe.ibm.com/infocenter/wrklight/v6r1m0/topic/com.ibm.worklight.upgrade.doc/devenv/c_upgrade_to_srvr610_in_production_env.html )