Trying to configure JaCoCo agent in Weblogic 11g, after giving below mention parameter
-XXaggressive -Xmx8192m -Xms8192m -Xgc:pausetime -Xgc:gencon -XXnosystemgc -Duser.home=/scratch/app/product/fmw/XXXinstall/XXX/config -Dsun.net.client.defaultConnectTimeout=10000
-javaagent:/scratch/app/product/fmw/user_projects/domains/host_domain/lib/jacocoagent.jar=destfile=/scratch/app/product/fmw/user_projects/domains/host_domain/tmp/host_jacoco.exec,output=tcpserver,address=,includes=com.*
WEBLOGIC SERVER IS NOT COMING UP PROPERLY FOR BELOW MENTION LOGS
Error
Caused by: java.lang.ClassCastException: [Z
at XXX.app.AbstractApplication.fetchAllOverriddenServices(AbstractApplication.java:1000)
at XXX.app.AbstractApplication.checkAccess(AbstractApplication.java:930)
at XXX.app.sms.service.provider.AccessibleResourceApplicationService.initializeRequestedResource(AccessibleResourceApplicationService.java:1011)
at XXX.app.sms.service.provider.AccessibleResourceLoader.initializeSingleton(AccessibleResourceLoader.java:187)
at XXX.app.sms.service.provider.AccessibleResourceLoader.loadResources(AccessibleResourceLoader.java:232)
at XXX.app.adapter.impl.sms.AccessibleResourceLoaderAdapter.loadResources(AccessibleResourceLoaderAdapter.java:49)
at XXX.app.bootstrap.BootstrapInitializer.initializeSecuritySingletons(BootstrapInitializer.java:292)
at XXX.channel.branch.bootstrap.BootstrapServlet.init(BootstrapServlet.java:46)
Note : After removing parameter :
-javaagent:/scratch/app/product/fmw/user_projects/domains/host_domain/lib/jacocoagent.jar=destfile=/scratch/app/product/fmw/user_projects/domains/host_domain/tmp/host_jacoco.exec,output=tcpserver,address=,includes=com.*
Server is coming up properly.
As was answered in https://github.com/jacoco/jacoco/issues/567 :
WebLogic server without applications starts perfectly with JaCoCo.
Most likely you have an issue in your code:
To collect execution data JaCoCo adds members to the classes. One of those members is a field with type boolean[] ([Z in bytecode notation). These members are marked as synthetic. Your application and its libraries must ignore synthetic members. If they are not ignored, then change you application to do so, or exclude classes from instrumentation using agent parameters includes and excludes.
Run your application under debugger, put a breakpoint at line XXX.app.AbstractApplication.fetchAllOverriddenServices(AbstractApplication.java:1000) and investigate why there is wrong cast or/and which classes to exclude. Or start excluding packages of your application one by one.
Related
I have 2 applications. The first is a Play! Framework (v2.5.1) application. This application's job is to read the aggregated data. The second is an Apache Flink (v1.1.2) application. This application's job is to write the aggregated data.
The error
java.lang.NoSuchMethodError: com.typesafe.config.ConfigFactory.defaultApplication(Lcom/typesafe/config/ConfigParseOptions;)Lcom/typesafe/config/Config;
This is caused by Play & Flink using different versions of com.typesafe.config (1.3.0 vs 1.2.1).
I've tried
I've tried using shading, but there are further complications when I get to using Akka. Akka also has conflicting versions, so I shade config & akka, which leads to a configuration error in Akka. If I duplicate the configuration to the correct path, then the ActorSystem fails to initialize because of incorrect class version.
Research
I don't know this area well, but it seems like a number of JVM servers handle this by doing parent-last class loading. Is that possible in flink?
There may be other, simple solutions that I've not tried as well. If there are some of those, let me know, and I'll gladly try them.
Thanks for your help!
I am developing a JDBC driver which is a wrapper for a web service. My unit tests work fine and I can write my own Java code that uses the driver to do useful things.
When I plug it into Squirrel SQL it is able to connect and get its initial batch of metadata (properties, schemas/catalogs, etc), but a simple SELECT query does not work. I receive an InvocationTargetException. This means a reflective call failed inside the method or constructor being invoked: this exception always wraps another exception which shows what really failed.
However, the error window in Squirrel SQL simply shows the exception name: no wrapped exception/cause, no stack trace. The log in my user directory contains no information regarding what happened.
Looking through the global properties and connection properties, I have not found any settings that would increase logging. I am using Squirrel SQL version 3.5.3 on Java 7 64-bit, Windows 7 64-bit.
How can I get Squirrel SQL to provide more information to help me find the cause of this error? I do not care if it outputs to the log file or the error window, just so I have something to go by.
The easiest way to change the log level is to edit the log4j.properties file. This file is in the same folder as the batch file that starts SquirrelSQL.
Simply change the line
log4j.rootLogger=info, SquirrelAppender
to
log4j.rootLogger = debug, SquirrelAppender
We're developing a software with Weblogic application server (12.1.1.0); We have one domain with two applications.
We just moved up from development DB to pre-production DB (similar to production), and oh boy we got a major issue going...
DBA says the DBs are running the same version - Oracle 11 (I don't recall the exact version). The only difference we can see is that the dvlp DB uses SID for connection, and the other two uses service-name.
Now, in our domain we have two data sources X and Y. Both are connected to the same DB. We use XA driver on both. Both our applications uses the same 'persistence.xml' (and entities) which has two PUs (persistence units), each using a different data source (X and Y).
The problem is this:
An MDB starts handling a request.
It uses both PUs with EntityManagers and the Y data source with DataSource interface, which is used to get a connection (we have some JDBC code).
It calls a bean from the other application.
The other bean tries to use one of the PUs (the one connected to X data source).
SQLException is thrown:
XA error: XAResource.XAER_NOTA start() failed on resource 'x_my_domain': XAER_NOTA : The XID is not valid
We've searched the error online and we found out that we should change the data sources' configuration to
XASetTransactionTimeout=true
XATransactionTimeout=0
but that didn't worked.
We've also tried (a lot) to tweak the data sources' configuration, eventually removing one of them so we only need to tweak with only one of them, but nothing has worked.
In addition, while repeatedly tweaking the configuration, a different SQLException has slipped under our radar and started popping out instead of the previous:
Internal error: Cannot obtain XAConnection weblogic.common.resourcepool.ResourceDisabledException: Pool X is Suspended, cannot allocate resources to applications
Now this one is even more frustrating, because we tried everything; reset the data source; delete and re-create; delete and re-create with different name; delete the domain and re-create with a different data source name; go back using the dvlp DB; but nothing, the exception seems to persist.
We really don't have any idea of how to solve this and we can't go any further without fixing this problem.
We finally found how to fix the problem, but to answer the question I will have to explain more about our environment; We actually have two managed servers, and each application runs on another server. Both the admin-server and one of the MS runs on one machine, and the other MS runs on another machine (total of two machines).
The thing was that when we modified one of the data sources (X), which was used also by the other MS, we didn't restarted the other MS, but only the data-source. We guess that this caused the data-source not to update with the new modifications on the other MS, which caused the errors we encountered.
The problem was caused by a rather foolish reason, but it was hard to spot because it recurred on any environment setup of the admin-server + first MS part, even on our own PCs with a setup of only an admin-server with no definition of machines. The reason it still happened is because the address of the machine containing the other application was written in the code (read from XML configuration, but that doesn't change much).
Well, glad that's over with.
I have have a solution that I created with the new modeler tools. This gave me
two full "endpoints" in a single solution.
Now when I run them through my automated build, I have two dlls in the same
folder that implement IConfigureThisEndpoint.
If I just run NServiceBus.Host.exe \install (to get a Windows Service), it gives
me the (expected) error that there is more than one class that can be used.
I did some searching and Udi states here:
http://tech.groups.yahoo.com/group/nservicebus/message/3937 that "You can
specify which class you want loaded and avoid these issues - as the server
project in the pub/sub sample shows".
I looked at the pub/sub sample and I can't see how I can specify my class (at
least not at the command line).
Is there a way to get around having to modify my build to put the files in
separate folders? (Not really an easy task for me.)
Add a config entry to your app settings with the key EndpointConfigurationType and the value being the assembly qualified name of the type.
I have a solution (WCF service) that has many Entity Framework modules in it. Each dll is named differently.
When I (and my co-workers) run this locally it all works fine. When we run the auto build and copy the files to a Dev Server it all works fine.
But when we copy the files to a Test Server I get an error:
Resolution of the dependency failed, type = "OrderManagementInterfaces.IOrderModel", name = "(none)".
Exception occurred while: Calling constructor OrderDAL.OrderEntities(System.String connectionString).
Exception is: MetadataException - Schema specified is not valid. Errors:
OrderDataModel.csdl(3,4) : error 0019: The EntityContainer name must be unique. An EntityContainer with the name 'OrderEntities' is already defined.
It then follows with all the parts of my schema saying that each was already defined. When I first got this error it was the same kind of error but for a different Entity Framework module. (Not sure if that is important or not.)
So my question is: Is there an IIS Setting that could cause this? Why would it work in my dev server and not my test server?
And what can I do to fix it.
NOTE: I have checked many times to see if I have a duplicate module or container name. There is only one module and container named OrderEntities.
I saw that sometimes this is a product of the metadata part of the connection string. My Connection String looks like this:
metadata=res://*/OrderDataModel.csdl|res://*/OrderDataModel.ssdl|res://*/OrderDataModel.msl;provider=...
All the others are the same except the Data Model name is different.
Note: when I deploy to IIS. I delete all files and only copy in the stuff from the auto build. (Same stuff to both locations.)
Turns out it was nothing to do with my code.
I had my Identity in my App Pool incorrectly set. Once that was switched to the right value, it all started working :)