axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrei Tchijov <and...@tchijov.com>
Subject Re: Problems with using JavaScript with Axis2
Date Mon, 17 Sep 2007 15:05:46 GMT
Update to my last observation.  It does work with standard WAR based  
installation after adding BSF and JS jars (duh!?). Also, it looks  
like "proper" serice.xml looks like this :

<service name="JaspTest">
     <description>
         This is just a Test
     </description>
         <parameter name="script.js"><![CDATA[
                 function invoke( inMC, outMC ) {
                         Packages.java.lang.System.out.println( "  
JASP : Hello Axis2" );
                 }
         ]]></parameter>
     <operation name="Hello">
         <messageReceiver   
class="org.apache.axis2.scripting.ScriptReceiver" />
     </operation>
</service>

Parameter "script.js" is "per-service" not "per-operation" (I guess  
it does make sense).   Have not tried it, but I assume that one can  
specify different function-name on per-operation basis,

Adding BSF jar to my "none-standard" installation did not make a  
difference :(. still getting CNF unless scripting*.mar copied as  
scripting*.jar into class path

Andrei

On Sep 17, 2007, at 10:20 AM, Andrei Tchijov wrote:

> Interestingly enough .... I have tried to deploy my "test" service  
> into "vanila" WAR based Axis2 installation and I am getting the  
> same CNF. Am I really missing something? Do modules require some  
> sort of activation to make they classes available ?
>
> Andrei
>
> On Sep 17, 2007, at 9:47 AM, Andrei Tchijov wrote:
>
>> Anthony,
>> 	This is part which baffles me.  I do have scripting-1.3.mar in my  
>> modules folder.
>>
>> 	Have tried your suggestion about renaming scripting-1.3.mar ->  
>> scripting-1.3.jar. Looks like it does work! Thanks.
>>
>> Andrei
>>
>> On Sep 17, 2007, at 8:47 AM, Anthony Elder wrote:
>>
>>>
>>> I've not tried this with Axis2 1.3 yet but you need to have the  
>>> scripting .mar in the Axis2 modules folder, or if you just need  
>>> the support for inline scripts (that you're showing below) then  
>>> you could try just renaming the .mar to a .jar and  putting it on  
>>> your classpath.
>>>
>>>        ...ant
>>>
>>> Please respond to axis-dev@ws.apache.org
>>>
>>> To:        axis-dev@ws.apache.org
>>> cc:
>>> Subject:        Re: Problems with using JavaScript with Axis2
>>>
>>>
>>> Hi Deepal,
>>>                 Thnx for quick response, but I find it hard to  
>>> believe that what you
>>> saying is true.  Looking into source code ( for
>>> org.apache.axis2.scripting.ScriptReceiver) it seems to me that it
>>> WILL work. The only problem is to resolve ClassNotFound exception,
>>> which I assume maybe result of my "none-standard" deployment of  
>>> Axis2.
>>>
>>> Andrei
>>>
>>>
>>>
>>> On Sep 17, 2007, at 6:57 AM, Deepal jayasinghe wrote:
>>>
>>> > hi Andrei ,
>>> > This will not work in Axis2 , you need to do additional stuff to
>>> > make js
>>> > in to a Web service. There is an open source product called "WSO2
>>> > Mashup
>>> > Server " , which has very good support for js (which is built on
>>> > Axis2 )
>>> > you may try that.
>>> >
>>> > Thanks
>>> > Deepal
>>> >> Hi,
>>> >>     I wonder if someone will have a sec to help me little bit?  I
>>> >> think I figured out how to employ JavaScript with Axis2.  I  
>>> guess key
>>> >> part is service.xml file. Mine version of it looks like this:
>>> >>
>>> >>
>>> >> <service name="MyTest">
>>> >>     <description>
>>> >>         This is just a Test
>>> >>     </description>
>>> >>     <operation name="Hello">
>>> >>     <parameter name="script.js"><![CDATA[
>>> >>         function invoke( inMC, outMC ) {
>>> >>             Packages.java.lang.System.out.println( " Hello  
>>> Axis2" );
>>> >>         }
>>> >>     ]]></parameter>
>>> >>         <messageReceiver
>>> >> class="org.apache.axis2.scripting.ScriptReceiver" />
>>> >>     </operation>
>>> >> </service>
>>> >>
>>> >> The problem is that I am getting CNF on
>>> >> org.apache.axis2.scripting.ScriptReceiver class (stack trace  
>>> at the
>>> >> end of the e-mail). I have noticed that ScriptReceiver is part of
>>> >> Scripting Module (scripting.mar). I guess the question is, do  
>>> I have
>>> >> to do anything special to make classes from modules available?
>>> >>
>>> >> Any help will be highly appreciated.
>>> >>
>>> >> Very Best regards,
>>> >>
>>> >> Andrei Tchijov
>>> >>
>>> >>
>>> >>
>>> >>
>>> >> org.apache.axis2.deployment.DeploymentException: A
>>> >> ClassNotFoundException error occurred in loading the message  
>>> receiver
>>> >> org.apache.axis2.scripting.ScriptReceiver
>>> >>         at
>>> >> org.apache.axis2.deployment.ServiceBuilder.populateService
>>> >> (ServiceBuilder.java:389)
>>> >>
>>> >>         at
>>> >>  
>>> org.apache.axis2.deployment.repository.util.ArchiveReader.buildServi 
>>> c
>>> >> eGroup(ArchiveReader.java:95)
>>> >>
>>> >>         at
>>> >>  
>>> org.apache.axis2.deployment.repository.util.ArchiveReader.processSer 
>>> v
>>> >> iceGroup(ArchiveReader.java:172)
>>> >>
>>> >>         at
>>> >> org.apache.axis2.deployment.ServiceDeployer.deploy
>>> >> (ServiceDeployer.java:78)
>>> >>
>>> >>         at
>>> >>  
>>> org.apache.axis2.deployment.repository.util.DeploymentFileData.deplo 
>>> y
>>> >> (DeploymentFileData.java:137)
>>> >>
>>> >>         at
>>> >> org.apache.axis2.deployment.DeploymentEngine.doDeploy
>>> >> (DeploymentEngine.java:571)
>>> >>
>>> >>         at
>>> >> org.apache.axis2.deployment.repository.util.WSInfoList.update
>>> >> (WSInfoList.java:141)
>>> >>
>>> >>         at
>>> >> org.apache.axis2.deployment.RepositoryListener.update
>>> >> (RepositoryListener.java:318)
>>> >>
>>> >>         at
>>> >> org.apache.axis2.deployment.RepositoryListener.checkServices
>>> >> (RepositoryListener.java:220)
>>> >>
>>> >>         at
>>> >> org.apache.axis2.deployment.DeploymentEngine.loadServices
>>> >> (DeploymentEngine.java:118)
>>> >>
>>> >>         at
>>> >> org.apache.axis2.deployment.WarBasedAxisConfigurator.loadServices
>>> >> (WarBasedAxisConfigurator.java:259)
>>> >>
>>> >>         at
>>> >>  
>>> org.apache.axis2.context.ConfigurationContextFactory.createConfigura 
>>> t
>>> >> ionContext(ConfigurationContextFactory.java:78)
>>> >>
>>> >>         at
>>> >> org.apache.axis2.transport.http.AxisServlet.initConfigContext
>>> >> (AxisServlet.java:500)
>>> >>
>>> >>         at
>>> >> org.apache.axis2.transport.http.AxisServlet.init 
>>> (AxisServlet.java:
>>> >> 420)
>>> >>         at
>>> >> org.mortbay.jetty.servlet.ServletHolder.initServlet
>>> >> (ServletHolder.java:378)
>>> >>
>>> >>         at
>>> >> org.mortbay.jetty.servlet.ServletHolder.getServlet
>>> >> (ServletHolder.java:324)
>>> >>
>>> >>         at
>>> >> org.mortbay.jetty.servlet.ServletHolder.handle 
>>> (ServletHolder.java:
>>> >> 400)
>>> >>         at
>>> >> org.mortbay.jetty.servlet.ServletHandler.handle
>>> >> (ServletHandler.java:355)
>>> >>         at
>>> >> org.mortbay.jetty.handler.ContextHandler.handle
>>> >> (ContextHandler.java:567)
>>> >>         at
>>> >> org.mortbay.jetty.handler.HandlerCollection.handle
>>> >> (HandlerCollection.java:126)
>>> >>
>>> >>         at
>>> >> org.mortbay.jetty.handler.HandlerWrapper.handle
>>> >> (HandlerWrapper.java:119)
>>> >>         at org.mortbay.jetty.Server.handle(Server.java:248)
>>> >>         at
>>> >> org.mortbay.jetty.HttpConnection.handlerRequest
>>> >> (HttpConnection.java:360)
>>> >>         at
>>> >> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete
>>> >> (HttpConnection.java:614)
>>> >>
>>> >>         at org.mortbay.jetty.HttpParser.parseNext 
>>> (HttpParser.java:
>>> >> 487)
>>> >>         at
>>> >> org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:197)
>>> >>         at
>>> >> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:288)
>>> >>         at
>>> >> org.mortbay.jetty.nio.SelectChannelConnector
>>> >> $HttpChannelEndPoint.run(SelectChannelConnector.java:805)
>>> >>
>>> >>         at
>>> >> org.mortbay.thread.BoundedThreadPool$PoolThread.run
>>> >> (BoundedThreadPool.java:475)
>>> >>
>>> >> Caused by: org.apache.axis2.deployment.DeploymentException: A
>>> >> ClassNotFoundException error occurred in loading the message  
>>> receiver
>>> >> org.apache.axis2.scripting.ScriptReceiver
>>> >>         at
>>> >>  
>>> org.apache.axis2.deployment.DescriptionBuilder.loadMessageReceiver
>>> >> (DescriptionBuilder.java:194)
>>> >>
>>> >>         at
>>> >> org.apache.axis2.deployment.ServiceBuilder.processOperations
>>> >> (ServiceBuilder.java:743)
>>> >>
>>> >>         at
>>> >> org.apache.axis2.deployment.ServiceBuilder.populateService
>>> >> (ServiceBuilder.java:316)
>>> >>
>>> >>         ... 28 more
>>> >> Caused by: java.lang.ClassNotFoundException:
>>> >> org.apache.axis2.scripting.ScriptReceiver
>>> >>         at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
>>> >>         at java.security.AccessController.doPrivileged(Native  
>>> Method)
>>> >>         at java.net.URLClassLoader.findClass 
>>> (URLClassLoader.java:188)
>>> >>         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
>>> >>         at sun.misc.Launcher$AppClassLoader.loadClass
>>> >> (Launcher.java:268)
>>> >>         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>>> >>         at java.lang.ClassLoader.loadClassInternal
>>> >> (ClassLoader.java:319)
>>> >>         at java.lang.Class.forName0(Native Method)
>>> >>         at java.lang.Class.forName(Class.java:164)
>>> >>         at org.apache.axis2.util.Loader.loadClass(Loader.java: 
>>> 261)
>>> >>         at org.apache.axis2.util.Loader.loadClass(Loader.java: 
>>> 229)
>>> >>         at
>>> >>  
>>> org.apache.axis2.deployment.DescriptionBuilder.loadMessageReceiver
>>> >> (DescriptionBuilder.java:190)
>>> >>
>>> >>         ... 30 more
>>> >>
>>> >>
>>> >>
>>> >>
>>> >>
>>> >>  
>>> -------------------------------------------------------------------- 
>>> -
>>> >> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
>>> >> For additional commands, e-mail: axis-dev-help@ws.apache.org
>>> >>
>>> >>
>>> >
>>> >
>>> >  
>>> -------------------------------------------------------------------- 
>>> -
>>> > To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
>>> > For additional commands, e-mail: axis-dev-help@ws.apache.org
>>> >
>>>
>>>
>>> -------------------------------------------------------------------- 
>>> -
>>> To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
>>> For additional commands, e-mail: axis-dev-help@ws.apache.org
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Unless stated otherwise above:
>>> IBM United Kingdom Limited - Registered in England and Wales with  
>>> number 741598.
>>> Registered office: PO Box 41, North Harbour, Portsmouth,  
>>> Hampshire PO6 3AU
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>


Mime
View raw message