I'm trying to modify an application that was deployed with JNLP onto my PC. However, when I try to replace the existing application's JAR with my new jar, it fails to lookup javax.jnlp.SingleInstanceService and javax.jnlp.BasicService.
I've already signed the main JAR file with my own key pair (not the original one), but it still does not work.
The following two lines throw UnavailableServiceException (uninitialised).
BasicService lookup = (BasicService)ServiceManager.lookup("javax.jnlp.BasicService");
SingleInstanceService singleInstanceService = (SingleInstanceService)ServiceManager.lookup("javax.jnlp.SingleInstanceService");
On the unmodified JAR (which is run with java.exe -cp SomeJar.jar), no exceptions are thrown. I am certain that this is a signature issue, as even a resigned file with no other modifications still has this issue.
Is there any way I can replicate this on my modified JAR (perhaps by adding it's keystore certificate to some file)?
The problem is not in jar signing. To use JNLP API you should start your jar via jnlp file.
Syntax for running jnlp file is: javaws your_jnlp_file
Your jar should be registered in resources container inside your jnlp file, and your jar should be deployed as part of your web aplication.
You are starting your jar as standard jar.
The reason why the old jar did not result in error, most possibly because it had simply handled UnavailableServiceException.
Related
I'm trying to prevent the...
[localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
...error from showing up for my war file deployment since I have no TLD defined.
There are many questions and answers regarding this issue but they all seem to point to altering Tomcat's global configuration, which I do not want.
How can I, via my war file's local context.xml file, inform the scanner that no TLD exists and therefore a scan and subsequent warning is unnecessary?
First add logging.properties below:
org.apache.jasper.servlet.TldScanner.level = FINE
Second restart tomcat.
Third open logs/catalina.out and you can find below:
31-Oct-2017 09:20:37.563 FINE [localhost-startStop-1] org.apache.jasper.servlet.TldScanner$TldScannerCallback.scan No TLD files were found in [file:/home/vhr/lib/jcert.jar]. Consider adding the JAR to the tomcat.util.scan.StandardJarScanFilter.jarsToSkip property in CATALINA_BASE/conf/catalina.properties file.
Fourth if you don't scan jcert.jar, you edit conf/catalina.properties, add jcert.jar to tomcat.util.scan.StandardJarScanFilter.jarsToSkip.
Sorry for my poor English.
I have two ejb jars packaged into a ear. say EJb1.jar adn Ejb2.jar. I am deploying it in Webphere 7.0. Ejb1 is referencing to classes in Ejb2.jar. Unless I specify the Ejb2.jar in Manifest.Mf file of Ejb1.jar, the deployment of EAR file fails.
Throws error that build path is incomplete and that referenced class is not found.
Is there any way I can overcome this ? Through some settings in WebSphere console?
I have too many ejb's in this ear referencing each other.
It makes things really difficult to update manifest file each time we make code changes.
Any ideas ?
If you want to avoid that what you need to do is create and EJB Client Jar which holds the interfaces and put it in the EAR/lib directory.
For example if EJB1.jar got MyBean.java and MyBeanLocal.java you will now split it to 2 jars files:
EJB1.jar (EJB Module) holding MyBean.java and EJB1-Client.jar (Utility Jar) holding MyBeanLocal.java
Then you put EJB1-Client.jar in the EAR file lib directory and EJB2.jar will be able to find the interfaces in its classpath.
I have log4cxx implementation in utility.dll. This dll is used by application1.dll and application2.dll
Application1 defines log file name as "c:\application1\applog.log"; Application2 defines log file name as "c:\application2\applog.log".
If I run both the applications seperately, logs are created in the corresponding files properly. If I try to run both the applications simultaneously the logs are created in latest opened application's log file.
I have opened application1 first logs are created in "application1\applog.log" file. At same time I opened Application2. Now both application's logs are appended in "application2\applog.log"
Note: Both of my applications are dlls acting like a drivers) Both are acting as a seperate application I need logs to be in different output files. Both dlls will run under same exe.
How to make the the same log4cxx implementation to log in different log files per application?
I had a similar situation where my app and dll were logging to the same file. This is just an educated guess, but try changing the name of the logger in the dlls and app.
// in application1.dll
const log4cxx::LoggerPtr logger1 log4cxx::Logger::getLogger("ABC"));
log4cxx::PropertyConfigurator::configure("./application1.config");
// in application2.dll
const log4cxx::LoggerPtr logger2 log4cxx::Logger::getLogger("ABC"));
log4cxx::PropertyConfigurator::configure("./application2.config");
Assuming you are using a canned configuration. applicagtion1.config and application2.config could be identical except for the log4j.appender.File.File= line
in application1.config
log4j.appender.File.File=logs/application1.logs
and in application2.config
log4j.appender.File.File=logs/application2.logs
I have some problems regarding the EJB injection and I haven't been able to find a solution anywhere.
My situation is the following: I have an EAR file that includes a WAR and several JARs, all listed in the application.xml file. All is working fine for this part.
The problems come out when I try to add what we can call a “plugin system”.
I have a JAR with inside some .xhtml pages, backing beans and EJBs. This JAR, if needed, is inserted inside the EAR in a specific directory (let's call it “plugins”) and is detected from the application at startup.
When the JAR is detected it's path is added to the WAR class loader so all the pages and the backing bean are detected without problems. What is not working is the injection of the EJBs (I tried to use the notation #EJB, #Inject, the lookup...). I can't inject any of the EJBs that is inside the JAR plugin.
My guess is that the application server treats the JAR as a simple library module and doesn't look for any EJB inside it, so they are inside the JAR but not usable from the application.
My question is: there's a way of having this working? I tried to add the JAR in the EAR's MANIFEST.MF but nothing changed...
the application server i'm using is glassfish 3.0. About the application.xml: there's no reference in it about the JARs that are part of what i called "plugin system". This because i detect them when i deploy (or i restart) the application in the application server, so they may or may not be inside the system and i don't really know that before the system is started.
Each plugin JAR is a "collection" of pages and functionalities that can be added or removed from the system dynamically (more less like a real plugin system).
My EAR structure is the following:
MyApp.EAR
META-INF
lib
plugins
plugin1.JAR
app.WAR
logic1.JAR
logic2.JAR
for example: in the application.xml i have the references for app.WAR, logic1.JAR and logic2.JAR (they are always inside the system), at startup the application looks inside the folder "plugins" for any plugin (specific JARs) to be added to the system.
I hope i've been more clear about what i'm trying to do...
It seems that the EJB are not even registered in the JNDI tree of the server. Which application server are you using? You can have a look to this JNDI tree to see if the EJBs are there, but the way to do this depends on the specific server.
How are you declaring the JAR that contains the EJBs in the EAR application.xml?
It should be someting lide this:
<application>
....
<module>
<ejb>nameOfTheJarFile.jar</ejb>
</module>
</application>
The Jar should be in a the "/lib" directory of the EAR.
I hope this helps.
Hi I'm facing with a bug in old ejb application which is deployed on IBM Websphere 6.1. Previously it ran but now it stopped for some reason which I have to investigate.
I'm trying to get it to run locally on my desktop, and I'm trying to access the session bean with IBM's launchclient application. I pass in the ear as the argument (yes that's IBM specific) and the ears contains both the ejb-jar and the ejb-client.jar (also IBM specific).
Launchclient fails with the message: myear does not contain an Application Client jar file. Which may be true, but it does contain the client-ejb jar file, which I even bothered to address with -CCjar=MyEjbClient.jar.
My question is how can I make an application client jar file?
I cant find much information on the launchclient thing, I do have RAD 7.x or something, but to be honest I want to stay away from it as much as possible and it's getting really frustrating.
regards,
PS someone knows a nice NO IBM job?
It is not sufficient to have an ejb-client-jar, you need an application client JAR. Also, -CCjar can only be specified for an application jar (and it's not necessary if you only have one).
To add an application client JAR to an EAR, you need to:
Create a Java class with a traditional main method.
Package the class in a JAR in the EAR.
Add a Main-Class to the META-INF/MANIFEST.MF in the JAR.
Add a META-INF/application-client.xml file to the JAR.
Add the module to application.xml in the EAR:
<module>
<java>MyClient.jar</java>
</module>