Great! thanks Phil - saved me getting an old windows laptop out of
mothballs!!
On 31 Jul 2005, at 18:18, Philip Dodds wrote:
Holger/Rob,
I just messed around with ServiceMix on Windows and hit the same
problem trying to get services to install (using the JBI examples
from the Sun RI).
This problem looks like it’s a bug in the renameTo method in the
JVM, on Windows if you rename a directory to another directory and
they both exist then it doesn't do anything. In ServiceMix this
means that the component isn't moved from tmp to its installation
directory, thus the libs that are being added to the classpath
don’t exist.
To get it running on Windows you need to delete the installation
directory before performing the copy, I suppose you could argue
that if you are installing the component again all files from the
old install should be removed? (OK maybe I'm pushing it!)
Index: InstallationService.java
===================================================================
RCS file: /home/projects/servicemix/scm/servicemix/base/src/main/
java/org/servicemix/jbi/framework/InstallationService.java,v
retrieving revision 1.15
diff -u -r1.15 InstallationService.java
--- InstallationService.java 29 Jul 2005 00:04:21 -0000 1.15
+++ InstallationService.java 31 Jul 2005 17:12:34 -0000
@@ -622,7 +622,11 @@
catch (IOException e) {
throw new DeploymentException(e);
}
- tmpDirectory.renameTo(installationDir);
+ // I'm I not making sense yet? (Windows hack)
+ installationDir.delete();
+ if (!tmpDirectory.renameTo(installationDir)) {
+ throw new DeploymentException("Unable to rename
"+tmpDirectory+" to "+installationDir);
+ }
log.info("moved " + tmpDirectory + " to " + installationDir);
// create the Installation context
result = initializeInstaller(installationDir, descriptor);
The other think you might want to look at it trapping it missing
jars that are being referenced by the component so that invalid
descriptors don't end up with class not found exceptions or missing
bundled jars.
Index: ClassLoaderService.java
===================================================================
RCS file: /home/projects/servicemix/scm/servicemix/base/src/main/
java/org/servicemix/jbi/framework/ClassLoaderService.java,v
retrieving revision 1.4
diff -u -r1.4 ClassLoaderService.java
--- ClassLoaderService.java 18 Jul 2005 09:51:59 -0000 1.4
+++ ClassLoaderService.java 31 Jul 2005 17:17:45 -0000
@@ -73,6 +73,11 @@
URL[] urls = new URL[classPathNames.length];
for (int i = 0;i < classPathNames.length;i++) {
File file = new File(dir, classPathNames[i]);
+ if (!file.exists())
+ throw new RuntimeException(
+ "Unable to add file to CLASSPATH as it
doesn't exist ["
+ + file.getAbsolutePath()
+ + "], check your descriptor and
packaging.");
urls[i] = file.toURL();
}
if (parentFirst) {
This one might need a little more thought... ?
Cheers
P
-----Original Message-----
From: Rob Davies [mailto:[EMAIL PROTECTED]
Sent: Saturday, July 30, 2005 12:28 AM
To: [email protected]
Subject: Re: [servicemix-dev] Fun with InstallationService
Nooo! I'm not using Windows! :)
On 29 Jul 2005, at 23:22, Holger Hoffstätte wrote:
Picking up the thread about servicemix and PXE -
Poor /me just spent ~3 hours trying to make the PXE installer (both
the
one in examples/bpel and my own which is ~rc2) work in servicemix,
but to
little avail - InstallationService complains bitterly:
[ERROR] InstallerMBeanImpl - -Could not initialize :
com.fs.pxe.jbi.PxeBootstrap
<javax.jbi.management.DeploymentException:
Could not find bootstrap class:
com.fs.pxe.jbi.PxeBootstrap>javax.jbi.management.DeploymentException:
Could not find bootstrap class: com.fs.pxe.jbi.PxeBootstrap
at
org.servicemix.jbi.framework.InstallerMBeanImpl.<init>
(InstallerMBeanImpl.java:77)
at
org.servicemix.jbi.framework.InstallationService.initializeInstaller
(InstallationService.java:670)
at
org.servicemix.jbi.framework.InstallationService.doInstallComponent
(InstallationService.java:628)
This is particularly interesting since the very same archives
deploy just
fine into Sun's AppServer.
After much outchecking and mavening and source reading and
debugging that
InstallationService and friends all have their classpaths straight
I got
desparate and tried to install into a CVS build running on my Linux
box
(my big dev box is XP). Needless to say, both the CVS and my
homegrown
installer IMMEDIATELY deploy happily.
I just wanted to share this unpleasant news. Folks, I'm afraid we
need to
take away your OSX toys and get you some Real Computers.. :D
-h