jakarta-bsf-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Raza, Rizwan \(MLCI\)" <Rizwan_R...@ml.com>
Subject RE: evaluating simple string "2 == 2"
Date Wed, 15 Oct 2008 15:07:46 GMT
I guess it is failing at the following code location in BSFManager.java

private Log logger = LogFactory.getLog(this.getClass().getName());

Thanks

- raza



-----Original Message-----
From: Rony G. Flatscher [mailto:Rony.Flatscher@wu-wien.ac.at] 
Sent: Wednesday, October 15, 2008 3:57 AM
To: Bean Scripting Framework users
Subject: Re: evaluating simple string "2 == 2"

Hi Raza,

also, make sure that the Java statement is syntactically correct.

In your example you obviously want to execute the following Java
statement: "return (2==2);". Hence your eval invocation should probably
read:

	Object o = manager.eval("java","",0,0,"return (2==2);");

HTH,

---rony


Raza, Rizwan (MLCI) wrote:
> Hi folks:
>
>  
>
> How can I evaluate the string "2 == 2" in a java program. Is it
> possible?
>
>  
>
> I did the following but it is throwing ClassNotFound exception
>
>  
>
> BSFManager manager = new org.apache.bsf.BSFManager();
>
> Object o = manager.eval("","",0,0,"2==2");
>
> return o.toString();
>
>  
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> org/apache/commons/logging/LogFactory
>
>       at org.apache.bsf.BSFManager.<init>(BSFManager.java:102)
>
>       at EvaluatorB.Evaluate(EvaluatorB.java:13)
>
>       at Evaluator.main(Evaluator.java:8)
>
> Caused by: java.lang.ClassNotFoundException:
> org.apache.commons.logging.LogFactory
>
>       at java.net.URLClassLoader$1.run(Unknown Source)
>
>       at java.security.AccessController.doPrivileged(Native Method)
>
>       at java.net.URLClassLoader.findClass(Unknown Source)
>
>       at java.lang.ClassLoader.loadClass(Unknown Source)
>
>       at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>
>       at java.lang.ClassLoader.loadClass(Unknown Source)
>
>       at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>
>       ... 3 more
>
>  
>
> I think I am missing some configuration file. Can someone please point
> me to the right direction?
>
>  
>   


---------------------------------------------------------------------
To unsubscribe, e-mail: bsf-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bsf-user-help@jakarta.apache.org
--------------------------------------------------------

This message w/attachments (message) may be privileged, confidential or proprietary, and if
you are not an intended recipient, please notify the sender, do not use or share it and delete
it. Unless specifically indicated, this message is not an offer to sell or a solicitation
of any investment products or other financial product or service, an official confirmation
of any transaction, or an official statement of Merrill Lynch. Subject to applicable law,
Merrill Lynch may monitor, review and retain e-communications (EC) traveling through its networks/systems.
The laws of the country of each sender/recipient may impact the handling of EC, and EC may
be archived, supervised and produced in countries other than the country in which you are
located. This message cannot be guaranteed to be secure or error-free. This message is subject
to terms available at the following link: http://www.ml.com/e-communications_terms/. By messaging
with Merrill Lynch you consent to the foregoing.
--------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: bsf-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bsf-user-help@jakarta.apache.org


Mime
View raw message