[MarkLogic Dev General] Problem adding my own JAR to MLJAM

Jason Hunter jhunter at marklogic.com
Sun May 11 21:25:41 PDT 2008


Here's your code:

>     package neil.test;
> 
>     final public class UpperCase {
>     String _TheString = "";
>     public UpperCase(String TheString) {  _TheString = 
> TheString.toUpperCase(); }
>     public String GetUpperCase() {  return _TheString;  }
>     }

Here's your use of it:

>     jam:eval-get('{
> 
>       import neil.test.UpperCase;
> 
>       UpperCase UC = new UpperCase();
> 
>       String U = "hello: " + UC.GetUpperCase("Testing Testing");
> 
>       return U;   
> 
>     }')

Here's your error:

>     Typed variable declaration : Constructor error: Can't find default 
> constructor for: class neil.test.UpperCase  on line 1,

A "default constructor" is the constructor that takes no arguments. 
You're calling it as "new UpperCase()".  In your code above you didn't 
provide that constructor.  So the error is simply that you're calling a 
constructor that doesn't exist.

You can call new UpperCase("Testing Testing").GetUpperCase() and it'll work.

-jh-


More information about the General mailing list