8 Replies Latest reply on Jan 21, 2005 1:15 PM by loupubeu

    Problem in running the plain.bsh example

    sylcheung

      Hi,

      I am trying to learn JBossCache 1.2. I following the tutorial in running the 'plain.bsh' example. But I get the 'Failed to aspectize class org.jboss.cache.TreeCache. Could not find class it references org.jboss.re
      moting.ServerInvocationHandler' exception. Can someone please help me?

      It looks like it is missing a jar file. But in the\lib directory, it has the 'jboss-remoting.jar' file.

      Thank you.



      bsh % sourceRelative("plain.bsh")

      [error] Failed to aspectize class org.jboss.cache.TreeCache. Could not find class it references org.jboss.remoting.Serve
      rInvocationHandler.. Do verbose mode if you want full stack trace.
      // Error: // Uncaught Exception: Method Invocation this.interpreter.source : at Line: 19 : in file: /bsh/commands/sourceR
      elative.bsh : this .interpreter .source ( path , this .caller .namespace )

      Called from method: sourceRelative : at Line: 6 : in file: <unknown file> : sourceRelative ( "plain.bsh" )
      Target exception: java.lang.Error: Error transforming the class org.jboss.cache.TreeCache: org.jboss.aop.instrument.Trans
      formationException: Failed to aspectize class org.jboss.cache.TreeCache. Could not find class it references org.jboss.re
      moting.ServerInvocationHandler

      java.lang.Error: Error transforming the class org.jboss.cache.TreeCache: org.jboss.aop.instrument.TransformationException
      : Failed to aspectize class org.jboss.cache.TreeCache. Could not find class it references org.jboss.remoting.ServerInvoc
      ationHandler
      at org.jboss.aop.standalone.SystemClassLoader.loadClass(SystemClassLoader.java:191)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:219)
      at bsh.classpath.ClassManagerImpl.plainClassForName(Unknown Source)
      at bsh.classpath.ClassManagerImpl.classForName(Unknown Source)
      at bsh.NameSpace.classForName(Unknown Source)
      at bsh.NameSpace.getImportedClassImpl(Unknown Source)
      at bsh.NameSpace.getClassImpl(Unknown Source)
      at bsh.NameSpace.getClass(Unknown Source)
      at bsh.Name.consumeNextObjectField(Unknown Source)
      at bsh.Name.toObject(Unknown Source)
      at bsh.BSHAmbiguousName.toObject(Unknown Source)
      at bsh.BSHAllocationExpression.objectAllocation(Unknown Source)
      at bsh.BSHAllocationExpression.eval(Unknown Source)
      at bsh.BSHPrimaryExpression.eval(Unknown Source)
      at bsh.BSHPrimaryExpression.eval(Unknown Source)
      at bsh.BSHAssignment.eval(Unknown Source)
      at bsh.Interpreter.eval(Unknown Source)
      at bsh.Interpreter.source(Unknown Source)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:324)
      at bsh.Reflect.invokeOnMethod(Unknown Source)
      at bsh.Reflect.invokeObjectMethod(Unknown Source)
      at bsh.Name.invokeMethod(Unknown Source)
      at bsh.BSHMethodInvocation.eval(Unknown Source)
      at bsh.BSHPrimaryExpression.eval(Unknown Source)
      at bsh.BSHPrimaryExpression.eval(Unknown Source)
      at bsh.BSHReturnStatement.eval(Unknown Source)
      at bsh.BSHBlock.evalBlock(Unknown Source)
      at bsh.BSHBlock.eval(Unknown Source)
      at bsh.BshMethod.invokeImpl(Unknown Source)
      at bsh.BshMethod.invoke(Unknown Source)
      at bsh.BshMethod.invoke(Unknown Source)
      at bsh.Name.invokeLocalMethod(Unknown Source)
      at bsh.Name.invokeMethod(Unknown Source)
      at bsh.BSHMethodInvocation.eval(Unknown Source)
      at bsh.BSHPrimaryExpression.eval(Unknown Source)
      at bsh.BSHPrimaryExpression.eval(Unknown Source)
      at bsh.Interpreter.run(Unknown Source)
      at bsh.Interpreter.main(Unknown Source)

        • 1. Re: Problem in running the plain.bsh example
          zhe

          I had an exactly the same problem as yours. I fixed it by:
          1. I found my path for java is c:\jdev9051\jdk\bin but the enviroment variable %JAVA_HOME% is still point to c:\jdk1.3...... so I changed the %JAVA_HOME% to "c:\jdev9051\jdk".

          2. I found there is a typo in runShellDemo.bat. this is too tricky for us beginner to find:
          in the end of "set CLASSPATH " line. it should be "%CACHE_LIB%/jboss-remoting.jar" instead of "%CACHE_LIB/jboss-remoting.jar".

          hopefully this can help. by the way, I still can't run the example because of some other problem. if u get it running. please let me know.

          • 2. Re: Problem in running the plain.bsh example

            Zhe,

            You are not using JBossCache1.2 right? I just checked. runShellDemo.bat has the right syntax for %CACHE_LIB%/jboss-remoting.jar.


            Without further information, it's really difficult for me to say exactly what went wrong. Couple machines that I have tried, they all worked.

            But if you guys have found the why, let me know. I will put them in the faq.

            Thanks,

            -Ben

            • 3. Re: Problem in running the plain.bsh example
              zhe

              I am very sure that I downloaded JBossCache-1.2.zip and I just opened it again using winzip and view the file runShellDemo.bat ( I am running it on Window 2000). and it is:
              set CLASSPATH=%CACHE_LIB%/commons-logging.jar;%CACHE_LIB%/bsh-1.3.0.jar;%CACHE_LIB%/bsh-commands-1.3.0.jar;%CACHE_LIB%/jboss-aop.jar;%CACHE_LIB%/jboss-j2ee.jar;%CACHE_LIB%/jgroups.jar;%CACHE_LIB%/jboss-cache.jar;%CACHE_LIB%/jboss-jmx.jar;%CACHE_LIB%/trove.jar;%CACHE_LIB%/javassist.jar;%CACHE_LIB%/jboss-minimal.jar;%CACHE_LIB%/jboss-common.jar;%CACHE_LIB%/jboss-system.jar;%CACHE_LIB%/log4j.jar;%CACHE_LIB%/concurrent.jar;%CACHE_LIB%/je.jar;%CACHE_LIB/jboss-remoting.jar


              now I can program is running but if I put something in the shell it never shows up in gui window. anyway, I will download another zip file to make sure it is right.

              thanks

              • 4. Re: Problem in running the plain.bsh example
                zhe

                I just tried to download from New York site and japan site. all zip files has the same problem. please doulbe check it. I guess there is not only one error in it because when I run it, in the shell window I "tree.put(.....);". nothing shows up in the gui window.

                now I will try version 1.1.

                • 5. Re: Problem in running the plain.bsh example

                  You are right. The fix was recent. So in 1.2 version, the bat file is broken because of the % sign.

                  -Ben

                  • 6. Re: Problem in running the plain.bsh example
                    sylcheung

                    I am sure I am using jbosscache 1.2 as well,

                    I download it from here:

                    http://sourceforge.net/project/showfiles.php?group_id=22866&package_id=102339

                    So what are the steps to fix the example? I am using Windows XP with jdk 1.4.2

                    Thank you.

                    • 7. Re: Problem in running the plain.bsh example
                      zhe

                      just do what I said. and run the demo see what happen.

                      • 8. Re: Problem in running the plain.bsh example
                        loupubeu

                        Thanks ! exact !
                        it misses the second "%" in the script