Re: [JAVAFLOW] Running a Javaflow example

2009-08-31 Thread Hiroshi Yamauchi
Hi Torsten,

How do I use BCEL from javaflow, or how do I get the BCEL based javaflow?

Thanks,

Hiroshi

On Sun, Aug 23, 2009 at 10:10 AM, Torsten Curdttcu...@apache.org wrote:
 In the latest trunk javaflow switched to use the ASM engine instead of
 the BCEL one by default. There is still some work to do. But maybe
 give the BCEL one a try.

 cheers
 --
 Torsten

 On Tue, Aug 18, 2009 at 02:15, Hiroshi Yamauchiyamau...@google.com wrote:
 Hi,

 I'm trying to run a javaflow example code. But it's been unsuccessful so far.

 I'm basically following this blog post:
 http://blogs.sun.com/sundararajan/entry/continuations_for_java

 I built javaflow-1.0-SNAPSHOT.jar using maven and downloaded
 commons-logging-1.1.1.jar and asm-all-3.2.jar.

 Here's what I did:

 $ cat Test.java
 import org.apache.commons.javaflow.*;

 class Test {
  static class MyRunnable implements Runnable {
   public void run() {
     System.out.println(run started!);
     for( int i=0; i  10; i++ ) {
       echo(i);
     }
   }

   private void echo(int x) {
     System.out.println(echo  + x);
     Continuation.suspend();
   }
  }

  public static void main(String[] args) {
   System.out.println(main started);
   Continuation c = Continuation.startWith(new MyRunnable());
   System.out.println(in main after continuation return);
   while (c != null) {
     c = Continuation.continueWith(c);
     System.out.println(in main);
   }
  }
 }
 $ javac -cp ../target/javaflow-1.0-SNAPSHOT.jar Test.java
 $ jar cvf Test.jar Test.class Test\$MyRunnable.class
 added manifest
 adding: Test.class(in = 882) (out= 516)(deflated 41%)
 adding: Test$MyRunnable.class(in = 903) (out= 563)(deflated 37%)
 $ java -cp 
 ../target/javaflow-1.0-SNAPSHOT.jar:../lib/commons-logging-1.1.1.jar:../lib/asm-all-3.2.jar
  org.apache.commons.javaflow.utils.RewritingUtils Test.jar
 Test-instrumented.jar
 rewriting Test.jar
 org.objectweb.asm.tree.analysis.AnalyzerException: Error at
 instruction 8: Cannot pop operand off an empty stack.
       at org.objectweb.asm.tree.analysis.Analyzer.analyze(Unknown Source)
       at 
 org.apache.commons.javaflow.bytecode.transformation.asm.ContinuationMethodAnalyzer$2.analyze(ContinuationMethodAnalyzer.java:124)
       at 
 org.apache.commons.javaflow.bytecode.transformation.asm.ContinuationMethodAnalyzer.visitEnd(ContinuationMethodAnalyzer.java:135)
       at org.objectweb.asm.ClassReader.accept(Unknown Source)
       at org.objectweb.asm.ClassReader.accept(Unknown Source)
       at 
 org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer.transform(AsmClassTransformer.java:53)
       at 
 org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer.transform(AsmClassTransformer.java:40)
       at 
 org.apache.commons.javaflow.utils.RewritingUtils.rewriteJar(RewritingUtils.java:108)
       at 
 org.apache.commons.javaflow.utils.RewritingUtils.rewriteJar(RewritingUtils.java:71)
       at 
 org.apache.commons.javaflow.utils.RewritingUtils.main(RewritingUtils.java:181)
 Caused by: java.lang.IndexOutOfBoundsException: Cannot pop operand off
 an empty stack.
       at org.objectweb.asm.tree.analysis.Frame.pop(Unknown Source)
       at org.objectweb.asm.tree.analysis.Frame.execute(Unknown Source)
       at 
 org.apache.commons.javaflow.bytecode.transformation.asm.MonitoringFrame.execute(MonitoringFrame.java:70)
       ... 10 more
 org.objectweb.asm.tree.analysis.AnalyzerException: Error at
 instruction 8: Cannot pop operand off an empty stack.
       at org.objectweb.asm.tree.analysis.Analyzer.analyze(Unknown Source)
       at org.objectweb.asm.util.CheckMethodAdapter$1.visitEnd(Unknown Source)
       at org.objectweb.asm.util.CheckMethodAdapter.visitEnd(Unknown Source)
       at org.objectweb.asm.tree.MethodNode.accept(Unknown Source)
       at 
 org.apache.commons.javaflow.bytecode.transformation.asm.ContinuationMethodAnalyzer.visitEnd(ContinuationMethodAnalyzer.java:141)
       at org.objectweb.asm.ClassReader.accept(Unknown Source)
       at org.objectweb.asm.ClassReader.accept(Unknown Source)
       at 
 org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer.transform(AsmClassTransformer.java:53)
       at 
 org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer.transform(AsmClassTransformer.java:40)
       at 
 org.apache.commons.javaflow.utils.RewritingUtils.rewriteJar(RewritingUtils.java:108)
       at 
 org.apache.commons.javaflow.utils.RewritingUtils.rewriteJar(RewritingUtils.java:71)
       at 
 org.apache.commons.javaflow.utils.RewritingUtils.main(RewritingUtils.java:181)
 Caused by: java.lang.IndexOutOfBoundsException: Cannot pop operand off
 an empty stack.
       at org.objectweb.asm.tree.analysis.Frame.pop(Unknown Source)
       at org.objectweb.asm.tree.analysis.Frame.execute(Unknown Source)
       ... 12 more
 Exception in thread main java.lang.RuntimeException: Error at
 instruction 8: Cannot pop operand off an empty stack.
 main([Ljava/lang/String;)V
 

Re: [JAVAFLOW] Running a Javaflow example

2009-08-31 Thread Jin Mingjian
get the older archive? why not use the asm version?

regards,
Jin



2009/9/1 Hiroshi Yamauchi yamau...@google.com

 Hi Torsten,

 How do I use BCEL from javaflow, or how do I get the BCEL based javaflow?

 Thanks,

 Hiroshi

 On Sun, Aug 23, 2009 at 10:10 AM, Torsten Curdttcu...@apache.org wrote:
  In the latest trunk javaflow switched to use the ASM engine instead of
  the BCEL one by default. There is still some work to do. But maybe
  give the BCEL one a try.
 
  cheers
  --
  Torsten
 
  On Tue, Aug 18, 2009 at 02:15, Hiroshi Yamauchiyamau...@google.com
 wrote:
  Hi,
 
  I'm trying to run a javaflow example code. But it's been unsuccessful so
 far.
 
  I'm basically following this blog post:
  http://blogs.sun.com/sundararajan/entry/continuations_for_java
 
  I built javaflow-1.0-SNAPSHOT.jar using maven and downloaded
  commons-logging-1.1.1.jar and asm-all-3.2.jar.
 
  Here's what I did:
 
  $ cat Test.java
  import org.apache.commons.javaflow.*;
 
  class Test {
   static class MyRunnable implements Runnable {
public void run() {
  System.out.println(run started!);
  for( int i=0; i  10; i++ ) {
echo(i);
  }
}
 
private void echo(int x) {
  System.out.println(echo  + x);
  Continuation.suspend();
}
   }
 
   public static void main(String[] args) {
System.out.println(main started);
Continuation c = Continuation.startWith(new MyRunnable());
System.out.println(in main after continuation return);
while (c != null) {
  c = Continuation.continueWith(c);
  System.out.println(in main);
}
   }
  }
  $ javac -cp ../target/javaflow-1.0-SNAPSHOT.jar Test.java
  $ jar cvf Test.jar Test.class Test\$MyRunnable.class
  added manifest
  adding: Test.class(in = 882) (out= 516)(deflated 41%)
  adding: Test$MyRunnable.class(in = 903) (out= 563)(deflated 37%)
  $ java -cp
 ../target/javaflow-1.0-SNAPSHOT.jar:../lib/commons-logging-1.1.1.jar:../lib/asm-all-3.2.jar
   org.apache.commons.javaflow.utils.RewritingUtils Test.jar
  Test-instrumented.jar
  rewriting Test.jar
  org.objectweb.asm.tree.analysis.AnalyzerException: Error at
  instruction 8: Cannot pop operand off an empty stack.
at org.objectweb.asm.tree.analysis.Analyzer.analyze(Unknown
 Source)
at
 org.apache.commons.javaflow.bytecode.transformation.asm.ContinuationMethodAnalyzer$2.analyze(ContinuationMethodAnalyzer.java:124)
at
 org.apache.commons.javaflow.bytecode.transformation.asm.ContinuationMethodAnalyzer.visitEnd(ContinuationMethodAnalyzer.java:135)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at
 org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer.transform(AsmClassTransformer.java:53)
at
 org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer.transform(AsmClassTransformer.java:40)
at
 org.apache.commons.javaflow.utils.RewritingUtils.rewriteJar(RewritingUtils.java:108)
at
 org.apache.commons.javaflow.utils.RewritingUtils.rewriteJar(RewritingUtils.java:71)
at
 org.apache.commons.javaflow.utils.RewritingUtils.main(RewritingUtils.java:181)
  Caused by: java.lang.IndexOutOfBoundsException: Cannot pop operand off
  an empty stack.
at org.objectweb.asm.tree.analysis.Frame.pop(Unknown Source)
at org.objectweb.asm.tree.analysis.Frame.execute(Unknown Source)
at
 org.apache.commons.javaflow.bytecode.transformation.asm.MonitoringFrame.execute(MonitoringFrame.java:70)
... 10 more
  org.objectweb.asm.tree.analysis.AnalyzerException: Error at
  instruction 8: Cannot pop operand off an empty stack.
at org.objectweb.asm.tree.analysis.Analyzer.analyze(Unknown
 Source)
at org.objectweb.asm.util.CheckMethodAdapter$1.visitEnd(Unknown
 Source)
at org.objectweb.asm.util.CheckMethodAdapter.visitEnd(Unknown
 Source)
at org.objectweb.asm.tree.MethodNode.accept(Unknown Source)
at
 org.apache.commons.javaflow.bytecode.transformation.asm.ContinuationMethodAnalyzer.visitEnd(ContinuationMethodAnalyzer.java:141)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at org.objectweb.asm.ClassReader.accept(Unknown Source)
at
 org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer.transform(AsmClassTransformer.java:53)
at
 org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer.transform(AsmClassTransformer.java:40)
at
 org.apache.commons.javaflow.utils.RewritingUtils.rewriteJar(RewritingUtils.java:108)
at
 org.apache.commons.javaflow.utils.RewritingUtils.rewriteJar(RewritingUtils.java:71)
at
 org.apache.commons.javaflow.utils.RewritingUtils.main(RewritingUtils.java:181)
  Caused by: java.lang.IndexOutOfBoundsException: Cannot pop operand off
  an empty stack.
at org.objectweb.asm.tree.analysis.Frame.pop(Unknown Source)
at 

Re: 64bit windows server 2008 OS

2009-08-31 Thread Jörg Schaible
Hi Thanik,

Thanikaiarasu wrote:

 Dear All,
 I would like to know whether commons-dbcp 1.2.2 and commons-pool 1.4 will
 work properly in a 64bit windows server 2008 operating system without any
 issues. Kindly reply and provide any official link for knowing the same.

With very view exceptions all Apache Commons Components do not contain any
native code and are build to run on a JVM. It depends on the component
which version specification that JVM must implement, but that's all.
Commons-dbcp and commons-pool are not different to other Apache components
in this regard.

The platform independence is part of the Java specification and if you are
in doubt, you have to look for compatibility issues in the JVM vendor's
documentation of your target JVM.

Regards,
Jörg


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org