signature problems on java class - xpages

VERY OFTEN I get the followeing error after building a project in DDE:
HTTP JVM: java.lang.SecurityException: Error verifying signature for
resource WEB-INF/classes/se/sebank/namis/utils/Utils$Params.class. For
more detailed information, please consult error-log-0.xml located in
E:/IBM/
HTTP JVM: com.ibm.xsp.webapp.FacesServlet$ExtendedServletException:
java.lang.NoClassDefFoundError: se.sebank.namis.utils.Utils$Params
All other classes do not give problems, but mostly this file causes problems.
Is there anything I can do to improve the build process.
My "approach" is currently trying cleaning, building the project several times. Sometimes I have to close and restart DDE

Related

Runtime error when class files added to jar in wrong order

This is a very strange error that took a while to find out what was going on. We have multiple jenkins linux slaves that were building a library. When the library was tested from one slave all was well. When it was tested with the other it got a runtime error with where it was trying to call a method signature that was non-existent. After lots of testing, I was able to determine that the order in which the class files were added to the jar determined if the tests would work or not. Does anyone know where to begin trying to remedy this? Is this a bug in groovy classloading? java classloading? Any ideas are appreciated.
I took the approach that the error state was in fact the correct state and started looking at the application config in detail (I'm on build team, so I was not familiar with this app) and found a bad spring configuration object. The issue dealt with order in which classes were processed by annotation scanner. If one class was processed first it would give a bad config which gave a bad app state which caused the error. The other build servers were building the jar with the bad class later in the config which caused a different state to be loaded which essentially ignored the bad file. This is why order in which classes were added to the jar mattered. I was able to correct the bad config and solve the error permanently.

Exception thrown. For more detailed information, please consult error-log-0.xml in XPage

I am running Xpage Application on Domino Server 8.5.3 FP1 Windows 64bit.
We are sending the bills(documents) around 2500 users. during testing ,this application works fine without any error. When we rollout the bills to user. All users are trying to open the application.
It is throwing the following error. But Application still works. At some point of time, Application gets slow and http hang. I have do restart of HTTP. Then it works fine.
I am not able to find the cause whether any error in the code or because number of users are accessing the application increases.
06/04/2014 10:58:53 AM HTTP JVM: CLFAD0211E: Exception thrown.
For more detailed information, please consult error-log-0.xml located in D:/Lotus/Domino/data/domino/workspace/logs
And sometimes this is also throwing ,
HTTP JVM: CLFAD0141E: Error processing XPage request. For more detailed information,
please consult error-log-0.xml located in D:/IBM/Lotus/Domino/data/domino/workspace/logs
Please help on this query.
You should start with what Paul suggests. If you haven't already downloaded and installed LogReader (by Jakob Majkilde), then you should. It is a database on your server that will read the various error file types and show them for you in an easy way. You can find it here: http://www.openntf.org/internal/home.nsf/project.xsp?action=openDocument&name=XPages%20Log%20File%20Reader
From these log files you will then have to look at where the system complains about problems. Did you write the code in Java or Serverside Javascript (SSJS)? You have options to debug both of these (although I cannot remember if you can debug SSJS in version 8.5.3 - it may not be available until version 9.0). But you could always add a println in the code near where you think it breaks ;-)
/John
At some point of time, Application gets slow and http hang. I have do restart of HTTP. Then it works fine.
As mentioned by Paul + John, no one is going to be able to give you an exact answer from the posted message.
As you mention the application gets slows and hangs, I would also recommend watching the XPages Masterclass.
It is approx 4 hours of videos, and goes into detail on how to debug your application for performance issues using the XPages Toolbox.
Again this isn't an exact solution. You will need to use the XPages toolbox to drill down on your code/JVM to see where it is slowing down/hanging.
Posting the stacks from the error-log-0.xml log file might give some hints, but with performance/hangs it's rarely that simple to find.
Now Application is working without issue. I have just included exception handling in all ssjs.
Now it is not throwing error.
Thanks for all your help and time.

OpenJPA 2.1.1 enhancement problem on Glassfish 3.1.1

My problem is this exception:
Caused by: <openjpa-2.1.1-r422266:1148538 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: This configuration disallows runtime optimization, but the following listed types were not enhanced at build time or at class load time with a javaagent: "
I'm trying to get an very simple java application with jsf and jpa running, but there seems to be a problem with the enhancement of my entities. As far as I know, tries OpenJPA to enhance my entities at runtime, which are listet in the persistence.xml, however there is no agent to do this. The keyword for this is: Enhancing at Runtime, right?
I thought the enhancement will automatically done by the application server at deployment? How can I configure this?
My exactly environment:
Glassfish 3.1.1
Derby, which is integrated in Glassfish
OpenJPA 2.1.1
Mojarra JSF 2.1.3
Update #1:
After some comments I've added the following lines to my persistence.xml:
<property name="openjpa.DynamicEnhancementAgent" value="false"/>
<property name="openjpa.RuntimeUnenhancedClasses" value="supported" />
It works now, but OpenJPA throw this warning:
SEVERE: 52 myApp WARN [http-thread-pool-8080(5)] openjpa.Enhance - Creating subclass for "[class myApp.model.entities.AbstractEntity, class myApp.model.entities.Post]".
This means that your application will be less efficient and will consume more memory than it would if you ran the OpenJPA enhancer. Additionally, lazy loading will not be available for one-to-one and many-to-one persistent attributes in types using field access; they will be loaded eagerly instead.
I think this can't be the solution.
Update #2:
Refer to fvu's answer, I've tried to define the -javaagent jvm parameter in the domain.xml and over the web admin console. After a restart appeared the problem again.
Update #3:
Refer to update #2, I've played a bit around. There must be thrown an error, when the -javaagent parameter is used, but the file is missing, right?. Yes, there it is:
Waiting for domain1 to start .Command start-domain failed.
Error starting domain domain1.
The server exited prematurely with exit code 1.
Before it died, it produced the following output:
Error occurred during initialization of VM
agent library failed to init: instrument
Error opening zip file or JAR manifest missing : /tmp/openjpa.jar
If I copying the agent to this location, this error doesn't appear, but openjpa could still not enhance my entities!
If you're still having issues... I'd highly recommend biting the bullet and setting up build time enhancement. You'll be much happier in the long run if you get that going.
A couple of ideas:
add the Java agent for enhancement to GF's JVM option, see this link for an example of how to install a javaagent and OpenJPA's doc 5.2.3, enhancing at runtime. That emulates enhancer activation in desktop apps as closely as possible IMO.
However, when I read chapter 5.2.4 of the OpenJPA docs it might be capable of picking up the correct enhancer automatically. Try copying openjpa.jar to the domain's library directory, and check what happens after a server restart.

WARNING: Multiple JSF Applications found on same ClassLoader. Unable to safely determine which FactoryManager instance to use

I am trying to create an application where I combine jsf2, prettyfaces, jpa and glassfish 3.1. I had some trouble gettings prettyfilter to load properly, which was fixed by following the tutorial here.
However, after completing the steps I got a problem with the Glassfish log being flooded by some really really irritating warnings mesages. It seams they dont have any impact on the functionality of my page, but I would like to know if there is something that will make them go away? The warning is:
WARNING: Multiple JSF Applications found on same ClassLoader. Unable to safely determine which FactoryManager instance to use. Defaulting to first match
In addition I'm having problem undeploying this webapp. Glassfish admin gui will show a text saying "Long lasting process has been detected", before the admin gui is useless and I have to restart the gf server. I get an error in the gf log:
INFO: PrettyFilter shutting down...
INFO: Admin Console: Initializing Session Attributes...
WARNING: java.lang.reflect.InvocationTargetException while attempting to process a 'command' event for 'button1'.
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException while attempting to process a 'command' event for 'button1'.
Not sure if this makes any sense for anyone, but any help is much appreciated!!:)
Both issues are already reported to the Glassfish dev team.
Issue GLASSFISH-15809 - JSF PhaseListener executed for each virtual host
Issue GLASSFISH-16112 - Admin GUI fails with NPE when attempting to undeploy an application
Glassfish 3.2 will be the earliest version where both issues will be fixed.

java.lang.SecurityException: class "org.apache.log4j.Logger" does not match trust level of other classes in the same package

For an java web application, I got this error when using JRE 1.6.0_22
java.lang.SecurityException: class "org.apache.log4j.Logger" does not match trust level of other classes in the same package
However, it works fine when using JRE 1.6.0_13.
I searched in Google, and find the there is a security enhancement since update 19.
And for this exception, it says,
The following two SecurityExceptions are thrown after mixed components had previously been detected and a decision was made to allow them to coexist. The exceptions indicate that a component name collision (resource name or class package name) was detected between trusted and untrusted components and the request to load the resource or class was denied.
Now the problem is, how could i find which classes (maybe org.apache.log4j.Logger?) have the collision and which packages they are in?
I find there is a similar question in Oracle forums
Interesting link. I didn't have the problem yet - but may it be that you have the jar with "org.apache..." in the JavaEE container classpath somewhere and in the web application.
Look for that and to test remove it from the web app

Resources