[4.0.1] New contentlet debugging.

0 views
Skip to first unread message

Nathan Keiter

unread,
Sep 1, 2017, 5:18:04 PM9/1/17
to dot...@googlegroups.com

I have a brand new (never saved) contentlet (as in Contentlet contentlet = new Contentlet(); then set some properties.)  Before I save, I want to do some debugging.

 

So I want to write it to the log.

 

So I say JSONObject jsonObject = new JSONObject( contentlet ); thinking this will be a great easy way of viewing the object in the log. (Output jsonObject.toString( 4 ) to log.)

 

Unfortunately somewhere in the initial parsing it throws a permissions error.  Why would system user not have permissions? Any way to fix this.  It throws an ugly 500 error that completely bypasses my try catch blocks.

 

com.dotmarketing.exception.DotSecurityException: User: system cannot read Contentlet:

            at com.dotcms.content.elasticsearch.business.ESContentletAPIImpl.getName(ESContentletAPIImpl.java:3438) ~[dotcms_4.0.1_999999.jar:?]

            at com.dotmarketing.portlets.contentlet.business.ContentletAPIInterceptor.getName(ContentletAPIInterceptor.java:1102) ~[dotcms_4.0.1_999999.jar:?]

            at com.dotmarketing.portlets.contentlet.model.Contentlet.getTitle(Contentlet.java:139) [dotcms_4.0.1_999999.jar:?]

            at com.dotmarketing.portlets.contentlet.model.Contentlet.getName(Contentlet.java:391) [dotcms_4.0.1_999999.jar:?]

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_121]

            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_121]

            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_121]

            at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_121]

            at com.dotmarketing.util.json.JSONObject.populateMap(JSONObject.java:921) [dotcms_4.0.1_999999.jar:?]

            at com.dotmarketing.util.json.JSONObject.<init>(JSONObject.java:256) [dotcms_4.0.1_999999.jar:?]

 

Nathan I. Keiter | Lead Network Applications Programmer | 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

 

Reply all
Reply to author
Forward
0 new messages