Topic
4 replies Latest Post - ‏2008-05-01T19:27:58Z by SystemAdmin
SystemAdmin
SystemAdmin
84 Posts
ACCEPTED ANSWER

Pinned topic No target class specifice...

‏2008-04-28T22:33:17Z |
So I ran my unit tests. I selected the KingProperties.unit and pointed to it. When I attempt the javaagent-based instrumentation I get the following log messages:
ConTest: ConTest for Java, version: 3.0.0.2
ConTest: build: Mon Mar 03 17:55:16 CST 2008
ConTest: (c) Copyright IBM Corporation (1999, 2008), ALL RIGHTS RESERVED.
ConTest: id for this run is: 1209421609190
ConTest: properties file specified as JVM property: /Users/schuchert/workspaces/ObjectMentorConcurrency/07_InitialDeadlock/src/King Properties.unit
ConTest: Found properties file: /Users/schuchert/workspaces/ObjectMentorConcurrency/07_InitialDeadlock/src/King Properties.unit
ConTest: setting heuristic properties randomly
ConTest: Using existing ConTest output directory: [/Users/schuchert/workspaces/ObjectMentorConcurrency/07_InitialDeadlock/com_ibm _contest]
ConTest: shared vars file copied to: /Users/schuchert/workspaces/ObjectMentorConcurrency/07_InitialDeadlock/./com_ib m_contest/sharedVars.txt_1209421609190
ConTest: properties recorded to ./com_ibm_contest/KingProperties_1209421609190
ConTest: using seed: -5215220960603014524
ConTest: No begin-at policy, making noise from the start
ConTest: coverage buffer size: 1024
ConTest: basic block coverage is on
ConTest: attributes description file was created
ConTest: method coverage is off
ConTest: lock history tracing is off
ConTest: lock discipline tracing is on
ConTest: synchronization coverage is on
ConTest: attributes description file was created
ConTest: locks info is being collected
ConTest: concurrent event pairs coverage is off
ConTest: thread locator is enabled
ConTest: Orange-box is turned on, forgetting mode, size is 2
ConTest: noise frequency (promil) is set to 500
ConTest: noise type is synchYields
ConTest: noise unit strength is 1
ConTest: halt-one-thread heuristic is off
ConTest: shared-variables coverage is off
ConTest: shared-variables heuristic is off
ConTest: tampering with timeouts
ConTest: datagram socket fault injection is initialized. Mode is: random-conservative, direction is: both, frequency (promil) is: 100, datagram length bound is: 10000
ConTest: no keyboard callback thread
ConTest: no port callback thread
ConTest: listeners directory not found
ConTest: Scanned source dir ., found 5 source files
! ConTest: system error: aborting ConTest:
! ConTest: system error: following exception was thrown:
java.lang.IllegalArgumentException: no target class specified
at com.ibm.contest.instrumentation.InstrumentationAction.<init>(Instrumentat ionAction.java:202)
at com.ibm.contest.instrumentation.classload_inst.Premain.premain(Premain.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(InstrumentationImpl.j ava:323)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(InstrumentationImpl. java:338)

targetClasses is set to * (and note that I just used the default file).

I get the same results using KingProperties.system.

Any suggestions?

Brett
Updated on 2008-05-01T19:27:58Z at 2008-05-01T19:27:58Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    84 Posts
    ACCEPTED ANSWER

    Re: No target class specifice...

    ‏2008-04-30T05:39:09Z  in response to SystemAdmin
    To use the classload instrumentation, ConTest requires you to set the targetClasses preference to non-default something (this is stated in the main readme page, item 1 of Instructions; I realize this is a caveat to old users).

    Since you actually had the privilege of being the first to come out with a ConTest with classload instrumentation, I'm interested to discuss this design choice with you. At first I did it just as a way to preclude attempt to instrument java core classes (which is something ConTest should definitely not do lightheartedly), as well as ConTest's own classes. While we can automatically identify core classes and preclude the attempt, there could often be other classes that belong to the "environment" (ConTest extensions; other tools; Eclipse classes; ...) and which it would be harmful to instrument.

    More deeply, choosing which classes to target is an important step, and I think it's wise to force the user to give it at least a couple of seconds' thought. I've added a new README page - one of the first ones linked from the main one - dedicated to choosing target classes.

    Any thoughts on this?
    • SystemAdmin
      SystemAdmin
      84 Posts
      ACCEPTED ANSWER

      Re: No target class specifice...

      ‏2008-05-01T13:48:18Z  in response to SystemAdmin
      I really did read the main page and I though I was setting the target class...

      I am not sure about whether to require it or not, I'm neutral. So requiring it be specified is OK with me. I think in my default implementation I don't even allow the java.* stuff to be instrumented, I do some basic pattern matching and skip over those classes.

      So maybe by default it does everything except java* (covering java.* and javax.*). You can optionally turn those on if you want to suffer. You can also optionally specify an additional filter.

      In any case, I though by providing the KingProperties file with a targetClasses = * I was setting the one required property. If I did not provide a KingProperties file, then I got an error, so I'm pretty sure the KingProperties file was found. Is that not the way to set that property?

      I even tried using -D but that did not work either.

      Guidance?

      Thanks!
      • SystemAdmin
        SystemAdmin
        84 Posts
        ACCEPTED ANSWER

        Re: No target class specifice...

        ‏2008-05-01T13:55:42Z  in response to SystemAdmin
        OK, figured it out...

        I was reading the error as the property had to be set and it was set to *. It had a value.

        But the real error is that it must be something other than . When I set its value to com.om, it worked fine.

        Brett