jamurph | 15 May 14:52
Picon
Favicon

spring dwr configuration, init-params, SAXParseException


Hi,

I need to set an init parameter for DwrServlet but we are initialising the
DWR in spring and not in web.xml

this is a snippet of code and error message

can anyone help?

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
       http://www.directwebremoting.org/schema/spring-dwr
http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd
       http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"
       default-autowire="byName">

    <dwr:controller id="dwrController" debug="false">
        <dwr:config-param name="allowGetForSafariButMakeForgeryEasier"
value="true"/>
    </dwr:controller>

2008-05-15 13:29:14,328 ERROR
[org.springframework.web.servlet.DispatcherServlet] - <Context
initialization failed>
(Continue reading)

Jose Noheda | 15 May 15:00
Picon

Re: spring dwr configuration, init-params, SAXParseException

IIRC the syntax should be <dwr:param ...>

On Thu, May 15, 2008 at 2:55 PM, jamurph <tony_murphy-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:


Hi,

I need to set an init parameter for DwrServlet but we are initialising the
DWR in spring and not in web.xml

this is a snippet of code and error message

can anyone help?


<beans xmlns="http://www.springframework.org/schema/beans"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:aop="http://www.springframework.org/schema/aop"
      xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
      xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
      http://www.directwebremoting.org/schema/spring-dwr
http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd
      http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"
      default-autowire="byName">

   <dwr:controller id="dwrController" debug="false">
       <dwr:config-param name="allowGetForSafariButMakeForgeryEasier"
value="true"/>
   </dwr:controller>


2008-05-15 13:29:14,328 ERROR
[org.springframework.web.servlet.DispatcherServlet] - <Context
initialization failed>
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line
224 in XML document from ServletContext resource [/WEB-INF/tin-servlet.xml]
is invalid; nested exception is org.xml.sax.SAXParseException:
cvc-complex-type.2.1: Element 'dwr:controller' must have no character or
element information item [children], because the type's content type is
empty.
Caused by:
org.xml.sax.SAXParseException: cvc-complex-type.2.1: Element
'dwr:controller' must have no character or element information item
[children], because the type's content type is empty.
       at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)



--
View this message in context: http://www.nabble.com/spring-dwr-configuration%2C-init-params%2C-SAXParseException-tp17252608p17252608.html
Sent from the DWR - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe-EyPigyGktj4FDOXUYO6UHQ@public.gmane.org
For additional commands, e-mail: users-help-EyPigyGktj4FDOXUYO6UHQ@public.gmane.org


jamurph | 15 May 15:13
Picon
Favicon

Re: spring dwr configuration, init-params, SAXParseException


XMaNIaC wrote:
> 
> IIRC the syntax should be <dwr:param ...>
> 

Hi, tried that, but got xml validation fails. 

http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd

does suggest dwr:config-param is correct?
--

-- 
View this message in context: http://www.nabble.com/spring-dwr-configuration%2C-init-params%2C-SAXParseException-tp17252608p17252959.html
Sent from the DWR - Users mailing list archive at Nabble.com.
jamurph | 16 Jun 13:38
Picon
Favicon

Re: spring dwr configuration, init-params, SAXParseException


It doesn't look like I can set an init parameter using spring context. Anyone
know of any other means of setting an parameter other than reverting to
moving DWR into web.xml

XMaNIaC wrote:
> 
> IIRC the syntax should be <dwr:param ...>
> 
> On Thu, May 15, 2008 at 2:55 PM, jamurph <tony_murphy@...> wrote:
> 
>>
>>
>> Hi,
>>
>> I need to set an init parameter for DwrServlet but we are initialising
>> the
>> DWR in spring and not in web.xml
>>
>> this is a snippet of code and error message
>>
>> can anyone help?
>>
>>
>> <beans xmlns="http://www.springframework.org/schema/beans"
>>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>       xmlns:aop="http://www.springframework.org/schema/aop"
>>       xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
>>       xsi:schemaLocation="http://www.springframework.org/schema/beans
>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>>       http://www.directwebremoting.org/schema/spring-dwr
>> http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd
>>       http://www.springframework.org/schema/aop
>> http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"
>>       default-autowire="byName">
>>
>>    <dwr:controller id="dwrController" debug="false">
>>        <dwr:config-param name="allowGetForSafariButMakeForgeryEasier"
>> value="true"/>
>>    </dwr:controller>
>>
>>
>> 2008-05-15 13:29:14,328 ERROR
>> [org.springframework.web.servlet.DispatcherServlet] - <Context
>> initialization failed>
>> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
>> Line
>> 224 in XML document from ServletContext resource
>> [/WEB-INF/tin-servlet.xml]
>> is invalid; nested exception is org.xml.sax.SAXParseException:
>> cvc-complex-type.2.1: Element 'dwr:controller' must have no character or
>> element information item [children], because the type's content type is
>> empty.
>> Caused by:
>> org.xml.sax.SAXParseException: cvc-complex-type.2.1: Element
>> 'dwr:controller' must have no character or element information item
>> [children], because the type's content type is empty.
>>        at
>> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
>> Source)
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/spring-dwr-configuration%2C-init-params%2C-SAXParseException-tp17252608p17252608.html
>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@...
>> For additional commands, e-mail: users-help@...
>>
>>
> 
> 

--

-- 
View this message in context: http://www.nabble.com/spring-dwr-configuration%2C-init-params%2C-SAXParseException-tp17252608p17862424.html
Sent from the DWR - Users mailing list archive at Nabble.com.
Lance Java | 16 Jun 13:50

Re: spring dwr configuration, init-params, SAXParseException

Can't you just put your init-params to the DWR servlet in web.xml?

Otherwise... init params are basically proxied through to DefaultContainer.addParameter(String, Object)
You would need to get a handle on the container using ContainerUtil.getAllPublishedContainers()
All this should be easy enough to do with spring.

Cheers,
Lance.

2008/6/16 jamurph <tony_murphy-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>:

It doesn't look like I can set an init parameter using spring context. Anyone
know of any other means of setting an parameter other than reverting to
moving DWR into web.xml



XMaNIaC wrote:
>
> IIRC the syntax should be <dwr:param ...>
>
> On Thu, May 15, 2008 at 2:55 PM, jamurph <tony_murphy-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:
>
>>
>>
>> Hi,
>>
>> I need to set an init parameter for DwrServlet but we are initialising
>> the
>> DWR in spring and not in web.xml
>>
>> this is a snippet of code and error message
>>
>> can anyone help?
>>
>>
>> <beans xmlns="http://www.springframework.org/schema/beans"
>>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>       xmlns:aop="http://www.springframework.org/schema/aop"
>>       xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
>>       xsi:schemaLocation="http://www.springframework.org/schema/beans
>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>>       http://www.directwebremoting.org/schema/spring-dwr
>> http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd
>>       http://www.springframework.org/schema/aop
>> http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"
>>       default-autowire="byName">
>>
>>    <dwr:controller id="dwrController" debug="false">
>>        <dwr:config-param name="allowGetForSafariButMakeForgeryEasier"
>> value="true"/>
>>    </dwr:controller>
>>
>>
>> 2008-05-15 13:29:14,328 ERROR
>> [org.springframework.web.servlet.DispatcherServlet] - <Context
>> initialization failed>
>> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
>> Line
>> 224 in XML document from ServletContext resource
>> [/WEB-INF/tin-servlet.xml]
>> is invalid; nested exception is org.xml.sax.SAXParseException:
>> cvc-complex-type.2.1: Element 'dwr:controller' must have no character or
>> element information item [children], because the type's content type is
>> empty.
>> Caused by:
>> org.xml.sax.SAXParseException: cvc-complex-type.2.1: Element
>> 'dwr:controller' must have no character or element information item
>> [children], because the type's content type is empty.
>>        at
>> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
>> Source)
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/spring-dwr-configuration%2C-init-params%2C-SAXParseException-tp17252608p17252608.html
>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe-EyPigyGktj4FDOXUYO6UHQ@public.gmane.org
>> For additional commands, e-mail: users-help-EyPigyGktj4FDOXUYO6UHQ@public.gmane.org
>>
>>
>
>

--
View this message in context: http://www.nabble.com/spring-dwr-configuration%2C-init-params%2C-SAXParseException-tp17252608p17862424.html
Sent from the DWR - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe-EyPigyGktj4FDOXUYO6UHQ@public.gmane.org
For additional commands, e-mail: users-help-EyPigyGktj4FDOXUYO6UHQ@public.gmane.org


Jose Noheda | 16 Jun 14:40
Picon

Re: spring dwr configuration, init-params, SAXParseException

I'm pretty sure you can do it but I can't access the schema right now so I'm unsure about the syntax but it shoudl be something along the lines of:

<dwr:configuration>
   <dwr:init>
     <dwr:param name="x" value="1" />
   </dwr:init>
</dwr:configuration>

Regards,

On Mon, Jun 16, 2008 at 1:38 PM, jamurph <tony_murphy-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:

It doesn't look like I can set an init parameter using spring context. Anyone
know of any other means of setting an parameter other than reverting to
moving DWR into web.xml



XMaNIaC wrote:
>
> IIRC the syntax should be <dwr:param ...>
>
> On Thu, May 15, 2008 at 2:55 PM, jamurph <tony_murphy-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:
>
>>
>>
>> Hi,
>>
>> I need to set an init parameter for DwrServlet but we are initialising
>> the
>> DWR in spring and not in web.xml
>>
>> this is a snippet of code and error message
>>
>> can anyone help?
>>
>>
>> <beans xmlns="http://www.springframework.org/schema/beans"
>>       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>       xmlns:aop="http://www.springframework.org/schema/aop"
>>       xmlns:dwr="http://www.directwebremoting.org/schema/spring-dwr"
>>       xsi:schemaLocation="http://www.springframework.org/schema/beans
>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>>       http://www.directwebremoting.org/schema/spring-dwr
>> http://www.directwebremoting.org/schema/spring-dwr-2.0.xsd
>>       http://www.springframework.org/schema/aop
>> http://www.springframework.org/schema/aop/spring-aop-2.0.xsd"
>>       default-autowire="byName">
>>
>>    <dwr:controller id="dwrController" debug="false">
>>        <dwr:config-param name="allowGetForSafariButMakeForgeryEasier"
>> value="true"/>
>>    </dwr:controller>
>>
>>
>> 2008-05-15 13:29:14,328 ERROR
>> [org.springframework.web.servlet.DispatcherServlet] - <Context
>> initialization failed>
>> org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:
>> Line
>> 224 in XML document from ServletContext resource
>> [/WEB-INF/tin-servlet.xml]
>> is invalid; nested exception is org.xml.sax.SAXParseException:
>> cvc-complex-type.2.1: Element 'dwr:controller' must have no character or
>> element information item [children], because the type's content type is
>> empty.
>> Caused by:
>> org.xml.sax.SAXParseException: cvc-complex-type.2.1: Element
>> 'dwr:controller' must have no character or element information item
>> [children], because the type's content type is empty.
>>        at
>> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
>> Source)
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/spring-dwr-configuration%2C-init-params%2C-SAXParseException-tp17252608p17252608.html
>> Sent from the DWR - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe-EyPigyGktj4FDOXUYO6UHQ@public.gmane.org
>> For additional commands, e-mail: users-help-EyPigyGktj4FDOXUYO6UHQ@public.gmane.org
>>
>>
>
>

--
View this message in context: http://www.nabble.com/spring-dwr-configuration%2C-init-params%2C-SAXParseException-tp17252608p17862424.html
Sent from the DWR - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe-EyPigyGktj4FDOXUYO6UHQ@public.gmane.org
For additional commands, e-mail: users-help-EyPigyGktj4FDOXUYO6UHQ@public.gmane.org


jamurph | 16 Jun 17:10
Picon
Favicon

Re: spring dwr configuration, init-params, SAXParseException


tried and doesn't work i'm afraid

XMaNIaC wrote:
> 
> I'm pretty sure you can do it but I can't access the schema right now so
> I'm
> unsure about the syntax but it shoudl be something along the lines of:
> 
> <dwr:configuration>
>    <dwr:init>
>      <dwr:param name="x" value="1" />
>    </dwr:init>
> </dwr:configuration>
> 
> 
> 

--

-- 
View this message in context: http://www.nabble.com/spring-dwr-configuration%2C-init-params%2C-SAXParseException-tp17252608p17866565.html
Sent from the DWR - Users mailing list archive at Nabble.com.
jamurph | 16 Jun 17:22
Picon
Favicon

Re: spring dwr configuration, init-params, SAXParseException


adding this to spring servlet context seemed to do the job

   <bean name="allowGetForSafariButMakeForgeryEasier"
class="java.lang.String">
        <constructor-arg index="0">
            <value>true</value>
        </constructor-arg>
    </bean>

found this thread which had answer in it

http://www.nabble.com/dwr-with-Spring-and-init-parameters-td8902818.html#a8902818
--

-- 
View this message in context: http://www.nabble.com/spring-dwr-configuration%2C-init-params%2C-SAXParseException-tp17252608p17866863.html
Sent from the DWR - Users mailing list archive at Nabble.com.
Jose Noheda | 17 Jun 08:18
Picon

Re: spring dwr configuration, init-params, SAXParseException

Yes, but I'm afraid that approach will probably not work on v3. Could you confirm it? If you can post a sample project I'll try to see where the configuration is failing.

On Mon, Jun 16, 2008 at 5:22 PM, jamurph <tony_murphy-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:


adding this to spring servlet context seemed to do the job

  <bean name="allowGetForSafariButMakeForgeryEasier"
class="java.lang.String">
       <constructor-arg index="0">
           <value>true</value>
       </constructor-arg>
   </bean>

found this thread which had answer in it

http://www.nabble.com/dwr-with-Spring-and-init-parameters-td8902818.html#a8902818
--
View this message in context: http://www.nabble.com/spring-dwr-configuration%2C-init-params%2C-SAXParseException-tp17252608p17866863.html
Sent from the DWR - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe-EyPigyGktj4FDOXUYO6UHQ@public.gmane.org
For additional commands, e-mail: users-help-EyPigyGktj4FDOXUYO6UHQ@public.gmane.org


Jose Noheda | 20 Jun 17:05
Picon

Re: spring dwr configuration, init-params, SAXParseException

A quick look revealed a

public void setConfigParams(Map<String, String> configParams)

in DWRController class. Try setting them that way please

Regards,

On Tue, Jun 17, 2008 at 8:18 AM, Jose Noheda <jose.noheda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
Yes, but I'm afraid that approach will probably not work on v3. Could you confirm it? If you can post a sample project I'll try to see where the configuration is failing.


On Mon, Jun 16, 2008 at 5:22 PM, jamurph <tony_murphy-/E1597aS9LQAvxtiuMwx3w@public.gmane.org> wrote:


adding this to spring servlet context seemed to do the job

  <bean name="allowGetForSafariButMakeForgeryEasier"
class="java.lang.String">
       <constructor-arg index="0">
           <value>true</value>
       </constructor-arg>
   </bean>

found this thread which had answer in it

http://www.nabble.com/dwr-with-Spring-and-init-parameters-td8902818.html#a8902818
--
View this message in context: http://www.nabble.com/spring-dwr-configuration%2C-init-params%2C-SAXParseException-tp17252608p17866863.html
Sent from the DWR - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe-EyPigyGktj4FDOXUYO6UHQ@public.gmane.org
For additional commands, e-mail: users-help-EyPigyGktj4FDOXUYO6UHQ@public.gmane.org




Gmane