[
http://jira.amdatu.org/jira/browse/AMDATU-188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=10330#comment-10330
]
Marcel Offermans commented on AMDATU-188:
-----------------------------------------
So far I cannot reproduce this issue. The (Pax Exam based) test case I run:
package org.apache.felix.http.test;
import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
import static org.ops4j.pax.exam.CoreOptions.options;
import static org.ops4j.pax.exam.CoreOptions.provision;
import junit.framework.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.ops4j.pax.exam.Option;
import org.ops4j.pax.exam.junit.Configuration;
import org.ops4j.pax.exam.junit.JUnit4TestRunner;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
import org.osgi.service.cm.ConfigurationAdmin;
import org.osgi.util.tracker.ServiceTracker;
{code}
@RunWith(JUnit4TestRunner.class)
public class ConfigureTest {
@Configuration
public static Option[] configuration() {
return options(
provision(
mavenBundle().groupId("org.osgi").artifactId("org.osgi.compendium").version("4.1.0"),
mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.configadmin").version("1.2.8"),
mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.http.jetty").versionAsInProject().noStart()
)
);
}
@Test
public void testConfigureHttpService(BundleContext context) throws
Exception {
// ServiceTracker httpTracker = new ServiceTracker(context,
HttpService.class.getName(), null);
ServiceTracker configTracker = new ServiceTracker(context,
ConfigurationAdmin.class.getName(), null);
configTracker.open();
ConfigurationAdmin ca = (ConfigurationAdmin)
configTracker.waitForService(20000);
Assert.assertNotNull(ca);
startHttpServiceBundle(context);
ca.getConfiguration("org.apache.felix.http", null);
Thread.sleep(5000);
System.out.println("Done.");
}
private void startHttpServiceBundle(BundleContext context) throws
BundleException {
Bundle[] bs = context.getBundles();
for (Bundle b : context.getBundles()) {
if ("org.apache.felix.http.jetty".equals(b.getSymbolicName())) {
b.start();
}
}
}
}
{code}
> Felix HttpService bundle throws "Unable to establish loopback connection"
> error upon startup
> --------------------------------------------------------------------------------------------
>
> Key: AMDATU-188
> URL: http://jira.amdatu.org/jira/browse/AMDATU-188
> Project: Amdatu
> Issue Type: Bug
> Components: Testing
> Affects Versions: 0.0.6
> Reporter: Ivo Ladage - van Doorn
> Assignee: Marcel Offermans
> Attachments: amdatu-test.zip
>
>
> While running the integration tests, sometimes this error appears while
> starting Pax Exam:
> INFO: ServiceEvent REGISTERED [org.apache.felix.http.jetty]
> WARNING: failed org.mortbay.jetty.nio.SelectChannelConnector$1 at 4eeaaf:
> java.io.IOException: Unable to establish loopback connection
> [org.apache.felix.http.jetty]
> WARNING: failed SelectChannelConnector at 0.0.0.0:8080: java.io.IOException:
> Unable to establish loopback connection [org.apache.felix.http.jetty]
> WARNING: failed Server at 111bfbc: java.io.IOException: Unable to establish
> loopback connection [org.apache.felix.http.jetty]
> org.apache.felix.log.LogException: java.io.IOException: Unable to establish
> loopback connection
> ERROR: Exception while initializing Jetty. [org.apache.felix.http.jetty]
> at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:106)
> java.io.IOException: Unable to establish loopback connection
> at java.security.AccessController.doPrivileged(Native Method)
> at sun.nio.ch.PipeImpl.<init>(PipeImpl.java:122)
> at
> sun.nio.ch.SelectorProviderImpl.openPipe(SelectorProviderImpl.java:27)
> at java.nio.channels.Pipe.open(Pipe.java:133)
> at sun.nio.ch.WindowsSelectorImpl.<init>(WindowsSelectorImpl.java:104)
> at
> sun.nio.ch.WindowsSelectorProvider.openSelector(WindowsSelectorProvider.java:26)
> at java.nio.channels.Selector.open(Selector.java:209)
> at
> org.mortbay.io.nio.SelectorManager$SelectSet.<init>(SelectorManager.java:302)
> at
> org.mortbay.io.nio.SelectorManager.doStart(SelectorManager.java:224)
> at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
> at
> org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:314)
> INFO: ServiceEvent UNREGISTERING [org.amdatu.web.jsp]
> at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
> at org.mortbay.jetty.Server.doStart(Server.java:235)
> at
> org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
> INFO: HTTP Context destroyed for bundle 9 ('jspservlet') [org.amdatu.web.jsp]
> at
> org.apache.felix.http.jetty.internal.JettyService.initializeJetty(JettyService.java:145)
> INFO: ServiceEvent UNREGISTERING [org.amdatu.web.rest.wink]
> at
> org.apache.felix.http.jetty.internal.JettyService.startJetty(JettyService.java:112)
> INFO: HTTP Context destroyed for bundle 11 ('rest/services')
> [org.amdatu.web.rest.wink]
> INFO: ServiceEvent UNREGISTERING [org.amdatu.web.rest.wink]
> INFO: org.amdatu.web.rest.wink.service.WinkRegistrationServiceImpl service
> destroyed [org.amdatu.web.rest.wink]
> at
> org.apache.felix.http.jetty.internal.JettyService.run(JettyService.java:203)
> at java.lang.Thread.run(Thread.java:619)
> Caused by: java.nio.channels.ClosedByInterruptException
> INFO: ServiceEvent UNREGISTERING [org.amdatu.web.jsp]
> at
> java.nio.channels.spi.AbstractInterruptibleChannel.end(AbstractInterruptibleChannel.java:184)
> at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:518)
> at java.nio.channels.SocketChannel.open(SocketChannel.java:146)
> INFO: ServiceEvent UNREGISTERING [org.amdatu.web.httpcontext]
> at sun.nio.ch.PipeImpl$Initializer.run(PipeImpl.java:78)
> ... 18 more
> As a consequence Shindig seems to fail proper startup. After investigation it
> seems that the issue is caused when a bundle retrieves the Felix http
> configuration entry before the Felix http bundle itself is started. Attached
> is the source of the bundle with which I can reproduce the issue, by
> providing this bundle to Pax Exam first, followed by the Felix http service
> bundle.
> The error appears when this code is executed in the start() method:
> m_configAdmin.getConfiguration("org.apache.felix.http", null); -> error is
> thrown
> However, without the location parameter the error does not appear:
> m_configAdmin.getConfiguration("org.apache.felix.http"); -> no error
> Also when reading other configuration entries, the error does not appear.
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira