Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Bartel2014-11-07 00:41:48 +0000
committerJan Bartel2014-11-07 00:43:23 +0000
commit244f97a9d1b186c4522b57cc2badfd1b056b1048 (patch)
treeac825b2590b74a27e64e679af0f917d4d387f3ce
parent0b68144a273cb4620682eec671bc8126cc6e106b (diff)
downloadorg.eclipse.jetty.project-244f97a9d1b186c4522b57cc2badfd1b056b1048.tar.gz
org.eclipse.jetty.project-244f97a9d1b186c4522b57cc2badfd1b056b1048.tar.xz
org.eclipse.jetty.project-244f97a9d1b186c4522b57cc2badfd1b056b1048.zip
Added extra debug to jetty osgi; added proper manifest to test-webapp-fragment
-rw-r--r--jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractWebAppProvider.java16
-rw-r--r--jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiWebInfConfiguration.java1
-rw-r--r--tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml47
3 files changed, 57 insertions, 7 deletions
diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractWebAppProvider.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractWebAppProvider.java
index 849a00c55c..28f72c814f 100644
--- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractWebAppProvider.java
+++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/AbstractWebAppProvider.java
@@ -252,6 +252,12 @@ public abstract class AbstractWebAppProvider extends AbstractLifeCycle implement
(overrideBundleInstallLocation == null
? BundleFileLocatorHelperFactory.getFactory().getHelper().getBundleInstallLocation(_bundle)
: new File(overrideBundleInstallLocation));
+
+ if (LOG.isDebugEnabled())
+ {
+ LOG.debug("Bundle location is {}, install location: {}", _bundle.getLocation(), bundleInstallLocation);
+ }
+
URL url = null;
Resource rootResource = Resource.newResource(BundleFileLocatorHelperFactory.getFactory().getHelper().getLocalURL(bundleInstallLocation.toURI().toURL()));
//try and make sure the rootResource is useable - if its a jar then make it a jar file url
@@ -266,6 +272,8 @@ public abstract class AbstractWebAppProvider extends AbstractLifeCycle implement
if (_webAppPath == null || _webAppPath.length() == 0 || ".".equals(_webAppPath))
{
url = bundleInstallLocation.toURI().toURL();
+ if (LOG.isDebugEnabled())
+ LOG.debug("Webapp base using bundle install location: {}", url);
}
else
{
@@ -273,16 +281,24 @@ public abstract class AbstractWebAppProvider extends AbstractLifeCycle implement
if (_webAppPath.startsWith("/") || _webAppPath.startsWith("file:"))
{
url = new File(_webAppPath).toURI().toURL();
+ if (LOG.isDebugEnabled())
+ LOG.debug("Webapp base using absolute location: {}", url);
}
else if (bundleInstallLocation != null && bundleInstallLocation.isDirectory())
{
url = new File(bundleInstallLocation, _webAppPath).toURI().toURL();
+ if (LOG.isDebugEnabled())
+ LOG.debug("Webapp base using path relative to bundle unpacked install location: {}", url);
}
else if (bundleInstallLocation != null)
{
Enumeration<URL> urls = BundleFileLocatorHelperFactory.getFactory().getHelper().findEntries(_bundle, _webAppPath);
if (urls != null && urls.hasMoreElements())
+ {
url = urls.nextElement();
+ if (LOG.isDebugEnabled())
+ LOG.debug("Webapp base using path relative to packed bundle location: {}", url);
+ }
}
}
diff --git a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiWebInfConfiguration.java b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiWebInfConfiguration.java
index 4482640bcf..3d006779cc 100644
--- a/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiWebInfConfiguration.java
+++ b/jetty-osgi/jetty-osgi-boot/src/main/java/org/eclipse/jetty/osgi/boot/OSGiWebInfConfiguration.java
@@ -105,6 +105,7 @@ public class OSGiWebInfConfiguration extends WebInfConfiguration
for (Bundle bundle : bundles)
{
+ LOG.debug("Checking bundle {}:{}", bundle.getBundleId(), bundle.getSymbolicName());
if (pattern != null)
{
// if bundle symbolic name matches the pattern
diff --git a/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml b/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml
index d47e6c3769..c3d847ec15 100644
--- a/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml
+++ b/tests/test-webapps/test-servlet-spec/test-web-fragment/pom.xml
@@ -17,6 +17,46 @@
<verbose>false</verbose>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>artifact-jar</id>
+ <goals>
+ <goal>jar</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <archive>
+ <manifestFile>target/classes/META-INF/MANIFEST.MF</manifestFile>
+ </archive>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <executions>
+ <execution>
+ <id>bundle-manifest</id>
+ <phase>process-classes</phase>
+ <goals>
+ <goal>manifest</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <instructions>
+ <Bundle-SymbolicName>org.eclipse.jetty.tests.test-web-fragment;singleton:=true</Bundle-SymbolicName>
+ <Bundle-Description>A bundle containing web fragment for testing</Bundle-Description>
+ <Export-Package>com.acme.fragment;version="${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}"</Export-Package>
+ <_nouses>true</_nouses>
+ </instructions>
+ </configuration>
+ </plugin>
+
</plugins>
</build>
<dependencies>
@@ -24,12 +64,5 @@
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
</dependency>
-
-<!--
- <dependency>
- <groupId>org.eclipse.jetty.orbit</groupId>
- <artifactId>javax.servlet</artifactId>
- </dependency>
--->
</dependencies>
</project>

Back to the top