|
From: David G. <dg...@co...> - 2003-10-07 04:40:25
|
Hi Qin,
Since I only know the bare minimum of Velocity, I'll let Master Bruce field
this one.
David
On Monday 06 October 2003 3:36 pm, Qin Ding wrote:
> Bruce and David:
>
> I don't need to create a lib folder of my own and then set classpath to it.
> I finally found out that I just have to put my jar into %babeldoc_home%/lib
> directory. The problem that babeldoc did not find my jar before is
> because the way that script imports the classes. Now, I fixed the scripts
> and the babeldoc finds my jar and starts validationg the file. It is very
> good.
>
> However, another problem. In my validation routine, I use Velocity to
> generate a validation report. Now, for some unknown reasons, my Velocity
> could not start. See the following error trace. I put my debug statement
> in my validation routine. The problem is right at initializing the
> VelocityEngine. I checked the Velocity documents, there are two ways to
> initialize the Velocity: Singleton and non-Singleton. Singleton means only
> one instance of Velocity per JVM allowed. I guess when I tried to
> initialize my velocity, the scripting does not like it.
>
> Is there a reason that the babeldoc only allows Singleton Velocity? Can we
> change it to none-singleton? Where is in Babeldoc that Velocity is first
> initialized? Maybe I can try to change it to none-singleton and see if it
> makes any diffrerence.
>
> Please let me know, I am pretty close to get this thing work. The only
> thing that needs to fix is the initialize the velocity.
>
> Thank you.
>
> 2003-10-06 17:07:55,668|DEBUG|filevalidation.TestManager|Enter
> logErrors2003-10-06 17:07:55,668|DEBUG|filevalidation.TestManager|Enter
> logErrorDetails2003-10-06 17:07:55,668|INFO
>
> |filevalidation.TestManager|Processed Aftermarket[24 rows] in 0
>
> second(s)2003-10-06
>
> 17:07:55,728|ERROR|pipeline.DefaultPipelineStageErrorHandler|[DefaultPipeli
>neStageErrorHandler.handlePipelineStageError] PipelineStage name:
> initialize Error: com.babeldoc.core.pipeline.PipelineException: Script
> processing failed2003-10-06
> 17:07:55,728|ERROR|command.PipelineFeeder|[PipelineFeeder.process]
> com.babeldoc.core.pipeline.PipelineException: Script processing failed
> at
> com.babeldoc.core.pipeline.stage.ScriptingPipelineStage.process(Unknown
> Source)
> at com.babeldoc.core.pipeline.PipelineStage.processStage(Unknown
> Source)
> at
> com.babeldoc.core.pipeline.processor.SyncPipelineStageProcessor.processPipe
>lineStage(Unknown Source)
> at
> com.babeldoc.core.pipeline.processor.SyncPipelineStageProcessor.process(Unk
>nown Source)
> at com.babeldoc.core.pipeline.PipelineStageFactory.process(Unknown
> Source)
> at com.babeldoc.core.pipeline.PipelineFactory.process(Unknown Source)
> at com.babeldoc.core.pipeline.PipelineFactoryFactory.process(Unknown
> Source)
> at
> com.babeldoc.core.pipeline.feeder.SynchronousFeeder.process(Unknown Source)
> at com.babeldoc.core.pipeline.feeder.FeederFactory.process(Unknown
> Source)
> at com.babeldoc.core.pipeline.command.PipelineFeeder.process(Unknown
> Source)
> at com.babeldoc.core.pipeline.command.PipelineFeeder.execute(Unknown
> Source)
> at com.babeldoc.core.BabeldocCommand.executeCommand(Unknown Source)
> at com.babeldoc.core.BabeldocCommand.<init>(Unknown Source)
> at com.babeldoc.core.pipeline.command.PipelineFeeder.<init>(Unknown
> Source)
> at com.babeldoc.core.pipeline.command.PipelineFeeder.main(Unknown
> Source)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3
>9) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
>l.java:25) at java.lang.reflect.Method.invoke(Method.java:324)
> at com.babeldoc.core.Main.handleCommand(Unknown Source)
> at com.babeldoc.core.Main.main(Unknown Source)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3
>9) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
>l.java:25) at java.lang.reflect.Method.invoke(Method.java:324)
> at com.babeldoc.init.Main.runBabeldocMain(Unknown Source)
> at com.babeldoc.init.Main.main(Unknown Source)
> Caused by: org.apache.bsf.BSFException: JavaScript Error:
> java.lang.ExceptionInInitializerError
> at
> org.apache.bsf.engines.javascript.JavaScriptEngine.handleError(Unknown
> Source)
> at org.apache.bsf.engines.javascript.JavaScriptEngine.eval(Unknown
> Source)
> at org.apache.bsf.util.BSFEngineImpl.exec(Unknown Source)
> at org.apache.bsf.BSFManager$6.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at org.apache.bsf.BSFManager.exec(Unknown Source)
> ... 27 more
>
>
>
> ---------------------------------------------------------------------------
>-------------
>
> This is a PRIVATE message. If you are not the intended recipient, please
> delete without copying and kindly advise us by e-mail of the mistake in
> delivery. NOTE: Regardless of content, this e-mail shall not operate to
> bind CSC to any order or other contract unless pursuant to explicit written
> agreement or government initiative expressly permitting the use of e-mail
> for such purpose.
> ---------------------------------------------------------------------------
>-------------
>
>
>
>
>
> Bruce McDonald
> <bruce To: Qin
> Ding/ASD/CSC@CSC, David Glick <dg...@co...> @mcdonald-family cc:
> bab...@li... .com> Subject:
> Re: [Babeldoc-devel] Re: [Babeldoc-user] Questions. Please Help 10/03/03
> 07:53
> PM
>
>
>
>
>
>
> You need to import your class into the javascript. Please read the
> documentation found at the Mozilla/Rhino/JS site (use google to find the
> URL).
>
> On Friday 03 October 2003 01:33 pm, Qin Ding wrote:
> > David and Bruce:
> >
> > I put the my validation jar into c:\qin\lib foder and set CLASSPATH=c:
> > \qin\lib\myvalidation.jar;%CLASSPATH%. Re-ran the pipeline. Still got the
> > error for not finding the class. I built a small app to verify
> > myvalidation.jar using the same classpath. It finds the
> > TestManager.validation without the problem. So the problem seems at the
>
> my
>
> > script. Here is my script:
> > initialize.script=\
> > longlegs.core.filevalidation.TestManager.validate(document.get
> > ("file_name"),\
> > document.getInputStream());\
> >
> > 1. Internally, when this script is received, how does ScriptingStage
>
> class
>
> > do to start search the external jar?
> > 2. I don't think the external application stage will help me because our
> > validation jar is not an "application"; and it only takes either
> > java.io.File or java.io.InputStream.
> > 3. If I can not make it work using Scripting stage, I am think just
>
> modify
>
> > the directory scanner to include the call to my validation routine after
>
> it
>
> > picks up the file there. Can I do that by extending the
>
> DirectoryScanner?
>
> > Once again, if I extend the class, where should I deploy it?
> > 4. There are lots of directories with the numbers as their names. What
>
> are
>
> > those directories? Does the system perge them eventually?
> >
> > <2003-10-03 09:59:55,637> INFO [main] : PipelineStage name: initialize
> > <2003-10-03 09:59:56,108> ERROR [main] :
> > [DefaultPipelineStageErrorHandler.handlePipelineStageError] PipelineStage
> > name: initialize Error: com.babeldoc.core.pipeline.PipelineException:
> > Script processing failed
> > <2003-10-03 09:59:56,108> ERROR [main] : [PipelineFeeder.process]
> > com.babeldoc.core.pipeline.PipelineException: Script processing failed
> > at
> > com.babeldoc.core.pipeline.stage.ScriptingPipelineStage.process(Unknown
> > Source)
> > at com.babeldoc.core.pipeline.PipelineStage.processStage(Unknown
> > Source)
> > at
>
> com.babeldoc.core.pipeline.processor.SyncPipelineStageProcessor.processPipe
>
> >lineStage(Unknown Source)
> > at
>
> com.babeldoc.core.pipeline.processor.SyncPipelineStageProcessor.process(Unk
>
> >nown Source)
> > at com.babeldoc.core.pipeline.PipelineStageFactory.process(Unknown
> > Source)
> > at com.babeldoc.core.pipeline.PipelineFactory.process(Unknown
>
> Source)
>
> > at
>
> com.babeldoc.core.pipeline.PipelineFactoryFactory.process(Unknown
>
> > Source)
> > at
> > com.babeldoc.core.pipeline.feeder.SynchronousFeeder.process(Unknown
>
> Source)
>
> > at com.babeldoc.core.pipeline.feeder.FeederFactory.process(Unknown
> > Source)
> > at
>
> com.babeldoc.core.pipeline.command.PipelineFeeder.process(Unknown
>
> > Source)
> > at
>
> com.babeldoc.core.pipeline.command.PipelineFeeder.execute(Unknown
>
> > Source)
> > at com.babeldoc.core.BabeldocCommand.executeCommand(Unknown Source)
> > at com.babeldoc.core.BabeldocCommand.<init>(Unknown Source)
> > at com.babeldoc.core.pipeline.command.PipelineFeeder.<init>(Unknown
> > Source)
> > at com.babeldoc.core.pipeline.command.PipelineFeeder.main(Unknown
> > Source)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3
>
> >9) at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
>
> >l.java:25) at java.lang.reflect.Method.invoke(Method.java:324)
> > at com.babeldoc.core.Main.handleCommand(Unknown Source)
> > at com.babeldoc.core.Main.main(Unknown Source)
> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3
>
> >9) at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
>
> >l.java:25) at java.lang.reflect.Method.invoke(Method.java:324)
> > at com.babeldoc.init.Main.runBabeldocMain(Unknown Source)
> > at com.babeldoc.init.Main.main(Unknown Source)
> > Caused by: org.apache.bsf.BSFException: JavaScript Error: Internal Error:
> > ReferenceError: "longlegs" is not defined.
> > at
> > org.apache.bsf.engines.javascript.JavaScriptEngine.handleError(Unknown
> > Source)
> > at org.apache.bsf.engines.javascript.JavaScriptEngine.eval(Unknown
> > Source)
> > at org.apache.bsf.util.BSFEngineImpl.exec(Unknown Source)
> > at org.apache.bsf.BSFManager$6.run(Unknown Source)
> > at java.security.AccessController.doPrivileged(Native Method)
> > at org.apache.bsf.BSFManager.exec(Unknown Source)
> > ... 27 more
>
> ---------------------------------------------------------------------------
>
> >-------------
> >
> > This is a PRIVATE message. If you are not the intended recipient, please
> > delete without copying and kindly advise us by e-mail of the mistake in
> > delivery. NOTE: Regardless of content, this e-mail shall not operate to
> > bind CSC to any order or other contract unless pursuant to explicit
>
> written
>
> > agreement or government initiative expressly permitting the use of e-mail
> > for such purpose.
>
> ---------------------------------------------------------------------------
>
> >-------------
> >
> >
> >
> >
> >
> >
> > -------------------------------------------------------
> > This sf.net email is sponsored by:ThinkGeek
> > Welcome to geek heaven.
> > http://thinkgeek.com/sf
> > _______________________________________________
> > Babeldoc-devel mailing list
> > Bab...@li...
> > https://lists.sourceforge.net/lists/listinfo/babeldoc-devel
--
David Glick
Transmit Consulting, Inc
619-475-4052
dg...@tr...
|