naresh.yadav | 6 Jun 17:02

Methods with Variable Number Of Arguments not supported in version jel-0.9.11

hi,
     I am using JDK 1.5 new feature to define methods taking any number of
     arguments  Method i had defined is :>
	public long sum(long... args) {
      	long sum = 0 ;
      	for(long arg : args) {
    	      	sum = sum + arg;
      	}
      	return sum;
      }

      using in expression as :>
		Evaluator.compile("sum(1,2)",lib);

      Getting following error :>
Exception in thread "main" gnu.jel.CompilationException: Function "sum" exists
but parameters "sum(byte,byte)" can not be accepted by it.

     I had tried with version jel-0.9.11. Please Help me i need this feature.

     Thanks & Regards
     Naresh Yadav
Ito Kazumitsu | 16 Mar 04:09

Bug report: void method invocation, Unicode escapes

Thanks for Jel.

And here is my bug report.  My test program is attached below.

Test case 0: evaluate "func(\"Test\\n\")"
Test case 1: evaluate "vfunc(\"Test\\n\")"
Test case 2: evaluate "func(\"\u65e5\u7acb\u96fb\u7dda\\n\")"
Test case 3: evaluate "func(\"\\u65e5\\u7acb\\u96fb\\u7dda\\n\")"

Results:
                         Java VM
Test case     Sun's 1.4.2_04             Kaffe 1.1.4
-----------   ----------------------     ---------------------
       0      PASS                       PASS
       1      VerifyError (*1)           PASS
       2      PASS                       PASS
       3      CompilationException (*2)  CompilationException (*2)

VerifyError (*1)
java.lang.VerifyError: (class: dump, method: evaluate signature:
([Ljava/lang/Object;)Ljava/lang/Object;) Unable to pop operand off an empty stack
        at java.lang.Class.getDeclaredConstructors0(Native Method)
        at java.lang.Class.privateGetDeclaredConstructors(Class.java:1610)
        at java.lang.Class.getConstructor0(Class.java:1922)
        at java.lang.Class.newInstance0(Class.java:278)
        at java.lang.Class.newInstance(Class.java:261)
        at gnu.jel.Evaluator.compile(Unknown Source)
        at TestJel.main(TestJel.java:22)

   Seeing this result, I understand that we cannot use a method
(Continue reading)

Mike Squance | 28 Nov 01:32

Data type of compiled expressions

Hi,

First, let me say that I've been extremely happy with JEL and I hope it
continues to be supported.

I'm having a bit of trouble with the data type of expressions that I suspect
is a limitation of the software, but I thought I'd ask anyways.

I rely on the getType() result to validate whether an expression has been
entered correctly with respect to the data type that the expression is
supposed to be producing. For example:

  There are 2 measurements defined:
    RAW1 of type Integer
    RAW2 of type Integer

  A derived measurement is defined:
    DERIVED1 of type Integer

  An expression is written to derive DERIVED1 from the available
measurements. 

  I look at the result of getType() to ensure that the result of the
expression for DERIVED1 is of type Integer.

In general, with expressions like "RAW1 + RAW2", "RAW1 + 10", this works
fine. I get Integer as the resulting data type. However, with an expression
"RAW1" or "(RAW1 > RAW2)?(RAW1):(RAW2)", I get Object as the resulting data
type. I know that I can do "RAW1+0" to work around this, but this is not
very desirable.
(Continue reading)

Konstantin L. Metlov | 20 Nov 21:16
Favicon

Re: Class Not Found

Dear Nayan Hajratwala,

The situation you have encountered is not a bug in JEL, but rather a 
manifestation of intricacy of Java classloaders.

In short, the problem is related to the fact that your class
"com.ford.hr.framework.user.IUser" might be present in the classpath TWICE
by being accessible by two _different_ classloaders at the same time. This
often happens in a servlet engines having both "default" and so called
"zone-specific" classloaders.

The solution is to load JEL (preferably as a whole, but loading only
gnu.jel.ImageLoader class is sufficient) into your JVM using the same
"zone-specific" classloader your classes (e.g. 
com.ford.hr.framework.user.IUser) are loaded with.

Thank you for your interest in JEL !

If some questions still remain, please ask.

With the best regards,
                          Konstantin.

                                 APPENDIX

For more detailed explanation, please read the following excerpt from my
E-mail to one of JEL users having the same problem (in this explanation
class "Message" plays the same role as your
"com.ford.hr.framework.user.IUser", and "TestRouter" stands for a class
within your package referring to "com.ford.hr.framework.user.IUser"  
(Continue reading)

Class Not Found

Folks,

I am using JEL 0.9.10 and have a problem.

When evaluating an expression, I get the message below.  The problem is that I only get the error when running it on IBM WebSphere 3.5.  It seems to work fine under WebSphere 4.0 and also works fine under the WebSphere Test Environment in VAJ 4.0.  The classpath for WebSphere contains the class indicated, so that's not the problem.

I think it's something having to do with JEL using  it's own ClassLoader, but am pretty much stuck as to how to approach a resolution.  Thanks!

java.lang.NoClassDefFoundError: com/ford/hr/framework/user/IUser
        at dump.evaluate_boolean(Unknown Source)
        at com.ford.hr.framework.security.UriAccessController.evaluate(Unknown Source)
        at com.ford.hr.framework.security.UriAccessController.hasReadAccess(Unknown Source)
        at com.ford.hr.framework.user.User.hasReadAccess(Unknown Source)
        at com.ford.hr.framework.security.Franchise.hasAccess(Unknown Source)
        at com.ford.hr.framework.security.FranchiseFactory.getAccessibleMainFranchises(Compiled Code)
        at com.ford.hr.framework.security.FranchiseFactory.routeTo(Unknown Source)
        at com.ford.hr.framework.controller.HRServlet.processRequest(Compiled Code)
        at com.ford.hr.framework.controller.HRServlet.doGet(Unknown Source)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at com.ibm.servlet.engine.webapp.StrictServletInstance.doService(ServletManager.java:644)
        at com.ibm.servlet.engine.webapp.StrictLifecycleServlet._service(StrictLifecycleServlet.java:160)
        at com.ibm.servlet.engine.webapp.IdleServletState.service(StrictLifecycleServlet.java:287)
        at com.ibm.servlet.engine.webapp.StrictLifecycleServlet.service(StrictLifecycleServlet.java:105)
        at com.ibm.servlet.engine.webapp.ServletInstance.service(ServletManager.java:371)
        at com.ibm.servlet.engine.webapp.ValidServletReferenceState.dispatch(ServletManager.java:793)
        at com.ibm.servlet.engine.webapp.ServletInstanceReference.dispatch(ServletManager.java:719)
        at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.handleWebAppDispatch(Compiled Code)
        at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.dispatch(Compiled Code)
        at com.ibm.servlet.engine.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java:189)
        at com.ibm.servlet.engine.srt.WebAppInvoker.doForward(WebAppInvoker.java:61)
        at com.ibm.servlet.engine.srt.WebAppInvoker.handleInvocationHook(Compiled Code)
        at com.ibm.servlet.engine.invocation.CachedInvocation.handleInvocation(CachedInvocation.java:67)
        at com.ibm.servlet.engine.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java:155)
        at com.ibm.servlet.engine.oselistener.OSEListenerDispatcher.service(OSEListener.java:300)
        at com.ibm.servlet.engine.oselistener.SQEventListenerImp$ServiceRunnable.run(SQEventListenerImp.java:230)
        at com.ibm.servlet.engine.oselistener.SQEventListenerImp.notifySQEvent(SQEventListenerImp.java:104)
        at com.ibm.servlet.engine.oselistener.serverqueue.SQEventSource.notifyEvent(SQEventSource.java:216)
        at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.notifyService(SQWrapperEventSource.java:354)

        at com.ibm.servlet.engine.oselistener.serverqueue.SQWrapperEventSource$SelectRunnable.run(Compiled Code)
        at com.ibm.servlet.engine.oselistener.outofproc.OutOfProcThread$CtlRunnable.run(Compiled Code)
        at java.lang.Thread.run(Compiled Code)




---
- Nayan Hajratwala
- Chikli Consulting LLC
- http://www.chikli.com


Gmane