May 21

If you do not want to store your log4j configuration in your classes directory then you need to tell log4j where it can find it.

One possibility is to configure it in your applicationContext.xml as shown here

<bean id="log4jInitialization"
 class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">
   <property name="targetClass"
      value="org.springframework.util.Log4jConfigurer" />
   <property name="targetMethod" value="initLogging" />
   <property name="arguments">
      <list>
         <value>conf/log4j.xml</value>
      </list>
   </property>
</bean>

If you are running your web application as an expanded war then another option is to use a listener in your web.xml. This will only work on an unexpanded war.

<context-param>
    <param-name>log4jConfigLocation</param-name>
    <param-value>/WEB-INF/resources/log4j.properties</param-value>
</context-param>
<context-param>
    <param-name>log4jRefreshInterval</param-name>
    <param-value>1000</param-value>
</context-param>
<listener>
    <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>

written by objects \\ tags:

Dec 10

This error occurs because the File Protocol has not been added to your Restlet Component.

How to add a Protocol to your Restlet application using Spring is explained here.

written by objects \\ tags: , ,

Dec 10

To add a single Protocol you can set the client property of the Component to the required Protocol. For example to wire up a Component and add the file:// protocol you would use the following.

   <bean id="component" class="org.restlet.ext.spring.SpringComponent">
      <property name="server">
         <bean class="org.restlet.ext.spring.SpringServer">
            <constructor-arg value="http" />
            <constructor-arg value="8080" />
         </bean>
      </property>
      <property name="client">
         <util:constant static-field="org.restlet.data.Protocol.FILE"/>
      </property>
      <property name="defaultTarget" ref="router" />
</bean>

written by objects \\ tags: , ,