9 Replies Latest reply on Feb 11, 2015 12:07 PM by shreepads

    Jboss Tools JAX-RS issue in Eclipse

    shreepads

      Hi

       

      Am running Eclipse Luna (4.4.1) with the latest JBoss Tools (have checked updates and there are none).

      FYI this is on Fedora 21 with the standard openJDK from the repos and Wildfly 8.2.0.

       

      I have an existing Project when I try to enable the JAX-RS facets from the project properties I get the following error:

      "An internal error occurred during: "JAX-RS Metamodel build...". org/apache/lucene/analysis/standard/StandardAnalyzer"

       

      In the Eclipse .log file I see

      !ENTRY org.eclipse.core.jobs 4 2 2015-01-31 18:16:35.305

      !MESSAGE An internal error occurred during: "JAX-RS Metamodel build...".

      !STACK 0

      java.lang.NoClassDefFoundError: org/apache/lucene/analysis/standard/StandardAnalyzer

          at org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsMetamodel.<init>(JaxrsMetamodel.java:163)

          at org.jboss.tools.ws.jaxrs.core.internal.metamodel.domain.JaxrsMetamodel.create(JaxrsMetamodel.java:278)

          at org.jboss.tools.ws.jaxrs.core.metamodel.domain.JaxrsMetamodelLocator.get(JaxrsMetamodelLocator.java:116)

          at org.jboss.tools.ws.jaxrs.core.internal.metamodel.builder.ResourceChangedBuildJob.run(ResourceChangedBuildJob.java:68)

          at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

      Caused by: java.lang.ClassNotFoundException: org.apache.lucene.analysis.standard.StandardAnalyzer cannot be found by org.jboss.tools.ws.jaxrs.core_1.7.2.Final-v20150108-2329-B81

          at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:432)

          at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:345)

          at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:337)

          at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)

          at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

          ... 5 more

       

      I've looked in the ~/.eclipse/org.eclipse.platform_793567567_linux_gtk_x86_64/plugins directory and can see "org.apache.lucene.core_3.5.0.v20120725-1805.jar" in there. The manifest file in this JAR contains:

       

      Export-Package: org.apache.lucene;version="3.5.0",org.apache.lucene.an

      alysis;version="3.5.0",org.apache.lucene.analysis.standard;version="3

      .5.0",...

       

      So I'm not sure what's going on. I've even tried adding the above mentioned lucene JAR to Eclipse's bootpath but that hasn't helped either.

       

      Does the JAR file need to be present in the workspace/.metadata/.plugins folder as well (it's not there at present).

       

      Any advice would be much appreciated! TIA.

        • 1. Re: Jboss Tools JAX-RS issue in Eclipse
          shreepads

          Three points I forgot to add, not sure if any of these matter

           

          1. The manifest file in "org.jboss.tools.ws.jaxrs.core_1.7.2.Final-v20150108-2329-B81.jar" contains:

          Require-Bundle: ... ,org.apache.lucene.core;bundle-ve

          rsion="3.5.0";visibility:=reexport

           

          2. The plugin.properties file (there is no .xml version) in org.apache.lucene.core_3.5.0.v20120725-1805.jar is pretty bare-bones:

           

          bundle.name=Apache Lucene Core

          provider.name=Eclipse Orbit

           

          3. There is another version of the lucene JAR file located in the m2e plugin subdirectory (~/.eclipse/org.eclipse.platform_793567567_linux_gtk_x86_64/plugins/org.eclipse.m2e.maven.indexer_1.5.0.20140605-2032) named "lucene-core-2.4.1.jar". This is a different version from that needed by "org.jboss.tools.ws.jaxrs.core_1.7.2.Final-v20150108-2329-B81.jar".

           

          EDIT: One more, there are a number of lucene JARs in /usr/share/java containing versions 3.6.2 and 4.10.2...

           

          I tried moving out the lucene JARs in the m2e plugin directory but that didn't help. Don't want to try the same approach with /usr/share/java/ as there are just too many lucene jars littered all over there.

          • 2. Re: Jboss Tools JAX-RS issue in Eclipse
            maxandersen

            what is in maven repo does not affect/influence what eclipse uses during its runtime.

             

            You say you are running on fedora 21 - are you using fedora eclipse or eclipse from eclipse.org ? and did you install jbosstools from fedora or tools.jboss.org ?

            • 3. Re: Jboss Tools JAX-RS issue in Eclipse
              shreepads

              I'm using Eclipse from the Fedora 21 repos. And installed Jboss Tools from within Eclipse using Eclipse Marketplace.

               

              Not using maven in this project. Although m2e was installed with Jboss Tools..

              • 4. Re: Jboss Tools JAX-RS issue in Eclipse
                maxandersen

                hmm - could you try install in plain eclipse ? I Think this might be a difference in the bundled lucene jars.

                • 5. Re: Jboss Tools JAX-RS issue in Eclipse
                  shreepads

                  To be clear, I installed eclipse-jdt from Fed21 repos. Then installed JEE and Marketplace plugins from within Eclipse using the Luna default url. And then Jboss Tools from Marketplace.

                   

                  So you are suggesting I should get Eclipse (Java or JEE?) from Eclipse.org. And what abt Jboss Tools then?

                   

                  Btw I tried creating a new Dynamic Web project. Get the same error when I try to enable JAX RS...

                  • 6. Re: Jboss Tools JAX-RS issue in Eclipse
                    xcoulon

                    shreepads,

                     

                    Just to be sure, can you check that the org.apache.lucene.analysis.standard.StandardAnalyzer class exists in the org.apache.lucene.core_3.5.0.v20120725-1805.jar ? I'd like to be sure the jar is not corrupted.

                     

                    To reply to your last question: you can install Eclipse for Java IDE for Java EE developers (http://www.eclipse.org/downloads/), so you'll already have most of the required plugins (WTP, etc.), then you can install JBoss Tools from the Eclipse Marketplace or from the update site: http://tools.jboss.org/downloads/jbosstools/luna/4.2.2.Final.html#update_site . If you install Eclipse for Java Developers, our update site will provide you with all the required dependencies anyway.

                     

                    HTH

                    • 7. Re: Jboss Tools JAX-RS issue in Eclipse
                      shreepads

                      Xavier I opened up the jar in the default file roller app and could find that class in there.

                       

                      Is there a better way to check that the jar is valid?

                       

                      Will do what you suggest re Eclipse install and report back.

                      • 8. Re: Jboss Tools JAX-RS issue in Eclipse
                        xcoulon

                        Shreepads,

                         

                        Did it finally work after installing a new Eclipse ?

                        • 9. Re: Jboss Tools JAX-RS issue in Eclipse
                          shreepads

                          Sorry haven't been able to do that yet. Should be done by the weekend.

                          Thanks!