I can't reproduce this on my mac. Are you doing anything special like
running inside eclipse or something?

Furthermore, can you give me thread dump of a hang? You can create it
in windows either using the jmx console or by hitting ctrl-break

regards,

Karl

On Mon, Apr 20, 2009 at 5:59 PM, derekv <[email protected]> wrote:
>
> Hey,
>
> When i use the following code felix will hang on startup. When i type in the
> command "ps" it appears to resume the startup. It appears that the
> UUID.randomUUID() or the InetAddress.getLocalHost() lines will cause it to
> hang. If i comment both out, then it starts just fine.
>
>
> package org.dav.proxy;
>
> import org.osgi.framework.*;
>
> public class ProxyServerActivator implements BundleActivator {
>  ProxyServer proxyServer;
>
>  public void start(BundleContext ctxt) throws Exception {
>    System.out.println("activator starting...a");
>    proxyServer = new ProxyServer("F:\\apps\\Isis\\ProxyServer\\"); // this
> will hang, read next class to see where it is hanging.
>    System.out.println("activator starting...b");
>  }
>
>  public void stop(BundleContext ctxt) throws Exception {
>  }
> }
>
>
>
> package org.dav.proxy;
>
> import java.io.*;
> import java.net.*;
> import java.util.*;
>
> public class ProxyServer {
>  UUID id = UUID.randomUUID(); // this will cause it to hang, if i comment
> this out, it does not hang.
>
>  protected ProxyServer(String homePath) throws IOException {
>    System.out.println("ProxyServer()a");
>    InetAddress.getLocalHost(); // this line causes it to hang, if i comment
> this out, it does not hang.
>    System.out.println("ProxyServer()b");
>    InetAddress.getLocalHost().getHostAddress();
>    System.out.println("ProxyServer()c");
>  }
> }
>
>
> here is my manifest.mf file
>
> Manifest-Version: 1.0
> Main-Class: org.dav.proxy.ProxyServer
> Bundle-Version: 1.0.0
> Bundle-Activator: org.dav.proxy.ProxyServerActivator
> Import-Package: org.osgi.framework
>
> Here is my felix.properties file
>
> # Licensed to the Apache Software Foundation (ASF) under one
> # or more contributor license agreements.  See the NOTICE file
> # distributed with this work for additional information
> # regarding copyright ownership.  The ASF licenses this file
> # to you under the Apache License, Version 2.0 (the
> # "License"); you may not use this file except in compliance
> # with the License.  You may obtain a copy of the License at
> #
> #   http://www.apache.org/licenses/LICENSE-2.0
> #
> # Unless required by applicable law or agreed to in writing,
> # software distributed under the License is distributed on an
> # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
> # KIND, either express or implied.  See the License for the
> # specific language governing permissions and limitations
> # under the License.
>
> #
> # Framework config properties.
> #
>
> # To override the packages the framework exports by default from the
> # class path, set this variable.
> # import path still needed.
> #org.osgi.framework.system.packages=com.sun.net.ssl.internal.ssl.*
>
> # To append packages to the default set of exported system packages,
> # set this value.
> #org.osgi.framework.system.packages.extra=com.sun.net.ssl.internal.ssl
>
> # The following property makes specified packages from the class path
> # available to all bundles. You should avoid using this property.
> # no import path needed.
> #org.osgi.framework.bootdelegation=sun.*,com.sun.*,com.sun.net.ssl.internal.ssl.*
>
> # The following property explicitly specifies the location of the bundle
> # cache, which defaults to "felix-cache" in the current working directory.
> # If this value is not absolute, then the felix.cache.rootdir controls
> # how the absolute location is calculated. (See next property)
> org.osgi.framework.storage=c:/felix-cache
>
> # The following property is used to convert a relative bundle cache
> # location into an absolute one by specifying the root to prepend to
> # the relative cache path. The default for this property is the
> # current working directory.
> #felix.cache.rootdir=${user.dir}
>
> # The following property controls whether the bundle cache is flushed
> # the first time the framework is initialized. Possible values are
> # "none" and "onFirstInit"; the default is "none".
> org.osgi.framework.storage.clean=onFirstInit
>
> felix.auto.start.1=
> file\:F\:/apps/felix-1.6.0/bundle/org.apache.felix.shell-1.2.0.jar
> file\:F\:/apps/felix-1.6.0/bundle/org.apache.felix.shell.tui-1.2.0.jar
> file\:F\:/apps/felix-1.6.0/bundle/org.apache.felix.bundlerepository-1.4.0.jar
> file\:F\:/apps/felix-1.6.0/bundle/org.apache.felix.log-1.0.0.jar
> file\:F\:/apps/felix-1.6.0/bundle/org.apache.felix.prefs-1.0.2.jar
> file\:F\:/Documents/projects/ProjectProxyServer2/ProxyServer.jar
>
>
> felix.log.level=1
>
> # Sets the initial start level of the framework upon startup.
> #org.osgi.framework.startlevel=1
>
> # Sets the start level of newly installed bundles.
> #felix.startlevel.bundle=1
>
> # Invalid fragment bundles throw an 'exception' by default, but
> # uncomment the follow line to have them log a 'warning' instead.
> #felix.fragment.validation=warning
>
> # Felix installs a stream and content handler factories by default,
> # uncomment the following line to not install them.
> #felix.service.urlhandlers=false
>
> #
> # Bundle config properties.
> #
>
> org.osgi.service.http.port=8080
> osgi.shell.telnet=on
> obr.repository.url=http://felix.apache.org/obr/releases.xml
>
>
>
>
> any help would be greatly appreciated.
> thanks.
> --
> View this message in context: 
> http://www.nabble.com/Hangs-on-startup-tp23139569p23139569.html
> Sent from the Apache Felix - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>



-- 
Karl Pauls
[email protected]

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to