synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wes Thielke (JIRA)" <j...@apache.org>
Subject [jira] Updated: (SYNAPSE-210) Exception initializing inline script with localentry XSLT
Date Thu, 03 Jan 2008 16:57:34 GMT

     [ https://issues.apache.org/jira/browse/SYNAPSE-210?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Wes Thielke updated SYNAPSE-210:
--------------------------------


I have further information on this issue. The problem occurs when a <registry> is defined
AND there is javascript in a sequence. I reproduced this by inserting the following sequence
into the sample8 xml file just before the </definitions>:

  <sequence name="text_proxy">
      <header name="Action" value="urn:placeOrder"/>
      <script language="js">
          <![CDATA[
                var args = mc.getPayloadXML().toString().split(" ");
                mc.setPayloadXML(
                <m:placeOrder xmlns:m="http://services.samples/xsd">
                    <m:order>
                        <m:price>{args[0]}</m:price>
                        <m:quantity>{args[1]}</m:quantity>
                        <m:symbol>{args[2]}</m:symbol>
                    </m:order>
                </m:placeOrder>);
            ]]>
      </script>

      <property action="set" name="OUT_ONLY" value="false"/>
      <send>
            <endpoint>
                <address uri="http://localhost:9000/soap/SimpleStockQuoteService"/>
            </endpoint>
      </send>
    </sequence>

If I remove the <registry> definition from my original xml file, the problem does not
occur. Likewise, if I leave the registry definition but remove the sequences with the javascript,
the problem does not occur. I can duplicate this with the sample8 file and the inserted sequence
with javascript. The registry is not being used in my xml file and, so, would appear to be
innocuous, but when present, it makes the javascript parsing fail.

--Wes

> Exception initializing inline script with localentry XSLT
> ---------------------------------------------------------
>
>                 Key: SYNAPSE-210
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-210
>             Project: Synapse
>          Issue Type: Bug
>    Affects Versions: 1.1
>         Environment: WIndows XP SP2, JDK 1.6.0.3
>            Reporter: Wes Thielke
>
> Synapse reports "Exception initializing inline script" on startup, but no clues as to
what the problem is. Isolated to a localentry pointing to an XSLT file.
> Log excerpt:
> 2007-12-21 10:36:16,748 [10.1.0.213-NJL012] [main] ERROR SynapseConfigurationBuilder
Could not initialize Synapse : Exception initializing inline script
> org.apache.synapse.SynapseException: Exception initializing inline script
> 	at org.apache.synapse.mediators.bsf.ScriptMediator.initInlineScript(ScriptMediator.java:277)
> 	at org.apache.synapse.mediators.bsf.ScriptMediator.<init>(ScriptMediator.java:114)
> 	at org.apache.synapse.mediators.bsf.ScriptMediatorFactory.createMediator(ScriptMediatorFactory.java:86)
> 	at org.apache.synapse.config.xml.MediatorFactoryFinder.getMediator(MediatorFactoryFinder.java:184)
> 	at org.apache.synapse.config.xml.AbstractListMediatorFactory.addChildren(AbstractListMediatorFactory.java:42)
> 	at org.apache.synapse.config.xml.SequenceMediatorFactory.createMediator(SequenceMediatorFactory.java:93)
> 	at org.apache.synapse.config.xml.MediatorFactoryFinder.getMediator(MediatorFactoryFinder.java:184)
> 	at org.apache.synapse.config.xml.SynapseXMLConfigurationFactory.defineSequence(SynapseXMLConfigurationFactory.java:168)
> 	at org.apache.synapse.config.xml.SynapseXMLConfigurationFactory.getConfiguration(SynapseXMLConfigurationFactory.java:75)
> 	at org.apache.synapse.config.xml.ConfigurationFactoryAndSerializerFinder.getConfiguration(ConfigurationFactoryAndSerializerFinder.java:160)
> 	at org.apache.synapse.config.xml.XMLConfigurationBuilder.getConfiguration(XMLConfigurationBuilder.java:46)
> 	at org.apache.synapse.config.SynapseConfigurationBuilder.getConfiguration(SynapseConfigurationBuilder.java:73)
> 	at org.apache.synapse.core.axis2.SynapseInitializationModule.getConfiguration(SynapseInitializationModule.java:134)
> 	at org.apache.synapse.core.axis2.SynapseInitializationModule.init(SynapseInitializationModule.java:84)
> 	at org.apache.axis2.context.ConfigurationContextFactory.initModules(ConfigurationContextFactory.java:222)
> 	at org.apache.axis2.context.ConfigurationContextFactory.init(ConfigurationContextFactory.java:200)
> 	at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:76)
> 	at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(ConfigurationContextFactory.java:180)
> 	at org.apache.synapse.ServerManager.start(ServerManager.java:76)
> 	at org.apache.synapse.SynapseServer.main(SynapseServer.java:49)
> Caused by: javax.script.ScriptException: sun.org.mozilla.javascript.internal.EvaluatorException:
syntax error (<Unknown Source>#5)
> 	at com.sun.script.javascript.RhinoScriptEngine.compile(RhinoScriptEngine.java:272)
> 	at com.sun.script.javascript.RhinoScriptEngine.compile(RhinoScriptEngine.java:254)
> 	at org.apache.synapse.mediators.bsf.ScriptMediator.initInlineScript(ScriptMediator.java:266)
> 	... 19 more
> Caused by: sun.org.mozilla.javascript.internal.EvaluatorException: syntax error (<Unknown
Source>#5)
> 	at sun.org.mozilla.javascript.internal.DefaultErrorReporter.runtimeError(DefaultErrorReporter.java:84)
> 	at sun.org.mozilla.javascript.internal.DefaultErrorReporter.error(DefaultErrorReporter.java:71)
> 	at sun.org.mozilla.javascript.internal.Parser.addError(Parser.java:111)
> 	at sun.org.mozilla.javascript.internal.Parser.reportError(Parser.java:117)
> 	at sun.org.mozilla.javascript.internal.Parser.primaryExpr(Parser.java:2002)
> 	at sun.org.mozilla.javascript.internal.Parser.memberExpr(Parser.java:1629)
> 	at sun.org.mozilla.javascript.internal.Parser.unaryExpr(Parser.java:1492)
> 	at sun.org.mozilla.javascript.internal.Parser.mulExpr(Parser.java:1421)
> 	at sun.org.mozilla.javascript.internal.Parser.addExpr(Parser.java:1402)
> 	at sun.org.mozilla.javascript.internal.Parser.shiftExpr(Parser.java:1382)
> 	at sun.org.mozilla.javascript.internal.Parser.relExpr(Parser.java:1356)
> 	at sun.org.mozilla.javascript.internal.Parser.eqExpr(Parser.java:1312)
> 	at sun.org.mozilla.javascript.internal.Parser.bitAndExpr(Parser.java:1301)
> 	at sun.org.mozilla.javascript.internal.Parser.bitXorExpr(Parser.java:1290)
> 	at sun.org.mozilla.javascript.internal.Parser.bitOrExpr(Parser.java:1279)
> 	at sun.org.mozilla.javascript.internal.Parser.andExpr(Parser.java:1267)
> 	at sun.org.mozilla.javascript.internal.Parser.orExpr(Parser.java:1255)
> 	at sun.org.mozilla.javascript.internal.Parser.condExpr(Parser.java:1238)
> 	at sun.org.mozilla.javascript.internal.Parser.assignExpr(Parser.java:1220)
> 	at sun.org.mozilla.javascript.internal.Parser.argumentList(Parser.java:1584)
> 	at sun.org.mozilla.javascript.internal.Parser.memberExprTail(Parser.java:1717)
> 	at sun.org.mozilla.javascript.internal.Parser.memberExpr(Parser.java:1632)
> 	at sun.org.mozilla.javascript.internal.Parser.unaryExpr(Parser.java:1492)
> 	at sun.org.mozilla.javascript.internal.Parser.mulExpr(Parser.java:1421)
> 	at sun.org.mozilla.javascript.internal.Parser.addExpr(Parser.java:1402)
> 	at sun.org.mozilla.javascript.internal.Parser.shiftExpr(Parser.java:1382)
> 	at sun.org.mozilla.javascript.internal.Parser.relExpr(Parser.java:1356)
> 	at sun.org.mozilla.javascript.internal.Parser.eqExpr(Parser.java:1312)
> 	at sun.org.mozilla.javascript.internal.Parser.bitAndExpr(Parser.java:1301)
> 	at sun.org.mozilla.javascript.internal.Parser.bitXorExpr(Parser.java:1290)
> 	at sun.org.mozilla.javascript.internal.Parser.bitOrExpr(Parser.java:1279)
> 	at sun.org.mozilla.javascript.internal.Parser.andExpr(Parser.java:1267)
> 	at sun.org.mozilla.javascript.internal.Parser.orExpr(Parser.java:1255)
> 	at sun.org.mozilla.javascript.internal.Parser.condExpr(Parser.java:1238)
> 	at sun.org.mozilla.javascript.internal.Parser.assignExpr(Parser.java:1220)
> 	at sun.org.mozilla.javascript.internal.Parser.expr(Parser.java:1209)
> 	at sun.org.mozilla.javascript.internal.Parser.statementHelper(Parser.java:1096)
> 	at sun.org.mozilla.javascript.internal.Parser.statement(Parser.java:608)
> 	at sun.org.mozilla.javascript.internal.Parser.parse(Parser.java:340)
> 	at sun.org.mozilla.javascript.internal.Parser.parse(Parser.java:299)
> 	at sun.org.mozilla.javascript.internal.Context.compileImpl(Context.java:2179)
> 	at sun.org.mozilla.javascript.internal.Context.compileReader(Context.java:1235)
> 	at sun.org.mozilla.javascript.internal.Context.compileReader(Context.java:1207)
> 	at com.sun.script.javascript.RhinoScriptEngine.compile(RhinoScriptEngine.java:268)
> 	... 21 more
> 2007-12-21 10:36:16,763 [10.1.0.213-NJL012] [main] FATAL ServerManager Startup failed...
> The synapse.xml:
> <!--
>   ~  Licensed to the Apache Software Foundation (ASF) under one
>   ~  or more contributor license agreements.  See the NOTICE file
>   ~  distributed with this work for additional information
>   ~  regarding copyright ownership.  The ASF licenses this file
>   ~  to you under the Apache License, Version 2.0 (the
>   ~  "License"); you may not use this file except in compliance
>   ~  with the License.  You may obtain a copy of the License at
>   ~
>   ~   http://www.apache.org/licenses/LICENSE-2.0
>   ~
>   ~  Unless required by applicable law or agreed to in writing,
>   ~  software distributed under the License is distributed on an
>   ~   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>   ~  KIND, either express or implied.  See the License for the
>   ~  specific language governing permissions and limitations
>   ~  under the License.
>   -->
>     
> <!-- Pure text/binary and POX message support with JMS -->
> <definitions xmlns="http://ws.apache.org/ns/synapse">
>   <log level="full" />
>   
>   <!-- define the request processing XSLT resource as a static URL source -->
>   <localEntry key="xslt-key-req" src="file:repository/conf/sample/resources/transform/transform_quote_response_to_text.xslt"/>
>   <sequence name="text_proxy">
>       <header name="Action" value="urn:placeOrder"/>
>       <script language="js">
>       <![CDATA[
>             var args = mc.getPayloadXML().toString().split(" ");
>             mc.setPayloadXML(
>             <m:placeOrder xmlns:m="http://services.samples/xsd">
>                 <m:order>
>                     <m:price>{args[0]}</m:price>
>                     <m:quantity>{args[1]}</m:quantity>
>                     <m:symbol>{args[2]}</m:symbol>
>                 </m:order>
>             </m:placeOrder>);
>         ]]></script>
>         <property action="set" name="OUT_ONLY" value="false"/>
>         <send>
>             <endpoint>
>                 <address uri="http://localhost:9000/soap/SimpleStockQuoteService"/>
>             </endpoint>
>         </send>
>     </sequence>
>     <sequence name="text_stockquote_proxy">
>       <header name="Action" value="urn:getQuote"/>
>       <script language="js">
>         <![CDATA[
>               var args = mc.getPayloadXML().toString().split(" ");
>               mc.setPayloadXML(
>               <m:getQuote xmlns:m="http://services.samples/xsd">
>                   <m:request>
>                       <m:symbol>{args[0]}</m:request>
>                   </m:request>    
>               </m:getQuote>);
>           ]]>
>       </script>
>       <property action="set" name="OUT_ONLY" value="false"/>
>       <send>
>         <endpoint>
>           <address uri="http://localhost:9000/soap/SimpleStockQuoteService"/>
>         </endpoint>
>       </send>
>     </sequence>
>     <sequence name="mtom_proxy">
>         <property action="set" name="OUT_ONLY" value="true"/>
>         <header name="Action" value="urn:oneWayUploadUsingMTOM"/>
>         <send>
>             <endpoint>
>                 <address uri="http://localhost:9000/soap/MTOMSwASampleService" optimize="mtom"/>
>             </endpoint>
>         </send>
>     </sequence>
>     <sequence name="pox_proxy">
>         <property action="set" name="OUT_ONLY" value="true"/>
>         <header name="Action" value="urn:placeOrder"/>
>         <send>
>             <endpoint>
>                 <address uri="http://localhost:9000/soap/SimpleStockQuoteService"
format="soap11"/>
>             </endpoint>
>         </send>
>     </sequence>
> 	  <sequence name="out">
> 		    <send/>
> 	  </sequence>
>     <sequence name="outjms">
>         <send>
> 	          <endpoint>
> 			          <address uri="jms:/JMSTextProxyResponses?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;java.naming.provider.url=tcp://localhost:61616"/>
>             </endpoint>
>         </send> 
>     </sequence>
>     <proxy name="JMSFileUploadProxyRequests" transports="jms">
>         <target inSequence="mtom_proxy" outSequence="out"/>
>         <parameter name="transport.jms.Wrapper">{http://services.samples/xsd}element</parameter>
>     </proxy>
>     <proxy name="JMSTextProxyRequests" transports="jms">
>         <target inSequence="text_proxy" outSequence="outjms"/>
>         <parameter name="transport.jms.Wrapper">{http://services.samples/xsd}text</parameter>
>     </proxy>
>     <proxy name="JMSStockQuoteRequests" transports="jms">
>       <target inSequence="text_stockquote_proxy" outSequence="outjms"/>
>       <parameter name="transport.jms.Wrapper">{http://services.samples/xsd}text</parameter>
>     </proxy>
>     <proxy name="JMSPoxProxyRequests" transports="jms">
>         <target inSequence="pox_proxy" outSequence="out"/>
>     </proxy>
> </definitions>
> The XSLT file:
> <xsl:stylesheet version="1.0" 
> 	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>   xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"                
> 	xmlns:ns="http://services.samples/xsd"
> 	>
> 	<xsl:output omit-xml-declaration="yes"/>
>   <xsl:template match="ns:getQuoteResponse" >
>     <xsl:text>getQuoteResponse&#10;</xsl:text>
>     <xsl:text>change= </xsl:text><xsl:value-of select="ns:return/ns:change"/><xsl:text>&#10;</xsl:text>
>     <xsl:text>earnings= </xsl:text><xsl:value-of select="ns:return/ns:earnings"/><xsl:text>&#10;</xsl:text>
>     <xsl:text>high= </xsl:text><xsl:value-of select="ns:return/ns:high"/><xsl:text>&#10;</xsl:text>
>     <xsl:text>last= </xsl:text><xsl:value-of select="ns:return/ns:last"/><xsl:text>&#10;</xsl:text>
>     <xsl:text>lastTradeTimestamp= </xsl:text><xsl:value-of select="ns:return/ns:lastTradeTimestamp"/><xsl:text>&#10;</xsl:text>
>     <xsl:text>low= </xsl:text><xsl:value-of select="ns:return/ns:low"/><xsl:text>&#10;</xsl:text>
>     <xsl:text>marketCap= </xsl:text><xsl:value-of select="ns:return/ns:marketCap"/><xsl:text>&#10;</xsl:text>
>     <xsl:text>name= </xsl:text><xsl:value-of select="ns:return/ns:name"/><xsl:text>&#10;</xsl:text>
>     <xsl:text>open= </xsl:text><xsl:value-of select="ns:return/ns:open"/><xsl:text>&#10;</xsl:text>
>     <xsl:text>peRatio= </xsl:text><xsl:value-of select="ns:return/ns:peRatio"/><xsl:text>&#10;</xsl:text>
>     <xsl:text>persentageChange= </xsl:text><xsl:value-of select="ns:return/ns:percentageChange"/><xsl:text>&#10;</xsl:text>
>     <xsl:text>prevClose= </xsl:text><xsl:value-of select="ns:return/ns:prevClose"/><xsl:text>&#10;</xsl:text>
>     <xsl:text>symbol= </xsl:text><xsl:value-of select="ns:return/ns:symbol"/><xsl:text>&#10;</xsl:text>
>     <xsl:text>volume= </xsl:text><xsl:value-of select="ns:return/ns:volume"/><xsl:text>&#10;</xsl:text>
>   </xsl:template>
> </xsl:stylesheet>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-dev-help@ws.apache.org


Mime
View raw message