First, we should define the location of the log4j config file or log4j property file. We define it in our web.xml
<context-param>
<param-name>log4jConfigLocation</param-name>
<param-value>/WEB-INF/log4j.properties</param-value>
</context-param>
After that we add event declaration usign the <listener> element. This will be invoked when the event is occured. The <listener> element should be placed between <filter-mapping> and <servlet> elements.
<listener>
<listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
</listener>
someJavaClass.java
public class someJavaClass {
private static Log log = LogFactory.getLog(someJavaClass.class);
}
In the log4j.properties define the log properties you want to display such as
log4j.rootLogger = DEBUG
log4j.appender.site = org.apache.log4j.FileAppender
log4j.appender.site.file = C:yourLogFile.log
log4j.appender.site.layout = org.apache.log4j.PatternLayout
log4j.appender.site.layout.conversionPattern = %d [%t] %-5p %c - %m%n
log4j.appender.site.append = false
For some reason, my port 8080 is blocked. I dont know how and why. But it does happen. Till now, I still could not fix it. What a drag! ![]()
Therefore, as we know the default cms port is 8080. And for some minutes, I could not run my hippo cms. So, I trie to change the jetty port by typing:
$ -Djetty.port=8999
but it still does not work, so there must be a configuration that define the jetty port. And it is in pom.xml so change the port to every number you want.
<configuration>
<stopPort>9966</stopPort>
<stopKey>stopCmsJetty</stopKey>
<scanIntervalSeconds>5</scanIntervalSeconds>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>9999</port>
</connector>
</connectors>
<contextPath>/cms</contextPath>
</configuration>
Success!
![]()
When i am starting to use hippo, I start adding pages, components, and other stuff. And sometimes, I do "mvn clean install" ...which is bad...because it will remove all the changes I have added to it.
So, to prevent it I configure the repository directory. Therefore, I will not lose anything I have added to the hippo cms everytime I do "mvn clean install"
So go to the web.xml of cms folder
Change the param-value of param-name "repository-directory"
In this case, it is changed to file:///C:/yourworkrepositorydirectoryfolder
<servlet>
<servlet-name>Repository</servlet-name>
<servlet-class>org.hippoecm.repository.RepositoryServlet</servlet-class>
<init-param>
<param-name>repository-directory</param-name>
<param-value>file:///C:/yourworkrepositorydirectoryfolder</param-value>
<description>The (relative) location where to store files</description>
</init-param>
<init-param>
<param-name>repository-config</param-name>
<param-value>repository.xml</param-value>
<description>The location of the repository configuration file. Unless the location
starts with file://, the location is retrieved from within the application package as
resource.</description>
</init-param>
<load-on-startup>4</load-on-startup>
</servlet>
Quartz is an open source job scheduling system that can be integrated with, or used along side virtually any J2EE or J2SE application - from the smallest stand-alone application to the largest e-commerce system (definition taken from http://www.opensymphony.com/quartz/)
<bean id="jobDetail"
class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
<property name="targetObject" ref="yourObject" />
<property name="targetMethod" value="yourMethod" />
</bean>
<bean id="simpleTrigger" class="org.springframework.scheduling.quartz.SimpleTriggerBean">
<property name="jobDetail" ref="jobDetail" />
<property name="startDelay" value="1000" />
<property name="repeatInterval" value="300000" />
</bean>
<bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
<property name="triggers">
<list>
<ref bean="simpleTrigger" />
</list>
</property>
</bean>
Cheers! ![]()
Recent comments