Error when connecting JProfiler to JBoss 4 - java

I want to profile a Java EE application runs on JBoss 4. I use Ubuntu . Java 1.5. JProfiler 8.0.1. Server is Jboss 4. Once I set the host as localhost and try to profile,(New Session -> Attach -> Attach to profile JVM(Local or remote) ) JProfiler says, "Could not connect to localhost:8849. Please make sure that the remote address is correct ". But in the terminal, it shows the JBoss starting and I can access the web applications as well. I want to trace all creating java Ojbects and their sizes. How can I solve this issue ?
EDIT: The error log file of JProfiler shows.
sun.awt.X11.XException: Cannot write XdndAware property
at sun.awt.X11.XDnDDropTargetProtocol.registerDropTarget(Unknown Source)
at sun.awt.X11.XDropTargetRegistry.registerDropSite(Unknown Source)
at sun.awt.X11.XWindowPeer.addDropTarget(Unknown Source)
at sun.awt.X11.XComponentPeer.addDropTarget(Unknown Source)
at java.awt.dnd.DropTarget.addNotify(Unknown Source)
at java.awt.Component.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addImpl(Unknown Source)
at java.awt.Container.add(Unknown Source)
at com.ejt.framework.gui.aq.b(ejt:290)
at com.ejt.framework.wizard.o.b(ejt:43)
at com.ejt.framework.wizard.o.<init>(ejt:18)
at com.ejt.framework.wizard.g.b(ejt:125)
at com.jprofiler.frontend.d.a.p.actionPerformed(ejt:29)
at com.jprofiler.frontend.g.g.l(ejt:63)
at com.jprofiler.frontend.g.g.a(ejt:17)
at com.jprofiler.frontend.g.h.run(ejt:56)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

Probably JBoss is not profiled, i.e. the profiling agent is not loaded.
You have to use the integration wizard to modify the JBoss start script.
Invoke
Session->Integration wizards->New Server Integration
select JBoss 4.x and follow the steps in the wizard.

Related

How can I config RTXCommon.jar

I have a java program and I want to use RTXCommon.jar So if I try to use it, I have this error
java.lang.UnsatisfiedLinkError: no rxtxSerial in java.library.path thrown while
loading gnu.io.RXTXCommDriver
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no rxtxSe
rial in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at gnu.io.CommPortIdentifier.<clinit>(CommPortIdentifier.java:123)
at com.mcsolution.easyMgmt.panel.utility.panelProgramma.inizializzaLabel
Text(panelProgramma.java:877)
at com.mcsolution.easyMgmt.panel.utility.panelUtility.creaSwing(panelUti
lity.java:36)
at com.mcsolution.esp.TestaFrameSalagiochi$MenuLookDemo22$1.actionPerfor
med(TestaFrameSalagiochi.java:118)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.AbstractButton.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown
Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$400(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Sour
ce)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Then I have right click on project, java build path, then I have find RTXCommon.jar, select Native Library Path, edit, then I have select the folder C:\SWInstall\dll
In this folder, I have copy rtxSerial.dll rtxParallel.dll. Then I have run the project and works. But if I try to generate jar file then run it, I have the same error.
How can I fixed it?
regards
One of the most important things to check that you didn't mention is to verify if you're using a 32bits or 64bits of the RTXCommon.jar, if you are using java 82 Bits you should use RTXCommon.jar 32bits.
Then you have to check if the RTXCommon.jar points to the right location of the native libraries, for that, under eclipse, right click on your project and choose properties then select java build path, in the dialog box click on the little arrow before RTXCommon.jar. Double click on Native library location and enter the path to your DLLs.
If you are willing to run your app on different machines remember to store your DLLs in a common folder (under program files for exemple for windows) that way you can prevent such bug from occurring to other users. Same thing for other operating systems.

What's the difference between running the application from netbeans and running the jar?

I have a java application that works perfectly when running from Netbeans 7.1 but it crashes if I use the build jar.
I've been investigating the problem and I've noticed that the application holds on calling DriverManager.getConnection().
I'm doing something like:
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
Connection con = DriverManager.getConnection("jdbc:sqlserver://127.0.0.1:2304;user=username;password=12345;database=databasename");
I've also tried jtds but it has the same result.
I'm running on Windows 7 Home Premium
SQL Server 2008 (localhost)
Netbeans 7.1 (application works fine when running from Netbeans)
Java Version 1.6
Thread dump
java.lang.Exception: Stack trace
at java.lang.Thread.dumpStack(Unknown Source)
at joomlasyncrnzr.JoomlaSyncrnzrApp.getCon(JoomlaSyncrnzrApp.java:314)
at joomlasyncrnzr.JoomlaSyncrnzrApp.taxas(JoomlaSyncrnzrApp.java:604)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jdesktop.application.ApplicationAction.noProxyActionPerformed(Ap
licationAction.java:662)
at org.jdesktop.application.ApplicationAction.actionPerformed(ApplicatinAction.java:698)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
What could be causing this?
I had the same problem with the DriverManager.getConnection call just hanging indefinitely.
What solved the problem for me was going back to Java 6 Update 25. Update 29 seems to introduce a bug with the JDBC connection to SQL Server. I think Update 27 (or earlier) still work fine.
Maybe you're not setting your CLASSPATH to include the SQL Server driver when running the jar file, whereas Netbeans probably has it included for you already.

Jar file cannot find the com.mysql.jdbc driver

I am trying to make a application in java which connects to a mysql database. For this purpose I downloaded the mysql-connector-java-5.1.16-bin.jar connector.
I also added the path of the above jar file in the CLASSPATH environment variable.
I created the application and executed the java files and it executed properly.
Then I created a jar file of the application and tried to execute it then i got the following error
java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at CanteenCounter.refresh(CanteenCounter.java:73)
at CanteenCounter$1.actionPerformed(CanteenCounter.java:30)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.awt.EventQueue$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Exception: com.mysql.jdbc.Driver
I think the jar file is not able to find the com.mysql.jdbc.Driver
Please help!!!
If your JAR file is an executable JAR file which you execute by using the -jar option, or by double-clicking it, then the CLASSPATH environment variable as well as the -cp or -classpath option will be ignored.
For executable JAR files, you must specify the classpath in the manifest file of the JAR.
See this page from Oracle's Java Tutorials for more details on specifying the classpath in the manifest file: Working with Manifest Files.
Generally you do not want to use the CLASSPATH variable but rather the -cp flag to specify library location.
java -cp /path/to/jar:/path/to/other/jar Main

PersistenceException with Umlaut in path

I experienced an odd behavior with a java desktop application that uses Toplink essentials as persistence provider.
I have a single directory containing all I need for my application: a jar, a lib folder and a JavaDB database. The whole directory is self-contained (I copied it several times without problems, even between different computers).
Today I wanted to copy once more, but my target folder contained a german Umlaut ü (html: ü).
Starting my application failed, with an exception that made it hard to find the reason why (see below).
Of course I know the old naming conventions, but I thought we already left that behind. So my question is, if there is a way to make it run independent of directory naming. It's important since I want to give the application to clients and have only little influence on install dirs.
System: Windows 7, JavaDB 10.5.3
Thanks in advance for your help!
SCHWERWIEGEND: Application class jlabps.JLabPSApp failed to launch
javax.persistence.PersistenceException: No Persistence provider for EntityManage
r named JLAPS_EMB: The following providers:
oracle.toplink.essentials.PersistenceProvider
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider
Returned null to createEntityManagerFactory.
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.
java:154)
at jlabps.JLabPSView.initComponents(JLabPSView.java:401)
at jlabps.JLabPSView.<init>(JLabPSView.java:47)
at jlabps.JLabPSApp.startup(JLabPSApp.java:71)
at org.jdesktop.application.Application$1.run(Application.java:171)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown
Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.lang.Error: Application class jlabps
.JLabPSApp failed to launch
at org.jdesktop.application.Application$1.run(Application.java:177)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$000(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.awt.EventQueue$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(Unknown
Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: javax.persistence.PersistenceException: No Persistence provider for E
ntityManager named JLAPS_EMB: The following providers:
oracle.toplink.essentials.PersistenceProvider
oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider
Returned null to createEntityManagerFactory.
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.
java:154)
at jlabps.JLabPSView.initComponents(JLabPSView.java:401)
at jlabps.JLabPSView.<init>(JLabPSView.java:47)
at jlabps.JLabPSApp.startup(JLabPSApp.java:71)
at org.jdesktop.application.Application$1.run(Application.java:171)
... 14 more
Odd. What JVM are you using?
Ensure you have the latest TopLink Essentials patch, I remember an issue with spaces, but not Umlats.
You could also try upgrading to EclipseLink and see if the same issue occurs, if it does please log a bug.

AccessControlException in Applet

This applet runs fine in eclipse viewer. I cannot run it from any browser. How can I resolve this issue? I get this error from my java applet console:
Exception in thread "AWT-EventQueue-2" java.security.AccessControlException: access denied (java.awt.AWTPermission watchMousePointer)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.awt.MouseInfo.getPointerInfo(Unknown Source)
at nopulse.update(nopulse.java:448)
at nopulse.paint(nopulse.java:316)
at sun.awt.RepaintArea.paintComponent(Unknown Source)
at sun.awt.RepaintArea.paint(Unknown Source)
at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Applets running in a browser use a Security Manager. There are many things that applets in a browser are not allowed to do. If you insist that your applets do these things, deploy your applet as a signed applet
Edit your policy files accordingly. See this on how to do it.

Categories