5 Replies Latest reply: Apr 2, 2012 1:09 PM by Jesse Booth RSS

    Invalid Plugin Class

    ShawnPConroy

      After using "mvn package" to package up my code and then upload the JAR file in the admin console I get this error:

       

      Error uploading plugin: Invalid plugin class defined in plugin.xml: HelloCDAWidget

       

      HelloCDAWidget.java is the name of the java file with the class, which has in it:

       

      public class HelloCDAWidget extends BaseWidget {

       

      Is my plugin.xml supposed to be defined differently? Here is my plugin.xml file:

       

      <plugin xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:noNamespaceSchemaLocation="http://www.jivesoftware.com/schemas/clearspace/2_5/plugin.xsd">
          <name>Hello CDA</name>
          <description>Greets the user</description>
          <author></author>
          <version>1.0.0</version>
          <minServerVersion>5.0.1</minServerVersion>
          <maxServerVersion>5.0.1</maxServerVersion>
          
        <!-- you will want to change your class name here! -->
          <class>HelloCDAWidget</class>
      
      
        <!-- 
          <authorURL>
          <pluginURL>
          <databaseKey>
          <databaseVersion>
          <components>
          <css>
          <soy>
          <javascript>
          <widget>
          <macro>
          <urlmapping>
          <sitemesh>
        -->
      
      
      </plugin>
      
      
      
      
      -->
      
      
      
      
      
      </plugin>
      
      
      
        • Re: Invalid Plugin Class
          ShawnPConroy

          That was a copy & paste error. The last two lines can be ignored (30 & 31).

            • Re: Invalid Plugin Class
              Mandar Tuljapurkar

              Hi Shawn,

                   Is the class HelloCDAWidget in a default package? If not, I believe adding the complete package might help:

              <class>com.abc.def.HelloCDAWidget</class>

              Regards,

              Mandar

                • Re: Invalid Plugin Class
                  ShawnPConroy

                  Thank Mandar. That raises two questions. It's a small project with only one class and only one Java file in the entire project. I've not defined any package in my code. I used:

                  mvn archetype:create -e -DarchetypeGroupId=com.jivesoftware.maven -DarchetypeArtifactId=maven-jive-archetype -DarchetypeVersion=5.0.x-SNAPSHOT -DgroupId=com.jivesoftware.adl-canada -DartifactId=helloCDA

                  To create the project. Would that imply I should use com.jivesoftware.adl-canada.helloCDA ? I noticed that I didn't use "helloCDAWidget" and I wonder if that might be part of the problem. Would the fact that the DartifactId is different than the actual class cause that problem?