Attach and Configure JACOCO agent on Weblogic Server - weblogic

My Application is deployed on weblogic server. I want to attach jacoco agent to the weblogic server.
Is there any way to attach it in weblogic server using startWeblogic or setDomainEnv.
OR
is there any other way to implement this?

I tested this with Weblogic 12.1.3 on Linux and it worked.
setenv JAVA_OPTIONS -javaagent:$JACOCO_HOME/lib/jacocoagent.jar\=includes\=ccdemo.\*,output\=tcpserver,address\=\*
There were no changes to startWeblogic.sh or other files needed.

Related

Why is MobileFirst Server Configuration Tool not letting me deploy with libertyAdminUser and libertyAdminPassword?

I'm trying to deploy a MobileFirst server to a local Liberty server configured with an LDAP server.
When I try and deploy my server configuration the admin task fails due to lack of attributes for connecting to Liberty.
BUILD FAILED
C:\Users\Administrator\Documents\IBM MobileFirst Platform Server Data\Server Configuration Tool\Configuration_Hello MobileFirst Server\Hello MobileFirst Server.xml:88: The element <installWorklightAdmin>, <jmx libertyAdminUser=".." libertyAdminPassword="..."/> is missing. A default user cannot be created for this server.
I have tried updating the server configuration file manually before deploying, but the server configuration tool is just saving over the changes.
How can I resolve this problem from within the Server Configuration Tool?
The Server Configuration Tool in MFP 7.0 can't be used to make an install on a Liberty server that is configured with LDAP.
In the simplified install process of the Server Configuration Tool, it automatically creates a Liberty Administrator in a basic registry and this is not possible if Liberty is configured with LDAP.
If you don't want to create ant files manually, you can:
Export the ant files that you created with the Server Configuration Tool (Menu File/Export Configuration as Ant files...)
Edit them so that they have the right attributes in the jmx element (you need to provide the login of password of a user that will be used as Liberty Administrator and that the apps will use to perform JMX calls)
Run the ant files as described here
For the admin: https://www-01.ibm.com/support/knowledgecenter/SSHS8R_7.0.0/com.ibm.worklight.installconfig.doc/install_config/r_wlconsole_ant_tasks.html
For the runtime: https://www-01.ibm.com/support/knowledgecenter/SSHS8R_7.0.0/com.ibm.worklight.deploy.doc/devref/c_project_war_file_ant_tasks.html
You may encrypt the password of the JMX user with the Liberty securityUtility program (in LibertyInstallDir/bin)

How do I connect JProfiler on a JBoss 7.x server in Domain mode?

I want to profile a server (JVM) that is part of a JBoss 7.1.3 domain. The Server Integration wizard of JProfiler only modifies standalone.sh, which is of no use in domain mode. Does anyone know how to accomplish this?
For application servers that don't have an integration wizard, use the [Generic] integration wizard. It will give you a VM parameter that has to be added to the java invocation of the application server.

IntelliJ and Local Tomcat: Mandatory?

Is it mandatory to have a local Tomcat Server in order to configure an Application Server in IntelliJ IDEA? My ultimate goal is to deploy to my remote Tomcat instance ONLY, without any local configurations.
Many thanks!
Tomcat Application server is used as a Provided dependency to get code completion and compilation of your code that utilizes JSPs and Servlets.
Remote debug configuration needs Tomcat Application server to know the target server version and uses local server libraries to perform connection and deployment.
So, yes, it's mandatory to have a local copy installed to use Tomcat Remote debug configuration.
If you are going to debug only plain Java code without JPS, use the plain Remote debug configuration like for normal applications, it doesn't require local application server installation.

Exception starting Worklight server on Tomcat

I move the application from dev to producation,change the application-description.xml and worklight.properties files and generate a .war file,and then i add it to the tomcat,but when I start tomcat,it occur the follow error:
java.lang.ClassNotFoundException: Class org.hsqldb.jdbcDriver not found in Worklight platform or project
but even I add the hsql.jar to my application,it still the error,any help?
my worklight version is 5.0.5 and apache-tomcat-7.0.37 and mysql is 5.1.57
HSQL is the default database used when running the Worklight project in Eclipse.
When you move to Tomcat, you also need to edit in worklight.properties the database-related properties.
Since you mentioned MySQL, you need to uncomment the MySQL section in worklight.properties and edit it according to your setup.
Of course, also undeploy and re-deploy the updated .war file.
Additions:
HSQL is a filesystem-driven database, and is provided by Worklight to work out-of-the-box, when running in Eclipse.
When moving to Tomcat and installing Worklight in it, you must edit worklight.properties and set it up so that it will know how to talk with the datbase.
In your case, when using MySQL you must also include in Tomcat's \lib folder the MySQL connector/J file. You can get it from here: http://www.mysql.com/downloads/mirror.php?id=412178 (click on "No thanks, just start my download" at the bottom).
Note that in order to run Worklight on an Application Server (such as Tomcat, WebSphere or Liberty), you must use either the Consumer or Enterprise Edition of Worklight. This is required as otherwise you will not have the Worklight JEE .jar file as well as the SQL scripts to create the database tables. All of this is done via the IBM Installation Manager.
You cannot use Worklight on an Application Server using the Developer Edition.

Downloading application from weblogic server

I have requirement for testing a j2ee application which is deployed in a weblogic server.
I have to get the ear add my testclasses into that and depoly it back.
Since weblogic server takes so much memory , I want to run my testcases to run in another box , connect to the weblogic server and download the ear from there and modify and deploy it back.
I know that it is possible to remotely deploy application in weblogic.
But is it possible to download the application from weblogic ? using JMX ?
Thanks in advance.
Thanks
J
JMX is for the runtime configuration and management (Java Management Extensions). What you're looking for is much simpler - On the WebLogic console, go to the deployments and click on the application of interest.
Next, figure out what the path of the deployed application is and then manually copy (scp if you're in UNIX) the ear file over to your local directory.
If you don't have access to the hosting server then it's not possible to download the app.