Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: INS: Troubleshooting

...

  1. In the Package Explorer find the Main class, which should be located in: servicemix-core/src/main/java/
    under org.apache.servicemix/Main.java.
    Double click on the main() method. 


     
  2. From the Run menu select "Run..." 


     
  3. You will get a Run window pop-up, from there select Java Application.
    1. Click on New button in botton left (Eclipse <3.2) or the icon in the top left (Eclipse v3.2)
    2. Name the Project: any name you like, for example if you want to run the FilePoller / FileBinding application call it "filepoller", so it's easy for you to remember what this run configuration does.
    3. Click on "Arguments" tab:
      1. In the "Program Arguments" box enter servicemix.xml
      2. In the Working Directory enter the path of your example. Such as
        S:\apache-servicemix\src\main\release\examples\file-binding
        where S:\ is assumed as your servicemix root directory.
        You can use the "File System..." button to browse for your directory.
         

         
    4. Click on the tab "Classpath" to give Eclipse needed information on where to search for executable files. This description sticks to the file-binding example, but a similar procedure will be needed for most examples and your own code as well. There are three main ways to add classes to the classpath:
      1. You can add other projects of the workbench. Doing this will make the file-binding example run.
        1. Click "User Entries"
        2. Click "Add Projects" and click the checkbox(es) in front of the project(s) that are required. For convenience reasons you may click "Select All".
           

           
        3. Click "OK". Now your Run-dialog shall look similar to this screenshot:
           

           
      2. You can add JARs and classes that are stored within a classpath environment variable. This is not required for the file-binding example, but possible, e.g. if you want to run a specific ServiceMix version from a JAR for bug reproduction or the like - this case is used for the following description. Often, this way is used to reference depenedencies Maven downloads automatically for you.
        1. Click "User Entries"
        2. Click "Advanced", "Add Classpath Variables" and "OK"
           

           
        3. Check M2_REPRO and click "Extend"
           

           
        4. Choose the JAR containing the bytecode for the missing classes. If you want to run SOME_VERSION of ServiceMix, choose /org/apache/servicemix/servicemix-core/SOME_VERSION/servicemix-core-SOME_VERSION.jar
           
          In case you want to reference a dependency, proceed in the same way. In case you do not know which package you shall select, see below.
           

           
        5. Click "OK"
      3. You can add arbitrary folders to the classpath. This is usually only needed for your own code. To explain the workflow, let's assume you did not add any projects, thus your file-binding example does not run and the console window contains this message:
        No Format
        Error 'Bean class [org.apache.servicemix.components.file.FileWriter] not found'
        
        1. Click "User Entries"
        2. Click "Advanced", "Add External Folder" and "OK"
           

           
        3. When S:\ is your servicemix root directory, select/enter
          S:\servicemix-components\target\classes
           
          Why this directory? Well, have a closer look at the error message presented above. The package org.apache.servicemix.components indicates the location of the missing bean FileWriter is servicemix-components, and as we need an executable file, the target\classes subdirectory is where to look. Of course we shall proof that FileWriter really is located here, so execute dir /s FileWriter.class in the given directory and watch the output.
           

           
        4. Click "OK".
  4. Click Apply.
  5. Click Run.

TODO

Troubleshooting

One or two lines of error messages

In case you see an error message likeerror message 

No Format
java.lang.NoClassDefFoundError: org/apache/servicemix/Main

in the console window, the ServiceMix class (or xbean or whatever is stated) file is not found. execute. Did you add the class files to the classpath like stated above (see "Add Projects")? In case you did, there may not exist any class files as they were not yet built. You can do that by executing

No Format
mvn install

to get a build 

No Format

Error 'Bean class [org.apache.servicemix.components.file.FileWriter] not found'

Why this directory? Well, have a closer look at the error message presented above. The package org.apache.servicemix.components indicates the location of the missing bean FileWriter is servicemix-components, and as we need an executable file, the target\classes subdirectory is where to look. Of course we shall proof that FileWriter really is located here, so execute dir /s FileWriter.class in the given directory and watch the output.

in the source's root directory. This will take roughly 10 to 15 minutes. Maybe you prefer to reference a binary distribution (see "Add Classpath Variables" above).

Lengthy error messages (stack trace)

Scan the messages in the console window When you run the example, Eclipse will show in the Console window error messages like "Error creating bean with name", "java.lang.NoClassDefFoundError" or similar. Scan the messages from top to bottom until you find the one stating a missing component, indicated by a package name - in case it's a "java.lang.NoClassDefFoundError" or "java.lang.ClassNotFoundException", the missing class is printed directly after that error string.First extract the package name (eg: ", whereas for instance "Error creating bean with name" is demanding slightly more search.

Messages may look like one of the following

No Format

Error 'Bean class [org.apache.servicemix.components.file.FileWriter] not found'

or 

No Format

java.lang.ClassNotFoundException: org.quartz.SimpleTrigger

...


First extract the package name from the error message, so org.apache.servicemix.components respectivly org.quartz for the above examples.

Now, you have to choose the appropriate procedure:

  • Build the class / project. See "One or two lines of error messages" above.
  • Add the required library to the classpath like stated above for "Add Classpath Variables". Look in the Maven repository for a folder matching the missing package

...

  • . Sometimes the top level domain (org, com, de and the like) is omitted, so package org.quartz may be placed in folder quartz

...

  • . Then choose a JAR containing executable bytecode classes

...

  • , so not the quartz-1.5.1-sources.jar but quartz-1.5.1.jar
  • Add the required library to the classpath like stated above for "Add External Folder". The package indicates the location of the missing bean FileWriter is servicemix-components, and as we need an executable file, the target\classes subdirectory is where to look. Of course we shall proof that FileWriter really is located here, so execute dir /s FileWriter.class in the given directory and watch the output.

Redo this until no class/) within the folder. Redo this procedure until no JAR is missing any more.

TODO
 

...

Configuring Eclipse

Updating Eclipse from Trunk

...