[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
| Re: [virgo-dev] Plain Web Applications are not transformed on Virgo	3.0.0.RC2? | 
I think that I found where the problem is:
The method checkWebBundle sets Web-ContextPath header
isWebApplicationBundle in applyWebContainerTransformations will always return true
 
Mt proposal is: in checkWebBundle() method to remove setDefaultWebContextPath(bundleInstallArtifact); and to leave Gemini Web to add this header
 
Wdyt?
 
org.eclipse.virgo.web.core.internal.WebBundleTransformer
public void transform(Tree<InstallArtifact> installTree, InstallEnvironment installEnvironment) throws DeploymentException {
...
if (checkWebBundle(installArtifact)) {
applyWebContainerTransformations((BundleInstallArtifact) installArtifact);
}
...
}
private boolean checkWebBundle(InstallArtifact installArtifact) throws DeploymentException {
if (installArtifact instanceof BundleInstallArtifact) {
BundleInstallArtifact bundleInstallArtifact = (BundleInstallArtifact) installArtifact;
if (hasWebContextPath(bundleInstallArtifact)) {
return true;
} 
else if (hasWarSuffix(installArtifact)) {
setDefaultWebContextPath(bundleInstallArtifact);
return true;
}
}
return false;
}
private void applyWebContainerTransformations(BundleInstallArtifact bundleArtifact) throws DeploymentException {
try {
BundleManifest bundleManifest = bundleArtifact.getBundleManifest();
if (bundleManifest.getModuleType() == null || "web".equalsIgnoreCase(bundleManifest.getModuleType())) {
if (!this.strictWABHeaders) {
bundleManifest.setHeader(
HEADER_DEFAULT_WAB_HEADERS, "true");
}
bundleManifest.setModuleType(
WEB_BUNDLE_MODULE_TYPE);
boolean webBundle = /* WebContainerUtils. */isWebApplicationBundle(bundleManifest);
InstallationOptions installationOptions = new InstallationOptions(Collections.<String, String> emptyMap());
installationOptions.setDefaultWABHeaders(!this.strictWABHeaders);
this.environment.getManifestTransformer().transform(bundleManifest, getSourceUrl(bundleArtifact), installationOptions, webBundle);
} else {
logger.debug("Bundle '{}' version '{}' is not being transformed as it already has a Module-Type of '{}'", new Object[] {
bundleManifest.getBundleSymbolicName().getSymbolicName(), bundleManifest.getBundleVersion(), bundleManifest.getModuleType() });
}
} catch (IOException e) {
throw new DeploymentException("Failed to apply web container transformations to bundle '" + bundleArtifact.getName() + "' version '"
+ bundleArtifact.getVersion() + 
"'", e);
}
}
 
2011/8/12 Chris Frost 
<frostc@xxxxxxxxxx>
Hi,
When WABHeaders = strict we don't. As the manifest you are providing only contains the 'Manifest-Version' header i suspect it is getting transformed in to Bundle-ManifestVersion = 2 as it is assuming it is a version 1 manifest. The extra headers are getting added when that happens. I don't know how it is getting picked up as a web bundle though with out the Web-ContextPath header?
Chris.
From: "Violeta Georgieva" <
milesg78@xxxxxxxxx>
To: "Virgo Project" <
virgo-dev@xxxxxxxxxxx>
Sent: Thursday, 11 August, 2011 4:54:47 PM
Subject: [virgo-dev] Plain Web Applications are not transformed on Virgo        3.0.0.RC2? 
Hi,
 
Since 3.0.0.M06 we do not add the defaults: Bundle-ManifestVersion; Bundle-SymbolicName; Bundle-ClassPath; Import-Package; to Web Application Bundle Manifest.
But I thought that we still add this to Plain Web Application Manifest.
Unfortunately this is not the behaviour of 3.0.0.RC2.
 
In my Web Application Manifest I have:
 
Manifest-Version: 1.0
 
 
1) When WABHeaders=strict
I have this:
 
osgi> h 117
Bundle headers:
 Bundle-ManifestVersion = 2
 Bundle-SymbolicName = context.xml.web-0.0.1
 Manifest-Version = 1.0
 Module-Type = web-bundle
 Web-ContextPath = context.xml.web-0.0.1
 
2) When WABHeaders=defaulted
I have this:
 
 
osgi> h 107
Bundle headers:
 Bundle-ClassPath = WEB-INF/classes,WEB-INF/lib/jtds-1.2.5.jar,WEB-INF/lib/tomca
t-dbcp.jar
 Bundle-ManifestVersion = 2
 Bundle-SymbolicName = context.xml.web-0.0.1
 Import-Package = javax.crypto.interfaces;version="[0.0.0, 0.0.0]",org.omg.CosNa
ming.NamingContextPackage;version="[0.0.0, 0.0.0]",org.omg.DynamicAny.DynAnyFact
oryPackage;version="[0.0.0, 0.0.0]",org.eclipse.osgi.internal.provisional.verifi
...
 Manifest-Version = 1.0
 Module-Type = web-bundle
 Web-ContextPath = context.xml.web-0.0.1
 org-eclipse-gemini-web-DefaultWABHeaders = true
 
osgi>
 
 
Do I miss something or we have a bug here?
 
Regards
Violeta
  _______________________________________________
virgo-dev mailing list
virgo-dev@xxxxxxxxxxxhttps://dev.eclipse.org/mailman/listinfo/virgo-dev
  
_______________________________________________
virgo-dev mailing list
virgo-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/virgo-dev