<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Latest posts for the topic "updating database on *NIX"]]></title>
		<link>http://mango.serotoninsoftware.com/forum/posts/list/2.page</link>
		<description><![CDATA[Latest messages posted in the topic "updating database on *NIX"]]></description>
		<generator>JForum - http://www.jforum.net</generator>
			<item>
				<title>updating database on *NIX</title>
				<description><![CDATA[ Hi,<br /> <br /> today I tried to update mango from 1.7.0 to 1.8.2. All I got is a errormessage permission denied in localhost.log:<br /> <br /> [quote] 01.05.2010 22:14:18 org.apache.catalina.core.ApplicationContext log<br /> INFO: Initializing Spring root WebApplicationContext<br /> 01.05.2010 22:14:23 org.apache.catalina.core.StandardContext listenerStart<br /> SCHWERWIEGEND: Exception sending context initialized event to listener instance of class com.serotonin.mango.MangoContextListener<br /> com.serotonin.ShouldNeverHappenException: java.io.FileNotFoundException: Upgrade1_8_0.log (Permission denied)<br />         at com.serotonin.mango.db.upgrade.DBUpgrade.checkUpgrade(DBUpgrade.java:87)<br />         at com.serotonin.mango.db.DatabaseAccess.initialize(DatabaseAccess.java:135)<br />         at com.serotonin.mango.MangoContextListener.databaseInitialize(MangoContextListener.java:259)<br />         at com.serotonin.mango.MangoContextListener.contextInitialized(MangoContextListener.java:89)<br />         at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)<br />         at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)<br />         at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)<br />         at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)<br />         at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:526)<br />         at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:637)<br />         at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:563)<br />         at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:49<img src="http://mango.serotoninsoftware.com/forum//images/smilies/b2eb59423fbf5fa39342041237025880.gif"  /><br />         at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)<br />         at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)<br />         at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)<br />         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)<br />         at org.apache.catalina.core.StandardHost.start(StandardHost.java:722)<br />         at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)<br />         at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)<br />         at org.apache.catalina.core.StandardService.start(StandardService.java:516)<br />         at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)<br />         at org.apache.catalina.startup.Catalina.start(Catalina.java:593)<br />         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br />         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br />         at java.lang.reflect.Method.invoke(Method.java:597)<br />         at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)<br />         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)<br /> Caused by: java.io.FileNotFoundException: Upgrade1_8_0.log (Permission denied)<br />         at java.io.FileOutputStream.open(Native Method)<br />         at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:179)<br />         at java.io.FileOutputStream.&lt;init&gt;(FileOutputStream.java:70)<br />         at com.serotonin.mango.db.upgrade.Upgrade1_8_0.upgrade(Upgrade1_8_0.java:29)<br />         at com.serotonin.mango.db.upgrade.DBUpgrade.checkUpgrade(DBUpgrade.java:82)<br />         ... 27 more<br /> 01.05.2010 22:14:23 org.apache.catalina.core.ApplicationContext log<br /> INFO: Closing Spring root WebApplicationContext<br /> [/quote]<br /> <br /> can you prefix it with "${catalania.base}/logs/"?<br /> I dont know if this fixes the problem.<br /> <br /> Arne ]]></description>
				<guid isPermaLink="true">http://mango.serotoninsoftware.com/forum/posts/preList/394/1877.page</guid>
				<link>http://mango.serotoninsoftware.com/forum/posts/preList/394/1877.page</link>
				<pubDate><![CDATA[Sat, 1 May 2010 16:32:56]]> GMT</pubDate>
				<author><![CDATA[ apl]]></author>
			</item>
			<item>
				<title>Re:updating database on *NIX</title>
				<description><![CDATA[ I believe the upgrade log gets written to whatever directory Tomcat was started in. I could change this, but it would be a future release. In the meantime, either start from another directory, or provide permissions to the current one.]]></description>
				<guid isPermaLink="true">http://mango.serotoninsoftware.com/forum/posts/preList/394/1880.page</guid>
				<link>http://mango.serotoninsoftware.com/forum/posts/preList/394/1880.page</link>
				<pubDate><![CDATA[Sun, 2 May 2010 19:07:35]]> GMT</pubDate>
				<author><![CDATA[ mlohbihler]]></author>
			</item>
			<item>
				<title>Re:updating database on *NIX</title>
				<description><![CDATA[ For now its OK,<br /> <br /> I have some patches, but replacement of ${property} is missing.<br /> <br /> Arne]]></description>
				<guid isPermaLink="true">http://mango.serotoninsoftware.com/forum/posts/preList/394/1890.page</guid>
				<link>http://mango.serotoninsoftware.com/forum/posts/preList/394/1890.page</link>
				<pubDate><![CDATA[Tue, 4 May 2010 04:48:02]]> GMT</pubDate>
				<author><![CDATA[ apl]]></author>
			</item>
			<item>
				<title>Re:updating database on *NIX</title>
				<description><![CDATA[ Here it is:<br /> <br /> [code]<br /> public class Upgrade1_8_0 extends DBUpgrade {<br />     @Override<br />     public void upgrade() throws Exception {<br />         FileOutputStream out = createUpdateLogFileStream("1_8_0");<br /> <br />         out.flush();<br />         out.close();<br />     }<br /> [/code]<br /> <br /> and in DBUpgrade add<br /> <br /> [code]<br />     protected FileOutputStream createUpdateLogFileStream(String version) throws IOException {<br />       File logDir = new File(org.apache.log4j.helpers.OptionConverter.substVars(Common.getEnvironmentProfile().getString("db.update.log.dir"), System.getProperties()));<br />       File logFile = new File(logDir, String.format("Update%s.log", version));<br />       LOG.info(String.format("Will use Update LogFile %s", logFile.getAbsolutePath()));<br />       FileOutputStream result = null;<br />       if (logDir.isDirectory() && logDir.canWrite()) {<br />         return new FileOutputStream(logFile);<br />       } else {<br />           LOG.fatal(String.format("Cant Create UpdateLogFile %s", logFile.getAbsolutePath()));<br />           throw new RuntimeException(String.format("Cant Create UpdateLogFile %s", logFile.getAbsolutePath()));<br />       }<br />     }<br /> [/code]<br /> <br /> it uses org.apache.log4j.helpers.OptionConverter.substVars to replace any ${property} with the system.Properties! <br /> <br /> Feel free to modify it to fit your needs.<br /> <br /> Arne]]></description>
				<guid isPermaLink="true">http://mango.serotoninsoftware.com/forum/posts/preList/394/1891.page</guid>
				<link>http://mango.serotoninsoftware.com/forum/posts/preList/394/1891.page</link>
				<pubDate><![CDATA[Tue, 4 May 2010 06:07:38]]> GMT</pubDate>
				<author><![CDATA[ apl]]></author>
			</item>
			<item>
				<title>Re:updating database on *NIX</title>
				<description><![CDATA[ Oh,<br /> <br /> add the line db.update.log.dir=${catalina.base}/logs/ to env.properties ;-)<br /> <br /> Arne<br /> <br /> ]]></description>
				<guid isPermaLink="true">http://mango.serotoninsoftware.com/forum/posts/preList/394/1892.page</guid>
				<link>http://mango.serotoninsoftware.com/forum/posts/preList/394/1892.page</link>
				<pubDate><![CDATA[Tue, 4 May 2010 06:08:40]]> GMT</pubDate>
				<author><![CDATA[ apl]]></author>
			</item>
			<item>
				<title>Re:updating database on *NIX</title>
				<description><![CDATA[ Does this work for you?<br /> <br /> [code]    protected OutputStream createUpdateLogOutputStream(String version) {<br />         String dir = Common.getEnvironmentProfile().getString("db.update.log.dir");<br />         if (dir == null)<br />             dir = "";<br />         dir = StringUtils.replaceMacros(dir, System.getProperties());<br /> <br />         File logDir = new File(dir);<br />         File logFile = new File(logDir, "Update" + version + ".log");<br />         LOG.info("Writing upgrade log to " + logFile.getAbsolutePath());<br /> <br />         try {<br />             if (logDir.isDirectory() && logDir.canWrite())<br />                 return new FileOutputStream(logFile);<br />         }<br />         catch (Exception e) {<br />             LOG.error("Failed to create database upgrade log file.", e);<br />         }<br /> <br />         LOG.warn("Failing over to console for printing database upgrade messages");<br />         return System.out;<br />     }<br /> [/code]<br /> <br /> (The "replaceMacros" does the same thing as the log4j method you called.)]]></description>
				<guid isPermaLink="true">http://mango.serotoninsoftware.com/forum/posts/preList/394/1897.page</guid>
				<link>http://mango.serotoninsoftware.com/forum/posts/preList/394/1897.page</link>
				<pubDate><![CDATA[Tue, 4 May 2010 10:33:49]]> GMT</pubDate>
				<author><![CDATA[ mlohbihler]]></author>
			</item>
			<item>
				<title>Re:updating database on *NIX</title>
				<description><![CDATA[ Sorry answering so late, <br /> <br /> it looks that the forum does not sent messages on a topic that I created (The alternative getting the message twice or thrice ;_))<br /> <br /> Which StringUtils do you mean? (seroutils has Strinutils but the params mismatch)<br /> <br /> Arne]]></description>
				<guid isPermaLink="true">http://mango.serotoninsoftware.com/forum/posts/preList/394/1903.page</guid>
				<link>http://mango.serotoninsoftware.com/forum/posts/preList/394/1903.page</link>
				<pubDate><![CDATA[Thu, 6 May 2010 04:19:04]]> GMT</pubDate>
				<author><![CDATA[ apl]]></author>
			</item>
			<item>
				<title>Re:updating database on *NIX</title>
				<description><![CDATA[ SeroUtils was updated to support. The update will be in the next release. What i meant was that if you wanted to test you could always replace the code with the log4j version.]]></description>
				<guid isPermaLink="true">http://mango.serotoninsoftware.com/forum/posts/preList/394/1907.page</guid>
				<link>http://mango.serotoninsoftware.com/forum/posts/preList/394/1907.page</link>
				<pubDate><![CDATA[Thu, 6 May 2010 09:37:34]]> GMT</pubDate>
				<author><![CDATA[ mlohbihler]]></author>
			</item>
			<item>
				<title>Re:updating database on *NIX</title>
				<description><![CDATA[ Your code with apache works<br /> <br /> So I consider this bug is closed.<br /> <br /> Arne]]></description>
				<guid isPermaLink="true">http://mango.serotoninsoftware.com/forum/posts/preList/394/1908.page</guid>
				<link>http://mango.serotoninsoftware.com/forum/posts/preList/394/1908.page</link>
				<pubDate><![CDATA[Thu, 6 May 2010 10:58:00]]> GMT</pubDate>
				<author><![CDATA[ apl]]></author>
			</item>
	</channel>
</rss>
