You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by derekv <de...@yahoo.com> on 2009/04/20 17:59:58 UTC

Hangs on startup

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: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Hangs on startup

Posted by Patrick Forhan <fe...@muddyhorse.com>.
We've had cases where eclipse just wasn't able to run felix reliably.
You could usually get it to work by hitting enter one or more times
every so often.

That was with the felix text shell bundle installed.  When we took out
that bundle (org.apache.felix.shell.tui) things seemed to be pretty
normal.  I think there were defects filed with both felix and eclipse,
but I don't think any definite activity happened from either end.

Pat.

On Tue, Apr 21, 2009 at 7:23 AM, derekv <de...@yahoo.com> wrote:
> Yes, i am running it inside eclipse. I setup a run configuration. I tried
> running it on the command line outside of eclipse and it seems to startup
> just fine. Why cant i run it inside of eclipse? Is there some special
> setting i need to do? Otherwise i guess i can just run it on the command
> line.

-- 
Defy mediocrity.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Hangs on startup

Posted by "Richard S. Hall" <he...@ungoverned.org>.
I cannot remember what the issue is, but we have seen other cases where 
people have run into difficulty when running from inside of Eclipse. 
Anyone remember what the issue was?

-> richard

On 4/21/09 8:23 AM, derekv wrote:
> Karl Pauls wrote:
>    
>> 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
>>
>>      
>
> Hey,
>
> Yes, i am running it inside eclipse. I setup a run configuration. I tried
> running it on the command line outside of eclipse and it seems to startup
> just fine. Why cant i run it inside of eclipse? Is there some special
> setting i need to do? Otherwise i guess i can just run it on the command
> line.
>
> thanks.
>
>    

Re: Hangs on startup

Posted by derekv <de...@yahoo.com>.

Karl Pauls wrote:
> 
> 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
> 

Hey,

Yes, i am running it inside eclipse. I setup a run configuration. I tried
running it on the command line outside of eclipse and it seems to startup
just fine. Why cant i run it inside of eclipse? Is there some special
setting i need to do? Otherwise i guess i can just run it on the command
line.

thanks.

-- 
View this message in context: http://www.nabble.com/Hangs-on-startup-tp23139569p23154907.html
Sent from the Apache Felix - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org


Re: Hangs on startup

Posted by Karl Pauls <ka...@gmail.com>.
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 <de...@yahoo.com> 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: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>



-- 
Karl Pauls
karlpauls@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org