com.dotcms.repackage.org.osgi.framewor k.BundleException: Activator start error in bundle

47 views
Skip to first unread message

KaRtHiK sHyAm

unread,
May 29, 2017, 10:26:38 AM5/29/17
to dotCMS User Group
Hi All

i'm using dotCMS 3.7.1 version.

i have created override class plugin. 

when i uploaded my plugin, its showing resolved but its not showing as active. manually when i try to start i'm getting below error

ERROR:
ACTIVATOR THIS IS TESTING 
ERROR 2017-05-29 19:38:00,329 [fileinstall-E:\dotcms_3.7.1\dotserver\tomcat-8.0.
18\webapps\ROOT\WEB-INF\felix\load] com.dotmarketing.osgi.override.Activator:err
or(124): Error injecting context for overriding
java.lang.UnsupportedOperationException: class redefinition failed: attempted to
 change the schema (add/remove fields)
        at sun.instrument.InstrumentationImpl.redefineClasses0(Native Method) ~[
?:1.8.0_121]
        at sun.instrument.InstrumentationImpl.redefineClasses(InstrumentationImp
l.java:170) ~[?:1.8.0_121]
        at com.dotmarketing.osgi.UrlOsgiClassLoader.reload(UrlOsgiClassLoader.ja
va:216) ~[dotcms_3.7.1_8d1e90a.jar:?]
        at com.dotmarketing.osgi.UrlOsgiClassLoader.reload(UrlOsgiClassLoader.ja
va:97) ~[dotcms_3.7.1_8d1e90a.jar:?]
        at com.dotmarketing.osgi.GenericBundleActivator.injectContext(GenericBun
dleActivator.java:409) ~[dotcms_3.7.1_8d1e90a.jar:?]
        at com.dotmarketing.osgi.GenericBundleActivator.injectContext(GenericBun
dleActivator.java:366) ~[dotcms_3.7.1_8d1e90a.jar:?]
        at com.dotmarketing.osgi.GenericBundleActivator.publishBundleServices(Ge
nericBundleActivator.java:174) [dotcms_3.7.1_8d1e90a.jar:?]
        at com.dotmarketing.osgi.override.Activator.start(Activator.java:19) [av
ery-0.1.jar:?]
        at com.dotcms.repackage.org.apache.felix.framework.util.SecureAction.sta
rtActivator(SecureAction.java:645) [dot.felix-4.2.1_3.jar:?]
        at com.dotcms.repackage.org.apache.felix.framework.Felix.activateBundle(
Felix.java:2146) [dot.felix-4.2.1_3.jar:?]
        at com.dotcms.repackage.org.apache.felix.framework.Felix.startBundle(Fel
ix.java:2064) [dot.felix-4.2.1_3.jar:?]
        at com.dotcms.repackage.org.apache.felix.framework.BundleImpl.start(Bund
leImpl.java:955) [dot.felix-4.2.1_3.jar:?]
        at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryW
atcher.process(DirectoryWatcher.java:1175) [dot.org.apache.felix.fileinstall-3.1
.10_3.jar:?]
        at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryW
atcher.process(DirectoryWatcher.java:1153) [dot.org.apache.felix.fileinstall-3.1
.10_3.jar:?]
        at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryW
atcher.processAllBundles(DirectoryWatcher.java:1146) [dot.org.apache.felix.filei
nstall-3.1.10_3.jar:?]
        at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryW
atcher.process(DirectoryWatcher.java:456) [dot.org.apache.felix.fileinstall-3.1.
10_3.jar:?]
        at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryW
atcher.run(DirectoryWatcher.java:263) [dot.org.apache.felix.fileinstall-3.1.10_3
.jar:?]
Error while starting bundle: file:/E:/dotcms_3.7.1/dotserver/tomcat-8.0.18/webap
ps/ROOT/WEB-INF/felix/load/avery-0.1.jar: com.dotcms.repackage.org.osgi.framewor
k.BundleException: Activator start error in bundle avery [9].
com.dotcms.repackage.org.osgi.framework.BundleException: Activator start error i
n bundle avery [9].
        at com.dotcms.repackage.org.apache.felix.framework.Felix.activateBundle(
Felix.java:2196)
        at com.dotcms.repackage.org.apache.felix.framework.Felix.startBundle(Fel
ix.java:2064)
        at com.dotcms.repackage.org.apache.felix.framework.BundleImpl.start(Bund
leImpl.java:955)
        at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryW
atcher.process(DirectoryWatcher.java:1175)
        at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryW
atcher.process(DirectoryWatcher.java:1153)
        at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryW
atcher.processAllBundles(DirectoryWatcher.java:1146)
        at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryW
atcher.process(DirectoryWatcher.java:456)
        at com.dotcms.repackage.org.apache.felix.fileinstall.internal.DirectoryW
atcher.run(DirectoryWatcher.java:263)
Caused by: java.lang.UnsupportedOperationException: class redefinition failed: a
ttempted to change the schema (add/remove fields)
        at sun.instrument.InstrumentationImpl.redefineClasses0(Native Method)
        at sun.instrument.InstrumentationImpl.redefineClasses(InstrumentationImp
l.java:170)
        at com.dotmarketing.osgi.UrlOsgiClassLoader.reload(UrlOsgiClassLoader.ja
va:216)
        at com.dotmarketing.osgi.UrlOsgiClassLoader.reload(UrlOsgiClassLoader.ja
va:97)
        at com.dotmarketing.osgi.GenericBundleActivator.injectContext(GenericBun
dleActivator.java:409)
        at com.dotmarketing.osgi.GenericBundleActivator.injectContext(GenericBun
dleActivator.java:366)
        at com.dotmarketing.osgi.GenericBundleActivator.publishBundleServices(Ge
nericBundleActivator.java:174)
        at com.dotmarketing.osgi.override.Activator.start(Activator.java:19)
        at com.dotcms.repackage.org.apache.felix.framework.util.SecureAction.sta
rtActivator(SecureAction.java:645)
        at com.dotcms.repackage.org.apache.felix.framework.Felix.activateBundle(
Felix.java:2146)
        ... 7 more

Below is my Activator.java class.

package com.dotmarketing.osgi.override;
import com.dotmarketing.osgi.GenericBundleActivator;
import org.osgi.framework.BundleContext;
public class Activator extends GenericBundleActivator
{
  public void start(BundleContext context)
    throws Exception
  {
    initializeServices(context);
System.out.println("ACTIVATOR THIS IS TESTING"); --> i'm able to see this log when uploading my plugin into dotCMS.
    publishBundleServices(context);
  }
  public void stop(BundleContext context)
    throws Exception
  {
    unpublishBundleServices();
  }
}



if i commentout publishBundleServices(context) from Activator.java, then i can able to deploy my plugin successfully. 
but i'm not getting the logs from my override class. 

Please guide me on this and how to resolve this error?

Thanks in advance

Regards.,
Karthik





Jason Tesser

unread,
May 30, 2017, 9:54:36 AM5/30/17
to dotCMS User Group
So if you see the error it is telling you that you changed something in the class that is not allowed. You cannot chnage Method/Class signatures or fields 

This is a Java thing not a dotCMS thing FWIW 

--
http://dotcms.com - Open Source Java Content Management
---
You received this message because you are subscribed to the Google Groups "dotCMS User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dotcms+un...@googlegroups.com.
To post to this group, send email to dot...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dotcms/3a82c076-67dc-4ab5-afba-8cd15a11d554%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Nathan Keiter

unread,
May 30, 2017, 10:05:03 AM5/30/17
to dot...@googlegroups.com

Check out the “Limitations” section at the bottom of this page:

 

https://dotcms.com/docs/latest/override-a-dotcms-class-plugin

 

Nathan I. Keiter | Lead Network Applications Programmer | Administrative Advisory Council Member | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993

https://www.gettysburg.edu

KaRtHiK sHyAm

unread,
May 30, 2017, 10:14:54 AM5/30/17
to dotCMS User Group
i did not change anything on that class. i just added system.out.println statement.

Same jar is working in dotCMS 4.0.1. but its not working in 3.7.1

Jason Tesser

unread,
May 30, 2017, 10:17:24 AM5/30/17
to dotCMS User Group
probably the source is different on 4 then 3.7 which would mean it is changed.   

Nathan Keiter

unread,
May 30, 2017, 10:26:25 AM5/30/17
to dot...@googlegroups.com

Regardless, a 4.x plugin is not compatible with dotCMS 3.x and a 3.x plugin is not compatible with dotCMS 4.x.

 

The “incompatibility” might be interpreted as an “override class modification”.

 

If your plugin was compiled against the 4.x source base, then your Activator class object (by extension in the jar i.e. “extends” GenericActivator) is the 4.x version and is probably being seen as an override of the 3.x version in the server core jar.

 

Be sure that you have version specific plugins and only use the JAR for that dotCMS version on your server.

 

Nathan I. Keiter | Lead Network Applications Programmer | Administrative Advisory Council Member | Benefits Advisory Council Member | I.D.E.A Council Member
Gettysburg College | Information Technology | DataSystems
Campus Box 2453 | 300 North Washington Street | Gettysburg, PA 17325
Phone: 717.337.6993

https://www.gettysburg.edu

 

From: dot...@googlegroups.com [mailto:dot...@googlegroups.com] On Behalf Of Jason Tesser


Sent: Tuesday, May 30, 2017 10:17 AM
To: dotCMS User Group

Reply all
Reply to author
Forward
0 new messages