4 Replies Latest reply on Mar 12, 2008 7:22 AM by jrochat

    Use external .jar into a seam Project

    jrochat

      Hello !

      I made a simple seam project with Jboss Tools into eclipse IDE. I trie then to use a simple external library just to test. When the code of the external library is executed I habe this error :

      08:03:54,284 FATAL [application] java.lang.reflect.InvocationTargetException
      javax.faces.el.EvaluationException: java.lang.reflect.InvocationTargetException
       at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:91)
      


      And much more Exceptions...

      Why can't I use the code of my library ?

      Hope you can help me !

      Thank you

      Joel


        • 1. Re: Use external .jar into a seam Project

          I am also quite new to java and eclipse, but I think this might help:

          You have to take care of the following fact:
          when you are compiling the source-code in eclipse, then eclipse will use the classpath that you have specified in eclipse (I guess, that's stored in your workspaces .classpath file)
          when you deploy your project to an applicationserver, the applicationserver does of course not know anything about your eclipse classpath.
          so you have following options (AFAIK):

          • tell eclipse to bundle your external jar into your .ear (or .war)
          • let the applicationserver know your external .jar


          • 2. Re: Use external .jar into a seam Project
            jrochat

            I trie to make a smaller jar with just a simple Class. I copy the .jar into WebContent/WEB-INF/myJar.jar and it works !

            But when I do the same with a complicated jar it doesn't work...

            • 3. Re: Use external .jar into a seam Project

              another wild guess:
              are you sure, that the application server uses the same (or an higher) java version, as your application/your complicated jar has been compiled with?

              • 4. Re: Use external .jar into a seam Project
                jrochat

                Yes I do it in the same machine ! But it's working now, I juste delete and recreate the Jboss Server withe Eclipse...

                Strange...

                Thank you for your help !