|
From: Ian S. <ian...@tr...> - 2007-12-30 00:15:43
|
I'm not sure why you are getting that problem when starting tomcat about
JAVA_HOME. I have never seen it before.
Anyway the problem is that a full windows pathnames can't be blindly
converted to URIs because they contain a colon. The problem arises in
the method "testMediaDirectoryEmptiedByParentClass" in the file
PersistTest.java at line 201 (in
ogoglio-server/src/test/java/com/ogoglio/test). At about line 213 we
are constructing a URI from a string that is the media directory. This
is fine on linux or mac...
I don't have a windows box to test this on right now, but off the top of
my head you might see if java's File class is smart enough to solve this
problem. You can replace the entire
testMediaDirectoryEmptiedByParentClass function with this:
public void testMediaDirectoryEmptiedByParentClass() {
PropStorage ps = new PropStorage();
if (ps.loadPropertySet(PropStorage.BASIC_PROPS) == false) {
fail("couldn't load properties for test");
}
try {
String key = ps.getKeyFromSet(PropStorage.BASIC_PROPS,
"ogoglio.mediaDirectory");
if (key == null) {
fail("no test property ogoglio.mediaDirectory");
}
File f = new File(key);
MediaService svc = new MediaService(f.toURI());
if (svc == null) {
fail("can't create a media service:" + key);
}
assertEquals(0, svc.getAllNames().length);
} catch (IOException e) {
fail("IOException talking to media service:" + e.getMessage());
// } catch (URISyntaxException e) {
// fail("URISytaxException talking to media service:" +
e.getMessage());
}
}
Michel DENIS wrote:
>
>
>
>
>
> Ian,
>
> * JAVA_HOME:
> Executing Startup of OgoglioDemoServer gives this:
>
> /The JAVA_HOME environment variable is not defined correctly
> This environment variable is needed to run this program
> NB: JAVA_HOME should point to a JDK not a JRE
> Using CATALINA_BASE: C:\Ogoglio\OgoglioDemoServer
> Using CATALINA_HOME: C:\Ogoglio\OgoglioDemoServer
> Using CATALINA_TMPDIR: C:\Ogoglio\OgoglioDemoServer\temp
> Using JAVA_HOME: c:\Program Files\Java\jdk1.6.0_03\jre/
>
> There is also a post & responses on java.sun.com:
> http://forum.java.sun.com/thread.jspa?threadID=258769&messageID=970172
>
> * Problem:
>
>
> I enter the \\ for media dir in server.xml of tomcat
> As well I guess this should also be done for settings.xml in the maven
> .m2 directory, both for tomcat.home and also again for the media dir spec
> So .. that's what I also changed. Have I done right ??
>
> Now when restarting the maven install, I get the following failure
> message:
>
> /-------------------------------------------------------
> T E S T S
> -------------------------------------------------------
> Running com.ogoglio.mail.test.MailTest
> Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.156 sec
> Running com.ogoglio.sim.script.test.ScriptTest
> log4j:WARN No appenders could be found for logger (com.ogoglio.space).
> log4j:WARN Please initialize the log4j system properly.
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 8.813 sec
> Running com.ogoglio.persist.test.PersistTest
> Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 13.218
> sec <<< F
> AILURE!
>
> Results :
>
> Failed tests:
>
> testMediaDirectoryEmptiedByParentClass(com.ogoglio.persist.test.PersistTest)
>
> Tests run: 5, Failures: 1, Errors: 0, Skipped: 0
> /
> I have attached the 2 related surefire reports files (txt and xml).
> Note: there's no log with errors in tomcat areas.
>
> Sorry again ..
>
> THANKS ALSO very much for your patience in responding so quickly and
> professionally to my requests!
>
> -michel
>
> > Message du 29/12/07 19:40
> > De : "Ian Smith"
> > A : "Michel DENIS" , ogo...@li...
> > Copie à :
> > Objet : Re: problems building on windows
> >
> > As for the buffer overrun, I sure hope that's an M$ problem not
> ours. document.write (BT_SUBMIT);envoyer
> <http://webmail16b.orange.fr/webmail/fr_FR/write.html?RELOAD=OK>
> > For now, let's try to fix the ones I know we can make progress
> on. If
> > that persists, we'll address it. That URL you sent was dated
> 2006, so
> > let's hope that specific problem has been fixed.
> >
> > The velocity.log you sent looks a lot like the one on my system.
> > Although we should correct things so that 1) the log is
> documented as a
> > potential place to look for problems and 2) we improve our use of
> > velocity to generate fewer scary looking log messages, I think it's
> > fine. It's definitely not the problem you describe below.
> >
> > I'd like to see the message that you get about pointing
> JAVA_HOME to the
> > JRE as opposed to the JDK. I think there are two environment
> variables,
> > JAVA_HOME and JDK_HOME, which are designed to be different.
> JAVA_HOME
> > should point to where the bin directory is that contains "java"
> as far
> > as I understand it. Thus, pointing it to the JRE seems correct. Is
> > there some difference I don't know about on windows?
> >
> > The problem with the media directory is definately a windows
> interaction
> > with java. Here's what you said you were using:
> >
> > type="java.lang.String"/>
> >
> > However, this gets interpreted by java code so the backslashes
> should be
> > escaped, like this:
> >
> >
> > value="C:\\Ogoglio\\tmp\\working\\media" type="java.lang.String"/>
> >
> > The reason you saw the weird output "C:Ogoglio mpworkingmedia" was
> > because the \O was interpreted by java as "O" the \t as a
> horizontal tab
> > (that's the space in the string!) the \w as a "w" and the \m as
> an "m".
> >
> > I hope that you can get things going now. I'll update the wiki to
> > explain this problem to windows users.
> >
> > Thanks VERY much for your patience here,
> > ian
> >
> > ps. St. Etienne 0 - 1 PSG!
> >
> > --
> > /////////////////////////////////////////
> > Ian Smith, CTO, Transmutable Networks LLC
> > Emai: ian...@tr...
> > Mobi: +1.415.867.6532
> > Blog: http://blog.iansmith.name
> > Phys: shores of puget sound
> > /////////////////////////////////////////
> >
> >
> >
> > [ iansmith.vcf (0.3 Ko) ]
>
--
/////////////////////////////////////////
Ian Smith, CTO, Transmutable Networks LLC
Emai: ian...@tr...
Mobi: +1.415.867.6532
Blog: http://blog.iansmith.name
Phys: shores of puget sound
/////////////////////////////////////////
|