[
https://issues.apache.org/jira/browse/FELIX-5563?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16297023#comment-16297023
]
Frank Blom commented on FELIX-5563:
-----------------------------------
Yes, it looks like this is happening. Fileinstall does check for
fragmentbundles but not for extension bundles. When fileinstall tries to start
the extension bundle it passes the bundle to the framework to start it, I can
see that the framework then detects it is a extension bundle and does not start
it.
We have made an empty webapp with only standard bundles including fileinstall
and adding a extension bundle, but we haven't been able to reproduce the
problem.
Still working on it.
> Adding extension bundles causes wildfy/tomcat server to fail
> ------------------------------------------------------------
>
> Key: FELIX-5563
> URL: https://issues.apache.org/jira/browse/FELIX-5563
> Project: Felix
> Issue Type: Improvement
> Components: Framework
> Affects Versions: framework-5.6.2
> Environment: wildfly - 10.0, tomcat - 8.5
> Reporter: Frank Blom
> Assignee: Karl Pauls
> Priority: Minor
> Fix For: framework-5.6.12
>
> Attachments: com.planon.sample.extension-0.0.1.jar
>
>
> I am trying to implement extension bundles in the osgi container. We are
> using a wildfly and tomcat server. Starting the wildfly server with the added
> extension bundle causes the following errors:
> 1:
> 2017-02-22 14:36:55,916 INFO [stdout]
> (fileinstall-C:\ws\Servers\jboss\standalone\bundles\planon) Failed to install
> artifact:
> C:\ws\Servers\jboss\standalone\bundles\planon\ch.meschberger.sample.extension-0.0.1.jar:
> org.osgi.framework.BundleException: Could not create bundle object.
> 2017-02-22 14:36:55,917 INFO [stdout]
> (fileinstall-C:\ws\Servers\jboss\standalone\bundles\planon)
> org.osgi.framework.BundleException: Could not create bundle object.
> 2017-02-22 14:36:55,917 INFO [stdout]
> (fileinstall-C:\ws\Servers\jboss\standalone\bundles\planon) at
> org.apache.felix.framework.Felix.installBundle(Felix.java:2960)
> 2017-02-22 14:36:55,917 INFO [stdout]
> (fileinstall-C:\ws\Servers\jboss\standalone\bundles\planon) at
> org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:165)
> 2017-02-22 14:36:55,917 INFO [stdout]
> (fileinstall-C:\ws\Servers\jboss\standalone\bundles\planon) at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.installOrUpdateBundle(DirectoryWatcher.java:1027)
> 2017-02-22 14:36:55,917 INFO [stdout]
> (fileinstall-C:\ws\Servers\jboss\standalone\bundles\planon) at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:941)
> 2017-02-22 14:36:55,917 INFO [stdout]
> (fileinstall-C:\ws\Servers\jboss\standalone\bundles\planon) at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:854)
> 2017-02-22 14:36:55,917 INFO [stdout]
> (fileinstall-C:\ws\Servers\jboss\standalone\bundles\planon) at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:483)
> 2017-02-22 14:36:55,918 INFO [stdout]
> (fileinstall-C:\ws\Servers\jboss\standalone\bundles\planon) at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:291)
> 2017-02-22 14:36:55,918 INFO [stdout]
> (fileinstall-C:\ws\Servers\jboss\standalone\bundles\planon) Caused by:
> java.lang.UnsupportedOperationException: Unable to add extension bundle to
> FrameworkClassLoader - Maybe not an URLClassLoader?
> 2017-02-22 14:36:55,918 INFO [stdout]
> (fileinstall-C:\ws\Servers\jboss\standalone\bundles\planon) at
> org.apache.felix.framework.ExtensionManager.addExtensionBundle(ExtensionManager.java:397)
> 2017-02-22 14:36:55,918 INFO [stdout]
> (fileinstall-C:\ws\Servers\jboss\standalone\bundles\planon) at
> org.apache.felix.framework.Felix.installBundle(Felix.java:2926)
> 2017-02-22 14:36:55,918 INFO [stdout]
> (fileinstall-C:\ws\Servers\jboss\standalone\bundles\planon) ... 6 more
> 2:
> 2017-02-22 14:29:46,307 INFO [stdout] (FelixStartLevel) Failed to install
> artifact:
> C:\ws\Servers\jboss\standalone\bundles\planon\ch.meschberger.sample.extension-0.0.1.jar:
> org.osgi.framework.BundleException: Could not create bundle object.
> 2017-02-22 14:29:46,308 INFO [stdout] (FelixStartLevel)
> org.osgi.framework.BundleException: Could not create bundle object.
> 2017-02-22 14:29:46,308 INFO [stdout] (FelixStartLevel) at
> org.apache.felix.framework.Felix.installBundle(Felix.java:2960)
> 2017-02-22 14:29:46,308 INFO [stdout] (FelixStartLevel) at
> org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:165)
> 2017-02-22 14:29:46,309 INFO [stdout] (FelixStartLevel) at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.installOrUpdateBundle(DirectoryWatcher.java:1027)
> 2017-02-22 14:29:46,309 INFO [stdout] (FelixStartLevel) at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:941)
> 2017-02-22 14:29:46,309 INFO [stdout] (FelixStartLevel) at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.install(DirectoryWatcher.java:854)
> 2017-02-22 14:29:46,309 INFO [stdout] (FelixStartLevel) at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:483)
> 2017-02-22 14:29:46,309 INFO [stdout] (FelixStartLevel) at
> org.apache.felix.fileinstall.internal.DirectoryWatcher.start(DirectoryWatcher.java:224)
> 2017-02-22 14:29:46,309 INFO [stdout] (FelixStartLevel) at
> org.apache.felix.fileinstall.internal.FileInstall.updated(FileInstall.java:252)
> 2017-02-22 14:29:46,309 INFO [stdout] (FelixStartLevel) at
> org.apache.felix.fileinstall.internal.FileInstall.start(FileInstall.java:139)
> 2017-02-22 14:29:46,309 INFO [stdout] (FelixStartLevel) at
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
> 2017-02-22 14:29:46,310 INFO [stdout] (FelixStartLevel) at
> org.apache.felix.framework.Felix.activateBundle(Felix.java:2154)
> 2017-02-22 14:29:46,310 INFO [stdout] (FelixStartLevel) at
> org.apache.felix.framework.Felix.startBundle(Felix.java:2072)
> 2017-02-22 14:29:46,310 INFO [stdout] (FelixStartLevel) at
> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1299)
> 2017-02-22 14:29:46,310 INFO [stdout] (FelixStartLevel) at
> org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:304)
> 2017-02-22 14:29:46,310 INFO [stdout] (FelixStartLevel) at
> java.lang.Thread.run(Thread.java:745)
> 2017-02-22 14:29:46,310 INFO [stdout] (FelixStartLevel) Caused by:
> java.lang.UnsupportedOperationException: Unable to add extension bundle to
> FrameworkClassLoader - Maybe not an URLClassLoader?
> 2017-02-22 14:29:46,311 INFO [stdout] (FelixStartLevel) at
> org.apache.felix.framework.ExtensionManager.addExtensionBundle(ExtensionManager.java:397)
> 2017-02-22 14:29:46,311 INFO [stdout] (FelixStartLevel) at
> org.apache.felix.framework.Felix.installBundle(Felix.java:2926)
> 2017-02-22 14:29:46,311 INFO [stdout] (FelixStartLevel) ... 14 more
> It seems that it goes wrong in the extensionManager class around here:
> {code:title=ExtensionManager.class|borderStyle=solid}
> try
> {
> extensionManager = new ExtensionManager();
>
> Felix.m_secureAction.addURLToURLClassLoader(Felix.m_secureAction.createURL(
> Felix.m_secureAction.createURL(null, "http:",
> extensionManager),
> "http://felix.extensions:9/", extensionManager),
> Felix.class.getClassLoader());
> }
> {code}
> And in the the addURLtoIRLClassLoader it expects a urlclassloader but this is
> not provided because of wildfly/tomcat. That happens here:
> {code:title=SecureAction.class|borderStyle=solid}
> public void addURLToURLClassLoader(URL extension, ClassLoader loader) throws
> Exception
> {
> if (System.getSecurityManager() != null)
> {
> Actions actions = (Actions) m_actions.get();
> actions.set(Actions.ADD_EXTENSION_URL_ACTION, extension, loader);
> try
> {
> AccessController.doPrivileged(actions, m_acc);
> }
> catch (PrivilegedActionException e)
> {
> throw e.getException();
> }
> }
> else
> {
> Method addURL =
> URLClassLoader.class.getDeclaredMethod("addURL",
> new Class[] {URL.class});
> addURL.setAccessible(true);
> addURL.invoke(loader, new Object[]{extension});
> }
> }
> {code}
> If you have any questions, let me know.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)