Re: [Javaflow]java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.init(ZZ)V

2011-06-08 Thread Jörg Schaible
Hi Wayne,

wayne wrote:

 Jörg  wrote:
 
 You have other ASM classes on the classpath or you're using some code that
 depends on a different version.
 
 
 even I delete all jar about asm  on classpath

You're never explicit in your explanations. What does this mean now? Again, 
what *is* on your classpath?

,  I still got same problem.

With the detail level of your postings, nobody can really help you.

 I am wandering whether  I need to use asm-3.2.jar to replace the asm part
 in the javaflow and package a new javeflow.jar again.

I cannot recommends anything due to lack of info, sorry.

- Jörg


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



Re: [Javaflow]java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.init(ZZ)V

2011-06-08 Thread wayne
I list my classpath info as follow:

?xml version=1.0 encoding=UTF-8?
classpath
classpathentry kind=src path=src/java/
classpathentry kind=src path=src/resources/
classpathentry kind=con 
path=org.eclipse.jdt.launching.JRE_CONTAINER/
classpathentry combineaccessrules=false kind=src path=/JPPF/
classpathentry kind=lib
path=F:/jppfrun/JPPF-2.4-node/lib/jppf-common-node.jar/
classpathentry kind=lib
path=F:/jppfrun/JPPF-2.4-node/lib/jppf-common-node-src.jar/
classpathentry kind=lib
path=F:/jppfrun/JPPF-2.4-node/lib/log4j-1.2.15.jar/
classpathentry kind=lib
path=F:/jppfrun/JPPF-2.4-node/lib/slf4j-api-1.6.1.jar/
classpathentry kind=lib
path=F:/jppfrun/JPPF-2.4-node/lib/slf4j-log4j12-1.6.1.jar/
classpathentry kind=lib path=C:/Documents and
Settings/whwayne/Desktop/jar/commons-logging-1.1.1-bin/commons-logging-1.1.1/commons-logging-1.1.1.jar/
classpathentry kind=output path=classes/
/classpath

Torsten, what is mvn clean test by the way?

From Wayne


2011/6/8 Jörg Schaible joerg.schai...@scalaris.com:
 Hi Wayne,

 wayne wrote:

 Jörg  wrote:

 You have other ASM classes on the classpath or you're using some code that
 depends on a different version.


 even I delete all jar about asm  on classpath

 You're never explicit in your explanations. What does this mean now? Again,
 what *is* on your classpath?

,  I still got same problem.

 With the detail level of your postings, nobody can really help you.

 I am wandering whether  I need to use asm-3.2.jar to replace the asm part
 in the javaflow and package a new javeflow.jar again.

 I cannot recommends anything due to lack of info, sorry.

 - Jörg


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





-- 
..

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



Re: [Javaflow]java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.init(ZZ)V

2011-06-08 Thread Jörg Schaible
Hi Wayne,

wayne wrote:

 I list my classpath info as follow:
 
 ?xml version=1.0 encoding=UTF-8?
 classpath
 classpathentry kind=src path=src/java/
 classpathentry kind=src path=src/resources/
 classpathentry kind=con
 path=org.eclipse.jdt.launching.JRE_CONTAINER/ classpathentry
 combineaccessrules=false kind=src path=/JPPF/ classpathentry
 kind=lib path=F:/jppfrun/JPPF-2.4-node/lib/jppf-common-node.jar/
 classpathentry kind=lib
 path=F:/jppfrun/JPPF-2.4-node/lib/jppf-common-node-src.jar/
 classpathentry kind=lib
 path=F:/jppfrun/JPPF-2.4-node/lib/log4j-1.2.15.jar/
 classpathentry kind=lib
 path=F:/jppfrun/JPPF-2.4-node/lib/slf4j-api-1.6.1.jar/
 classpathentry kind=lib
 path=F:/jppfrun/JPPF-2.4-node/lib/slf4j-log4j12-1.6.1.jar/
 classpathentry kind=lib path=C:/Documents and
 Settings/whwayne/Desktop/jar/commons-logging-1.1.1-bin/commons-
logging-1.1.1/commons-logging-1.1.1.jar/
 classpathentry kind=output path=classes/
 /classpath

Just some general comments on the classpath:
1/ jppf-common-node-src.jar does not belong to the classpath at all
2/ either use slf4j or commons-logging, but not both at the same time

BTW: Sorry, I missed your first posting of the classpath. Therefore was my 
last mail harsher than it should have been.

However, I fail now to see the relation to Javaflow. What has this Eclipse 
project to do with the Ant built.xml where you try to use the Javaflow Ant 
task? The classpath of the Ant build is what is of real interest ...

 Torsten, what is mvn clean test by the way?
 
He assumed that you build with Maven, but from your Eclipse classpath above, 
this is clearly not the case.

- Jörg


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



Re: [Javaflow]java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.init(ZZ)V

2011-06-08 Thread wayne
Jörg. Thank you for your comments

there is Ant Build content including classpath definition:

project name='JPPF-Node' default=run basedir=.

!-- 
=
--
!--  Property definitions
 --
!-- 
=
--

property name=build.properties.file 
value=${basedir}/build.properties/
property file=${build.properties.file}/
property name=lib.dirvalue=${basedir}/lib/
property name=config.dir  value=${basedir}/config/
property name=classes.dir value=${basedir}/classes/   
property name=src.dir value=${basedir}/src/


!-- 
=
--
!--   Classpath definitions
 --
!-- 
=
--
 path id=project.classpath
pathelement location=${config.dir}/
pathelement location=${classes.dir}/
fileset dir=${lib.dir} includes=**/*.jar/
 /path


  path id=run.classpath
pathelement location=${config.dir}/
fileset dir=${lib.dir} includes=**/*.jar/
  /path
!-- 
=
--
!--Clean
   --
!-- 
=
--

  target name=clean
delete dir=${classes.dir} quiet=true/
delete dir=instrumentedclasses quiet=true/
  /target

!-- 
=
--
!--Init
   --
!-- 
=
--

target name=init description=Initialize ressources
mkdir dir=${classes.dir}/
mkdir dir=instrumentedclasses/
/target

!-- 
=
--
!--  Compile
 --
!-- 
=
--

target name=compile

javac srcdir= destdir=classes
debug=on deprecation=off optimize=on 
includes=**/*.java
classpath refid=project.classpath/
compilerarg line=-Xlint:unchecked/
src path=src/
/javac

copy todir=instrumentedclasses
 fileset dir =classes
   include name 
=org/jppf/comm/discovery/JPPFConnectionInformation.class/
 /fileset
/copy
   /target

!-- 
=
--
!--  instrument
 --
!-- 
=
--

taskdef name=javaflow
classname=org.apache.commons.javaflow.ant.AntRewriteTask
classpath id = project.class.path
 fileset dir = lib
include name = 
**/commons-javaflow-20060411.jar/
include name = 
**/bcel-5.2.jar/
 /fileset
/classpath
/taskdef

target name=javaflow depends=compile
javaflow srcdir=classes dstdir=instrumentedclasses mode 
=ASM
  include name=**/*.class /
/javaflow
/target

!-- 
=
--
!--Build
 --
!-- 
=
--

target name=build description=build the application
depends=clean, init, compile,javaflow
delete dir=${classes.dir} quiet=true/
mkdir dir=${classes.dir}/
copy todir =${classes.dir}
   fileset dir =instrumentedclasses
   /fileset
/copy
/target

!-- 
=
--
!-- Run the framework processes
 --
!-- 

Re: [Javaflow]java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.init(ZZ)V

2011-06-08 Thread Torsten Curdt
 Torsten, what is mvn clean test by the way?

http://maven.apache.org/

That's how you build javaflow ...and how you can run the tests.

cheers,
Torsten
-- 
http://www.yourdailygeekery.com
http://www.torstencurdt.com

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



Re: [Javaflow]java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.init(ZZ)V

2011-06-08 Thread wayne
I  use the latest version of Javaflow and add asm-all.3.0.jar to
project classpath.

No org.objectweb.asm.ClassWriter.init(ZZ)V

but another exception is thrown.

Buildfile: F:\jppfworkspace\application-template\build.xml
clean:
   [delete] Deleting directory F:\jppfworkspace\application-template\classes
   [delete] Deleting directory
F:\jppfworkspace\application-template\instrumentedclasses
init:
[mkdir] Created dir: F:\jppfworkspace\application-template\classes
[mkdir] Created dir:
F:\jppfworkspace\application-template\instrumentedclasses
compile:
[javac] F:\jppfworkspace\application-template\build.xml:70:
warning: 'includeantruntime' was not set, defaulting to
build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 2 source files to
F:\jppfworkspace\application-template\classes
javaflow:
 [javaflow] org.objectweb.asm.tree.analysis.AnalyzerException: Error
at instruction 27: java.lang.ClassNotFoundException:
org.jppf.application.template.TemplateApplicationRunner
 [javaflow] at org.objectweb.asm.tree.analysis.Analyzer.analyze(Unknown 
Source)
 [javaflow] at
org.apache.commons.javaflow.bytecode.transformation.asm.ContinuationMethodAnalyzer$2.analyze(ContinuationMethodAnalyzer.java:128)
 [javaflow] at
org.apache.commons.javaflow.bytecode.transformation.asm.ContinuationMethodAnalyzer.visitEnd(ContinuationMethodAnalyzer.java:139)
 [javaflow] at org.objectweb.asm.ClassReader.accept(Unknown Source)
 [javaflow] at org.objectweb.asm.ClassReader.accept(Unknown Source)
 [javaflow] at
org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer.transform(AsmClassTransformer.java:49)
 [javaflow] at
org.apache.commons.javaflow.bytecode.transformation.asm.AsmClassTransformer.transform(AsmClassTransformer.java:41)
 [javaflow] at
org.apache.commons.javaflow.utils.RewritingUtils.rewriteClassFile(RewritingUtils.java:60)
 [javaflow] at
org.apache.commons.javaflow.ant.AntRewriteTask.execute(AntRewriteTask.java:140)
 [javaflow] at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
 [javaflow] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 [javaflow] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 [javaflow] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown 
Source)
 [javaflow] at java.lang.reflect.Method.invoke(Unknown Source)
 [javaflow] at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
 [javaflow] at org.apache.tools.ant.Task.perform(Task.java:348)
 [javaflow] at org.apache.tools.ant.Target.execute(Target.java:390)
 [javaflow] at org.apache.tools.ant.Target.performTasks(Target.java:411)
 [javaflow] at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
 [javaflow] at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
 [javaflow] at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
 [javaflow] at
org.eclipse.ant.internal.ui.antsupport.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
 [javaflow] at 
org.apache.tools.ant.Project.executeTargets(Project.java:1251)
 [javaflow] at
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.run(InternalAntRunner.java:423)
 [javaflow] at
org.eclipse.ant.internal.ui.antsupport.InternalAntRunner.main(InternalAntRunner.java:137)
 [javaflow] Caused by: java.lang.RuntimeException:
java.lang.ClassNotFoundException:
org.jppf.application.template.TemplateApplicationRunner
 [javaflow] at
org.apache.commons.javaflow.bytecode.transformation.asm.ContinuationMethodAnalyzer$1.getClass(ContinuationMethodAnalyzer.java:113)
 [javaflow] at
org.objectweb.asm.tree.analysis.SimpleVerifier.isAssignableFrom(Unknown
Source)
 [javaflow] at
org.objectweb.asm.tree.analysis.SimpleVerifier.merge(Unknown Source)
 [javaflow] at org.objectweb.asm.tree.analysis.Frame.merge(Unknown Source)
 [javaflow] at org.objectweb.asm.tree.analysis.Analyzer.merge(Unknown 
Source)
 [javaflow] ... 25 more

BUILD FAILED
F:\jppfworkspace\application-template\build.xml:90:
java.lang.IllegalArgumentException: Array local[] is shorter than
nLocal

Total time: 5 seconds.


From Wayne

2011/6/8 Torsten Curdt tcu...@vafer.org:
 Torsten, what is mvn clean test by the way?

 http://maven.apache.org/

 That's how you build javaflow ...and how you can run the tests.

 cheers,
 Torsten
 --
 http://www.yourdailygeekery.com
 http://www.torstencurdt.com

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





--

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



Re: [Javaflow]java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.init(ZZ)V

2011-06-08 Thread Jörg Schaible
Hi Wayne,

wayne wrote:

 Jörg. Thank you for your comments
 
 there is Ant Build content including classpath definition:
 
 project name='JPPF-Node' default=run basedir=.

[snip]

 !--
 =
 --
 !--  instrument
  --
 !--
 =
 --
 
 taskdef name=javaflow
 classname=org.apache.commons.javaflow.ant.AntRewriteTask
 classpath id = project.class.path
 fileset dir = lib
 include name = **/commons-javaflow-20060411.jar/
 include name = **/bcel-5.2.jar/
 /fileset
 /classpath
 /taskdef

[snip]

When I look at your version of javaflow from 2006 and compare it with the 
list of dependencies 
(http://commons.apache.org/sandbox/javaflow/dependencies.html) published in 
2008, then it is obvious that your javaflow version cannot use ASM 3.x or 
newer. I don't know which ASM version was used to build javaflow in 2006, 
but in 2008 it was still ASM 2.2.1. AFAICS ASM 2.x and ASM 3.x are not 
compatible.

- Jörg


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



Re: [Javaflow]java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.init(ZZ)V

2011-06-08 Thread Torsten Curdt
 include name = **/commons-javaflow-20060411.jar/

Good catch, Jörg.

Wayne, do a

 mvn clean install

to build the latest version. Otherwise we cannot help you.

cheers,
Torsten

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



Re: [Javaflow]java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.init(ZZ)V

2011-06-08 Thread wayne
OK,  I will try  to learn mvn clean.

Thank you for both.



2011/6/8 Torsten Curdt tcu...@vafer.org:
 include name = **/commons-javaflow-20060411.jar/

 Good catch, Jörg.

 Wayne, do a

  mvn clean install

 to build the latest version. Otherwise we cannot help you.

 cheers,
 Torsten

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





-- 
..
Graduate School of Global Information
and Telecommunication Studies
Waseda University
1-6-1 Nishi Waseda, Shinjuku-ku,
Tokyo169-8050, JAPAN.
..

早稲田大学大学院 国際情報通科信研究科
中里研究室 博士課程
王歓(John Wayne)
E-mail:wangh...@fuji.waseda.jp


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



[validator]

2011-06-08 Thread Gagan Suri
Hi,

I want to use *Commons
Validatorhttp://commons.apache.org/validator/index.html
*in my web project. I have a servlet based web-app and I need to add
validations on the beans populated from request.

I created a validation.xml like this



form-validation

   global

   validator name=*required*

  classname=*com.pbbi.faraday.common.validator.Validator*

  method=*validateRequired*

  methodParams=*java.lang.Object,
org.apache.commons.validator.Field*/

/global

formset

   form name=*unitLocationBean*

  field property=*unitId* depends=*required*

 arg0 key=*unitlocation.unitid*/

  /field

   /form

/formset

/form-validation



And my validator code is like this



import org.apache.commons.validator.Field;

import org.apache.commons.validator.GenericValidator;

import org.apache.commons.validator.util.ValidatorUtils;



public class Validator {

   public static boolean validateRequired(Object bean, Field field) {

   String value = ValidatorUtils.getValueAsString(bean,
field.getProperty());

   return !GenericValidator.isBlankOrNull(value);

   }

}



And my test class to test the validations is like this



import java.io.File;

import java.io.FileInputStream;

import java.io.InputStream;



import org.apache.commons.validator.Validator;

import org.apache.commons.validator.ValidatorResources;

import org.apache.commons.validator.ValidatorResult;

import org.apache.commons.validator.ValidatorResults;



import com.pbbi.faraday.beans.UnitLocationBean;



public class Test {

public void testname() throws Exception {



   InputStream in = new FileInputStream(new
File(D:\\workspace\\faradaytc\\src\\main\\resources\\validator-rules.xml));

// InputStream in1 = new FileInputStream(new
File(D:\\workspace\\faradaytc\\src\\main\\resources\\MessageResources.properties));

   InputStream[] ins=new InputStream[2];

   ins[0]=in;

// ins[1]=in1;

   // Create an instance of ValidatorResources to

   // initialize from an xml file.



   ValidatorResources resources = new ValidatorResources(in);



   // Create bean to run test on.

   UnitLocationBean unitLocationBean=new UnitLocationBean();

   unitLocationBean.setUnitId(12121);





   // Construct validator based on the loaded resources

   // and the form key

   Validator validator = new Validator(resources, unitLocationBean);

   // add the name bean to the validator as a resource

   // for the validations to be performed on.

   validator.setParameter(Validator.BEAN_PARAM, unitLocationBean);





   // throws ValidatorException,

   // but aren't catching for example

   ValidatorResults results2=validator.validate();

   ValidatorResult result=results2.getValidatorResult(unitId);

// result.getResult(validatorName)

   System.out.println(results2 :
+results2.getValidatorResult(unitId));

   System.out.println(results2 :
+results2.getValidatorResult(unitId));

   if (results2.getValidatorResult(unitId) == null) {

  System.out.println(No error :
+results2.getValidatorResult(unitId));

   } else {

   // number of errors for first name

  //int errors = ((Integer)results.get(firstName)).intValue();

  System.out.println(results2.getValidatorResult(unitId));

  System.out.println( errors
:+results2.getValidatorResult(unitId));

   }

}





public static void main(String[] args) {

   try {

  new Test().testname();

   } catch (Exception e) {

  // TODO Auto-generated catch block

  e.printStackTrace();

   }

}

}



I am not able to understand where to put the message resource property file
to show up the messages.

I want server side validations only in this case.



Regards,


Gagan Suri,

-- 
Gagan Suri
Going to Sleep does not solve the problems
  you will have to face them the next day..


Re: [scxml] JEXL map in scxml

2011-06-08 Thread Rahul Akolkar
On Wed, Jun 8, 2011 at 4:31 AM, Artem Vovk vovk.ar...@googlemail.com wrote:
 Hi,

   I'm trying to create and send JEXL map, I wrote:

  cs:var name=one expr={ 'test' : 2}/
  send event='event1' target=receiver targetType=x-ajax
 namelist=one/

  But SCXML interpreter shows an exception :
  WARNUNG: EXPRESSION_ERROR (eval('{ 'test' : 2}'):Lexical error at line 1,
 column 10.  Encountered: : (58), after : ):
  What is wrong with this syntax?

snip/

Its not JEXL 1.x syntax, which is default. JEXL 2.x syntax will
require a suitable Evaluator/Context implementation. You can either
provide one yourself or try the one attached to this ticket [1].

-Rahul

[1] https://issues.apache.org/jira/browse/SCXML-114


 Cheers Artem


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