Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-dev] plugin developement marker and extern lib prolblems

Hi all,

i develop a plugin for eclipse to analyse php code. I want to put warnings.

I develop a first jar (to use it as a batch), and an plugin. In plugin, i import this jar. The jar works in standalone. When i import it, the compile finish without any error, but when i debug it (as runtime-workbench), i have a NoClassDefFoundError. I import the source in the plugin project, and no error.
Is an error of classpath ? A special thing to do ?

My second problem is when i had a marker, i had a "java.lang.NullPointerException". When i debug "step by step", all marker is created, it seems to be at the end of the doBuild method.

Can you help me ?

Thanks

Régis




----------------------------------------------------
my code for create a marker :


[phpBeauMarker.MARKER_ID is attribut of a class = "phpBeauMarker"]

IMarker marker =  ((IResource)ress).createMarker(phpBeauMarker.MARKER_ID);
String[] attNames = {IMarker.MESSAGE, IMarker.SEVERITY, IMarker.LINE_NUMBER };
Object[] attValues = {msg, new Integer(1), new Integer(line)};
marker.setAttributes(attNames, attValues);

----------------------------------------------------
my plugin.xml :


<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin
  id="phpBeau"
  name="PhpBeau Plug-in"
  version="0.0.1"
  provider-name="com.ca-sits"
  class="phpBeau.PhpBeauPlugin">

  <runtime>
     <library name="phpBeau.jar">
        <export name="*"/>
     </library>
  </runtime>
  <requires>
     <import plugin="org.eclipse.core.resources"/>
     <import plugin="org.eclipse.ui"/>
     <import plugin="org.eclipse.core.runtime.compatibility"/>
     <import plugin="org.eclipse.jdt.core"/>
     <import plugin="org.apache.xerces"/>
     <import plugin="org.eclipse.jface.text"/>
     <import plugin="org.eclipse.compare"/>
  </requires>


  <extension
        point="org.eclipse.ui.views">
     <category
           name="PHP"
           id="phpBeau">
     </category>
     <view
           name="phpBeau View"
           icon="icons/sample.gif"
           category="phpBeau"
           class="phpBeau.views.phpBeauView"
           id="phpBeau.views.phpBeauView">
     </view>
  </extension>
  <extension
        point="org.eclipse.ui.perspectiveExtensions">
     <perspectiveExtension
           targetID="org.eclipse.ui.resourcePerspective">
        <view
              ratio="0.5"
              relative="org.eclipse.ui.views.TaskList"
              id="phpBeau.views.phpBeauView"
              relationship="right">
        </view>
     </perspectiveExtension>
  </extension>
  <extension
        point="org.eclipse.ui.popupMenus">
     <objectContribution
           objectClass="org.eclipse.core.resources.IResource"
           adaptable="true"
           id="cbrResourceContribution">
        <menu
              label="PHP"
              path="additions"
              id="pbMenu">
           <separator
                 name="group1">
           </separator>
        </menu>
     </objectContribution>
     <objectContribution
           objectClass="org.eclipse.core.resources.IProject"
           adaptable="true"
           id="cbrProjectContribution">
     </objectContribution>
  </extension>
  <extension
        id="phpBeauBuilder"
        name="phpBeauBuilder"
        point="org.eclipse.core.resources.builders">
     <builder>
        <run
              class="phpBeau.phpBeauBuilder">
        </run>
     </builder>
  </extension>
  <extension
        id="phpBeauNature"
        name="phpBeauNature"
        point="org.eclipse.core.resources.natures">
     <runtime>
        <run
              class="phpBeau.phpBeauNature">
        </run>
     </runtime>
  </extension>
<extension
              id="phpBeauMarker"
              point="org.eclipse.core.resources.markers">
   <super
       type="org.eclipse.core.resources.problemmarker">
   </super>
     <persistent
           value="true">
     </persistent>
  </extension>
  <extension
        point="org.eclipse.ui.preferencePages">
     <page
           name="phpBeau Preferences"
           class="phpBeau.preferences.phpBeauPreferencePage"
           id="phpBeau.preferences.phpBeauPreferencePage">
     </page>
  </extension>

</plugin>

----------------------------------------------------
Log of runtime-workbench :

!SESSION Mar 31, 2004 22:25:25.838 ---------------------------------------------
java.version=1.4.2_04
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
!ENTRY org.eclipse.core.runtime 4 2 Mar 31, 2004 22:25:25.838
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.runtime".
!STACK 0
java.lang.NullPointerException
at org.eclipse.ui.texteditor.MarkerUtilities$MarkerTypeHierarchy.appendAll(MarkerUtilities.java:84) at org.eclipse.ui.texteditor.MarkerUtilities$MarkerTypeHierarchy.computeSuperTypes(MarkerUtilities.java:67) at org.eclipse.ui.texteditor.MarkerUtilities$MarkerTypeHierarchy.getSuperTypes(MarkerUtilities.java:59) at org.eclipse.ui.texteditor.MarkerUtilities.getSuperTypes(MarkerUtilities.java:397) at org.eclipse.ui.texteditor.AnnotationTypeLookup.getAnnotationType(AnnotationTypeLookup.java:88) at org.eclipse.ui.texteditor.AnnotationTypeLookup.getAnnotationType(AnnotationTypeLookup.java:71) at org.eclipse.ui.texteditor.MarkerAnnotation.<init>(MarkerAnnotation.java:121) at org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel.createMarkerAnnotation(AbstractMarkerAnnotationModel.java:151) at org.eclipse.ui.texteditor.AbstractMarkerAnnotationModel.addMarkerAnnotation(AbstractMarkerAnnotationModel.java:222) at org.eclipse.ui.texteditor.ResourceMarkerAnnotationModel.update(ResourceMarkerAnnotationModel.java:99) at org.eclipse.ui.texteditor.ResourceMarkerAnnotationModel$ResourceChangeListener.resourceChanged(ResourceMarkerAnnotationModel.java:53) at org.eclipse.core.internal.events.NotificationManager$2.run(NotificationManager.java:255) at org.eclipse.core.internal.runtime.InternalPlatform.run(InternalPlatform.java:610)
   at org.eclipse.core.runtime.Platform.run(Platform.java:521)
at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:248) at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:142) at org.eclipse.core.internal.resources.Workspace.broadcastChanges(Workspace.java:155) at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:854) at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144) at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:168)
   at org.eclipse.core.internal.jobs.Worker.run(Worker.java:62)




Back to the top