Author Topic: queer attitude of button -> java.lang.Exception when button is clicked  (Read 15186 times)

albe

  • Customer
  • Newbie
  • *
  • Posts: 38
    • View Profile
Hi AjaxSwing Guys,

Some of my JButtonīs donīt work correctly at all times.
In AjaxSwing 3.0.0.final they do work but now I changed to Ajaxswing 3.1.0RC1 and now they donīt work every time.
When they donīt work, an Exception where thrown:
...
at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:983)
   at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:978)
   at java.lang.Thread.dispatchUncaughtException(Thread.java:1778)

A little bit queer is, that one button in a view donīt work but the button next to him in the same View does work.

Do you have any advices?

Best regards,
albe


Support Team

  • Administrator
  • Hero Member
  • *****
  • Posts: 1074
    • View Profile
Can you attach full log file please.

albe

  • Customer
  • Newbie
  • *
  • Posts: 38
    • View Profile
Hi,

The problem is still there. Which log files do you need. The StackTrace I've postet before, was nearly complete I only deletet one log command from my programm. But this command just write out the information to a file.

Maybe a cutout of the AjaxSwing logfile brings further information.
After this failure occurs, I think AjaxSwing does many action in backround, because the logfile keeps growing without user operation.

Thanks for your help,
albe


Dev Team

  • Customer
  • Hero Member
  • *
  • Posts: 593
    • View Profile
No exceptions are present in attached log file.

From your first message it's not clear what exception are you getting, stack trace is showing that there was exception, but it's showing not a place where it happened, but place where it was caught in java.lang.ThreadGroup. Exception class and message is not present.

albe

  • Customer
  • Newbie
  • *
  • Posts: 38
    • View Profile

I`m sorry but at the time I havent found out where the exception where thrown.
When I have found out the cause I will inform you.

Thanks for your help.


Regards,
albe

albe

  • Customer
  • Newbie
  • *
  • Posts: 38
    • View Profile
I just find this Exception in my logFile.
java.lang.Exception: com/creamtec/ajaxswing/TemporaryFileRemover
   at mycompany.ac.error.aErrorHandler.makeTracable(aErrorHandler.java:29)
   at mycompany.ac.error.fErrorHandler.log(fErrorHandler.java:106)
   at mycompany.ac.error.myProjectErrorHandler.log(myProjectErrorHandler.java:32)
   at ig.igUncaughtExceptionHandler.uncaughtException(igUncaughtExceptionHandler.java:45)
   at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:983)
   at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:978)
   at java.lang.Thread.dispatchUncaughtException(Thread.java:1787)

Maybe it is relatet with the TemporaryFileRemover?
Can you send me the src of this class?

Regards,
albe

Dev Team

  • Customer
  • Hero Member
  • *
  • Posts: 593
    • View Profile
I don't think it's related to button not working.

Do you have any exceptions in .out file? You should add try{}catch{ex.printStackTrace()} to your button action listener, this should add real exception to your .out file, if no exception is thrown in action listener - connect with remote debugger and see why action is not executed correctly, to connect with remote debug:
1) Change default.properties and your application.properties and set router.inProcess=true
2) Change setEnv.bat and add line:
set JAVA_OPTS=%JAVA_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
3) Start server, go to button screen, connect with debugger (for example eclipse > debug > remote application) and set breakpoint in action listener.

albe

  • Customer
  • Newbie
  • *
  • Posts: 38
    • View Profile

Hi AjaySwing Guys,
first of all thanks for your help. Your supportteam is great.
In my .out files there are now exceptions.

I just find out that this exception is also thrown under AjaxSwing 3.0.0final.
But there my application runs along.
So I do not think that this is only related to a button. (Maybe implied attitude?)
 
I will test RemoteDebugging now.

Thanks for your help
Regards,
albe

albe

  • Customer
  • Newbie
  • *
  • Posts: 38
    • View Profile
Ok I have some new infos.
Iīve changed my loggin strategy, so now I have a full stacktrace.

java.lang.NullPointerException
   at com.creamtec.ajaxswing.core.NameUtils.getComponentName(NameUtils.java:165)
   at com.creamtec.ajaxswing.gui.AjaxSwingRepaintManager.addInvalidComponent(AjaxSwingRepaintManager.java:39)
   at javax.swing.JComponent.revalidate(JComponent.java:4583)
   at javax.swing.JComponent$2.run(JComponent.java:4588)
   at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
   at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

java.lang.NullPointerException
   at com.creamtec.ajaxswing.gui.peer.AjaxSwingWindowPeer.show(AjaxSwingWindowPeer.java:57)
   at com.creamtec.ajaxswing.gui.peer.AjaxSwingDialogPeer.show(AjaxSwingDialogPeer.java:44)
   at java.awt.Dialog.conditionalShow(Dialog.java:461)
   at java.awt.Dialog.show(Dialog.java:526)
   at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:843)
   at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:645)
   at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:616)
   at gg.swing.MessageDialog.<init>(MessageDialog.java:30)
   at gg.swing.arf.message(arf.java:165)
   at gg.swing. GSe.message(GSe.java:148)
   at gg.GUncaughtExceptionHandler.displayErrorMessage(GUncaughtExceptionHandler.java:111)
   at gg.GUncaughtExceptionHandler.uncaughtException(GUncaughtExceptionHandler.java:48)
   at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:983)
   at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:978)
   at java.lang.Thread.dispatchUncaughtException(Thread.java:1778)

I hope they help.

Best regards,
albe

Dev Team

  • Customer
  • Hero Member
  • *
  • Posts: 593
    • View Profile
What log level are you using in TraceMgr.properties? Check if you have:
WARNING: Failed to find current instance of client agent
In your log file.

Both exception are showing NullPointer at same step, it's first time they access ClientAgent.

You should try adding "ClientAgentManager.setMyAgent(myNewThread, ClientAgent.getCurrentInstance())"  before you make a call to "myNewThread.start()".

albe

  • Customer
  • Newbie
  • *
  • Posts: 38
    • View Profile

I use log level 10 in my TraceMgr.properties but I do not find "WARNING: Failed to find current instance of client agent" in log file.

I do not think that one of my threads creates the exception.
t.getName == AWT-Shutdown
t.getThreadGroup == com.creamtec.ajaxswing.core.AjaxSwingThreadGroup[name=AjaxSwingThreadGroup2,maxpri=10]

I also found a "java.lang.ThreadDeath" exception in front of the Nullpointer.

Any ideas?


2010/07/21 13:40:53:763 : Thread-7 : [com.creamtec.ajaxswing.ClientAgentImpl$ClientAgentDelegate] Main finished
2010/07/21 13:40:53:763 : Thread-7 : [com.creamtec.ajaxswing.core.AjaxSwingAgentRequestFilter] postEmulateAction
2010/07/21 13:40:53:826 : AWT-Shutdown : [com.creamtec.ajaxswing.gui.peer.AjaxSwingDialogPeer] setBounds
2010/07/21 13:40:53:826 : AWT-Shutdown : [com.creamtec.ajaxswing.gui.AjaxSwingToolkit15] getScreenWidth returning 800
2010/07/21 13:40:53:826 : AWT-Shutdown : [com.creamtec.ajaxswing.gui.AjaxSwingToolkit15] getScreenHieght returning 600
2010/07/21 13:40:53:826 : AWT-Shutdown : [com.creamtec.ajaxswing.gui.peer.AjaxSwingDialogPeer] setBounds
2010/07/21 13:40:53:826 : AWT-Shutdown : [com.creamtec.ajaxswing.gui.peer.AjaxSwingDialogPeer] show, t = Thread[AWT-Shutdown,5,AjaxSwingThreadGroup2]
2010/07/21 13:40:53:826 : AWT-Shutdown : [com.creamtec.ajaxswing.gui.peer.AjaxSwingDialogPeer] show
Fehler ---
AWT-Shutdown com.creamtec.ajaxswing.core.AjaxSwingThreadGroup[name=AjaxSwingThreadGroup2,maxpri=10]
java.lang.ThreadDeath
   at java.lang.Thread.stop(Thread.java:698)
   at java.lang.ThreadGroup.stopOrSuspend(ThreadGroup.java:671)
   at java.lang.ThreadGroup.stop(ThreadGroup.java:584)
   at com.creamtec.ajaxswing.core.AjaxSwingThreadGroup.shutdown(AjaxSwingThreadGroup.java:106)
   at com.creamtec.ajaxswing.core.ClientAgent.doShutdown(ClientAgent.java:358)
   at com.creamtec.ajaxswing.core.ClientAgent$1.run(ClientAgent.java:311)
   at java.lang.Thread.run(Thread.java:595)
java.lang.NullPointerException
   at com.creamtec.ajaxswing.gui.peer.AjaxSwingWindowPeer.show(AjaxSwingWindowPeer.java:57)
   at com.creamtec.ajaxswing.gui.peer.AjaxSwingDialogPeer.show(AjaxSwingDialogPeer.java:44)
   at java.awt.Dialog.conditionalShow(Dialog.java:461)
   at java.awt.Dialog.show(Dialog.java:526)
   at javax.swing.JOptionPane.showOptionDialog(JOptionPane.java:843)
   at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:645)
   at javax.swing.JOptionPane.showMessageDialog(JOptionPane.java:616)
   at gg.swing.MessageDialog.<init>(MessageDialog.java:30)
   at gg.swing.ARF.message(ARF.java:165)
   at gg.swing.GUIS.message(GUIS.java:148)
   at gg.GUncaughtExceptionHandler.displayErrorMessage(GUncaughtExceptionHandler.java:113)
   at gg.GUncaughtExceptionHandler.uncaughtException(GUncaughtExceptionHandler.java:48)
   at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:983)
   at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:978)
   at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:978)
   at java.lang.Thread.dispatchUncaughtException(Thread.java:1778)

Dev Team

  • Customer
  • Hero Member
  • *
  • Posts: 593
    • View Profile
Ok, so both exceptions from your previous post were happening because ClientAgent was null.

And now we know why it's null,
Quote
at com.creamtec.ajaxswing.core.ClientAgent.doShutdown(ClientAgent.java:358)
That means that ClientAgent shutdown was called.

Do you get this in log file when you press some button in your application? Or it happend right after application start?

And you're saying it was working fine on 3.0 final?

albe

  • Customer
  • Newbie
  • *
  • Posts: 38
    • View Profile
Ok, it isntīt so simple to reproduce the problem but now Iīve seen, when the problem occurs first.

1. Application start -> login -> logout Application close
2. Application start -> login -> logout Application close
..
X. Application start -> login -> logout Application close
X+1. Application start -> Error occurs

Iīm realy sorry but I think so it isnīt realy related to the button klick but so I mentioned that the error was happend when the button dont work.

I just find out that this exception is also thrown under AjaxSwing 3.0.0final.
But there my application runs along.
So I do not think that this is only related to a button. (Maybe implied attitude?)

So what do I have to do now?

Thanks for help
albe


Dev Team

  • Customer
  • Hero Member
  • *
  • Posts: 593
    • View Profile
If ClientAgent was closed (shutdown), you won't be able to work with application anymore, not only button cliks won't work, but you won't be able to do any server side actions, is that what you have?

Are you using close application > start application in same browser? So you have only 1 application instance running at a time? Are you waiting for "application is closed, click refresh to start new one" and using refresh button to start new one, or you click logout and open new tab right after that? Do you have any delay between close and start?

Usually at what run(X) you have this problem?

How much application do you have configured per JVM?

albe

  • Customer
  • Newbie
  • *
  • Posts: 38
    • View Profile
I think I now where the problem is comming from.

In my application.properties I have got the following configuration:

router.retireJVMAfterClients=4
router.inProcess=false
router.clientsPerJVM=4

When I change one of the JVM paramters it works and I do not get the exception.
When I change both parameter for example .retireJVMAfterClients=2 and clientsPerJVM=2
I can reproduce the problem after two restarts of the application.

Do you think my that the problem goes together with this paramters?
Or is it only a side effect, and the problem occurs at an other point?

Regards,
albe