This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 215705 - FileNotFound exception thrown when running OSGi environment in Eclipse
Summary: FileNotFound exception thrown when running OSGi environment in Eclipse
Status: RESOLVED WONTFIX
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Cosmos (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P1 major (vote)
Target Milestone: ---   Edit
Assignee: Joel Hawkins CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-01-17 14:59 EST by amehrega CLA
Modified: 2012-01-03 13:48 EST (History)
3 users (show)

See Also:


Attachments
replacement muse.xml for wsdm bundle (4.07 KB, text/xml)
2008-01-17 16:13 EST, Joel Hawkins CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description amehrega CLA 2008-01-17 14:59:29 EST
Using a vanilla COSMOS driver (COSMOS-1.0.0-200801161716), I'm having problems running the example MDR.  Here are my exact steps:

1) Download Eclipse 3.3.1.1 (http://download.eclipse.org/eclipse/downloads/drops/R-3.3.1.1-200710231652/index.php)
2) Download COSMOS SDK
3) Add the following org.apache and muse plug-ins to the driver's plug-in directory:

javax.mail.api_1.4.0
javax.saaj.api_1.3.0
org.apache.commons.httpclient_3.0.1
org.apache.commons.logging_1.1.0
org.apache.ws.commons.schema_1.2.0
org.apache.wsdl4j_1.6.1
org.apache.xalan_2.7.0
wstx-asl_3.0.1
muse-complete-2.2.0.jar
muse-osgi-soa-mini-2.2.0.jar
org.apache.xerces_2.8.0.v200705301630.jar
org.apache.xml.resolver_1.1.0.v200705310020.jar
org.eclipse.equinox.ds_1.0.0.v20070226.jar
org.eclipse.equinox.log_1.0.1.R32x_v20060717.jar

4) Start the eclipse workbench
5) Check-out the following projects from COSMOS CVS:

org.eclipse.cosmos.dc.dataManager.client
org.eclipse.cosmos.dc.mdr.client
org.eclipse.cosmos.example.mdr
org.eclipse.cosmos.samples.cmdbf.services

6) Open the run launch configuration dialog and create a new OSGi Framework profile:
- Select everything in workspace
- Select everything in target except for 
org.eclipse.cosmos.dc.dataManager.client
org.eclipse.cosmos.dc.mdr.client

7) Run the profile.  Here's the output I get:


osgi> 17-Jan-2008 2:44:46 PM org.mortbay.http.HttpServer doStart
INFO: Version Jetty/5.1.x
17-Jan-2008 2:44:46 PM org.mortbay.util.Container start
INFO: Started org.mortbay.jetty.servlet.ServletHandler@14501450
17-Jan-2008 2:44:46 PM org.mortbay.util.Container start
INFO: Started HttpContext[/,/]
17-Jan-2008 2:44:46 PM org.mortbay.http.SocketListener start
INFO: Started SocketListener on 0.0.0.0:80
17-Jan-2008 2:44:46 PM org.mortbay.util.Container start
INFO: Started org.mortbay.http.HttpServer@359a359a
Pinging Muse to initialize the endpoint...
made it!
java.io.FileNotFoundException: D:\COSMOS\COSMOS-1.0.0-200801161716\eclipse\file:D:\COSMOS\COSMOS-1.0.0-200801161716\eclipse\plugins\org.eclipse.cosmos.dc.mgmt.wsdm_1.0.0.v200801161716.jar!\log\muse.log (The filename, directory name, or volume label syntax is incorrect.)
	at java.io.FileOutputStream.open(Native Method)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:205)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:96)
	at java.io.FileWriter.<init>(FileWriter.java:69)
	at org.apache.muse.core.platform.osgi.OSGiLogListener.<init>(OSGiLogListener.java:43)
	at org.apache.muse.core.platform.osgi.OSGiLogHandler.<init>(OSGiLogHandler.java:45)
	at org.apache.muse.core.platform.osgi.descriptor.OSGiLoggingConfig.createLogHandler(OSGiLoggingConfig.java:47)
	at org.apache.muse.core.descriptor.LoggingConfig.newInstance(LoggingConfig.java:89)
	at org.apache.muse.core.descriptor.RouterDefinition.newInstance(RouterDefinition.java:84)
	at org.apache.muse.core.platform.osgi.routing.OSGiResourceRouter.addResourceDefinitions(OSGiResourceRouter.java:359)
	at org.apache.muse.core.platform.osgi.routing.OSGiResourceRouter.setEnvironment(OSGiResourceRouter.java:140)
	at org.apache.muse.core.descriptor.RouterDefinition.newInstance(RouterDefinition.java:81)
	at org.apache.muse.core.platform.AbstractIsolationLayer.initialize(AbstractIsolationLayer.java:178)
	at org.apache.muse.core.platform.osgi.mini.internal.OSGiMiniIsolationLayer.initialize(OSGiMiniIsolationLayer.java:65)
	at org.apache.muse.core.platform.osgi.mini.internal.OSGiMinServlet.createIsolationLayer(OSGiMinServlet.java:37)
	at org.apache.muse.core.platform.mini.MiniServlet.doPost(MiniServlet.java:69)
	at org.apache.muse.core.platform.osgi.mini.internal.OSGiMinServlet.doPost(OSGiMinServlet.java:52)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:616)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
	at org.eclipse.equinox.http.servlet.internal.ServletRegistration.handleRequest(ServletRegistration.java:90)
	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:111)
	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:67)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
	at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:288)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
	at org.mortbay.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:677)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:568)
	at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
	at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
	at org.mortbay.http.HttpServer.service(HttpServer.java:909)
	at org.mortbay.http.HttpConnection.service(HttpConnection.java:820)
	at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:986)
	at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837)
	at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:245)
	at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
	at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
17-Jan-2008 2:44:48 PM org.apache.muse.core.routing.SimpleResourceRouter initialize
INFO: [ID = 'RouterIsInitialized'] The resource router has been initialized.
17-Jan-2008 2:44:48 PM org.apache.muse.core.routing.SimpleResourceRouter initialize
INFO: [ID = 'RouterIsInitialized'] The resource router has been initialized.
Entry bundleentry://59/OSGI-INF/Advertisement/Dispatch-Consumer.xml
Ref is <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <wsa:Address>http://127.0.0.1:1080/wsn-consumer/services/consumer</wsa:Address>
    <wsa:ReferenceParameters>
        <muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing">MuseResource-1</muse-wsa:ResourceId>
    </wsa:ReferenceParameters>
</wsa:EndpointReference>

Entry bundleentry://59/OSGI-INF/Advertisement/advertisement-consumer.xml
Ref is <wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <wsa:Address>http://localhost:1080/wsn-consumer/services/consumer</wsa:Address>
    <wsa:ReferenceParameters xmlns:wsa="http://www.w3.org/2005/08/addressing">
        <muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing">RuntimeIdentifierValue</muse-wsa:ResourceId>
    </wsa:ReferenceParameters>
</wsa:EndpointReference>

17-Jan-2008 2:44:48 PM org.apache.muse.core.routing.SimpleResourceRouter initialize
INFO: [ID = 'RouterIsInitialized'] The resource router has been initialized.
17-Jan-2008 2:44:48 PM org.apache.muse.core.routing.SimpleResourceRouter initialize
INFO: [ID = 'RouterIsInitialized'] The resource router has been initialized.
Register MDR with COSMOS broker...
Tried to register data manager with broker at startup, but registration failed.
17-Jan-2008 2:44:49 PM org.apache.muse.core.SimpleResource initialize
INFO: [ID = 'ResourceInitialized'] The resource at '/org.eclipse.cosmos.example.mdr.ExampleMdr' has been initialized.
17-Jan-2008 2:44:49 PM org.apache.muse.core.SimpleResource initialize
INFO: [ID = 'ResourceInitialized'] The resource at '/org.eclipse.cosmos.example.mdr.ExampleMdr' has been initialized.
Bound<wsa:EndpointReference xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <wsa:Address>http://9.26.144.198:80/cosmos/services/org.eclipse.cosmos.example.mdr.ExampleMdr</wsa:Address>
    <wsa:ReferenceParameters>
        <muse-wsa:ResourceId xmlns:muse-wsa="http://ws.apache.org/muse/addressing">Example</muse-wsa:ResourceId>
    </wsa:ReferenceParameters>
</wsa:EndpointReference>

Register MDR with COSMOS broker...
Tried to register data manager with broker at startup, but registration failed.
Comment 1 amehrega CLA 2008-01-17 15:22:49 EST
Doing some debugging revealed that the problem is being caused by an NPE exception in org.eclipse.cosmos.dc.dataManager.impl.initialize():

Object resourceObject = wsdmBinding.getBindingForObject(this);

wsdmBinding is null.  The setter method for the field is not invoked by anyone. Here's the stack trace:

LoggingDataManager(AbstractDataManager).initialize() line: 153	
LoggingDataManager(AbstractDataManager).register() line: 185	
Activator(AbstractDataManagerActivator).serviceChanged(ServiceEvent) line: 96	
FilteredServiceListener.serviceChanged(ServiceEvent) line: 94	
BundleContextImpl.dispatchEvent(Object, Object, int, Object) line: 1224	
EventManager.dispatchEvent(EventListeners$ListElement[], EventDispatcher, int, Object) line: 195	
ListenerQueue.dispatchEventSynchronous(int, Object) line: 141	
Framework.publishServiceEventPrivileged(ServiceEvent) line: 1603	
Framework.publishServiceEvent(int, ServiceReference) line: 1578	
ServiceRegistrationImpl.<init>(BundleContextImpl, String[], Object, Dictionary) line: 103	
BundleContextImpl.createServiceRegistration(String[], Object, Dictionary) line: 657	
BundleContextImpl.registerService(String[], Object, Dictionary) line: 609	
RegisterComponentService.registerService(InstanceProcess, ComponentConfiguration) line: 102	
InstanceProcess.registerComponentConfigurations(List) line: 153	
Resolver.dispatchWork(int, Object) line: 701	
WorkQueue$Queued.dispatch() line: 57	
WorkQueue.run() line: 108	


Comment 2 Joel Hawkins CLA 2008-01-17 16:13:59 EST
Created attachment 87203 [details]
replacement muse.xml for wsdm bundle
Comment 3 amehrega CLA 2008-01-17 18:04:17 EST
Joel,

I'm not sure what the purpose of the attachment is.  If it resolves the problem, please describe what I'm suppose to do with it.

Thanks
Comment 4 Hubert Leung CLA 2008-01-18 12:58:14 EST
I suppose it is for replacign the muse.xml in the mgmt.wsdm bundle.  If the bundle is packaged as a jar file, the log file can't be written inside the jar.  So Joel's change is to specify the log directory to be under the parent directory.  

I also see Joel commented out the file persistence block.  

I will update the muse.xml and give it a try.  
Comment 5 amehrega CLA 2008-01-18 13:57:22 EST
The inability to run the example MDR was a configuration issue on my end.  I have since fixed the problem and I'm able to submit queries.

The exception below is however thrown whenever the OSGi profile is launched in Eclipse.  I'll keep this defect open to handle the exception.  I've lowered the severity and changed the summary.

Thanks.
Comment 6 Hubert Leung CLA 2008-01-21 10:15:21 EST
Joel, I'm still seeing an exception about muse log file with the new muse.xml.

Is the a better way to specify the log file path?  Or should we package the bundle as a directory?  


java.io.FileNotFoundException: D:\cosmos2\i8\build4\cosmos-demo\DataManagers\fil
e:D:\cosmos2\i8\build4\cosmos-demo\DataManagers\plugins\org.eclipse.cosmos.dc.mg
mt.wsdm_1.0.0.v200801181306.jar!\..\log\muse.log (The filename, directory name,
or volume label syntax is incorrect)
        at java.io.FileOutputStream.open(Native Method)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:179)
        at java.io.FileOutputStream.<init>(FileOutputStream.java:70)
        at java.io.FileWriter.<init>(FileWriter.java:46)
        at org.apache.muse.core.platform.osgi.OSGiLogListener.<init>(OSGiLogList
ener.java:43)
        at org.apache.muse.core.platform.osgi.OSGiLogHandler.<init>(OSGiLogHandl
er.java:45)
        at org.apache.muse.core.platform.osgi.descriptor.OSGiLoggingConfig.creat
eLogHandler(OSGiLoggingConfig.java:47)
        at org.apache.muse.core.descriptor.LoggingConfig.newInstance(LoggingConf
ig.java:89)
Comment 7 Hubert Leung CLA 2008-01-23 17:13:13 EST
Joel, please see if it's something you want to fix in i8.  Thanks.
Comment 8 Ruth Lee CLA 2008-08-06 11:00:58 EDT
Moving all open bugzillas that are targeted to iterations in the past to the next iteration (i13).
Comment 9 David Whiteman CLA 2008-08-13 10:47:39 EDT
since OSGi is not currently supported, marking as wontfix.  can reopen later if necessary.