Expand my Community achievements bar.

SOLVED

Error while working with a bundle which consumes web service

Avatar

Level 4

I was following article https://helpx.adobe.com/experience-manager/using/creating-cxf-bundles-consume-web.html and https://helpx.adobe.com/experience-manager/using/creating-cq-bundles-consume-web.html to create a bundle so that I could consume web services.

I followed the steps and was able to have my bundle in "Active" status but while rendering it on page, I am getting below error. I tried installing the package too which is attached to one of the articles mentioned above but no luck. I still see the same error. FYI, I am using AEM 5.6.1.

I have already added this line: sling.bootdelegation.com.sun=com.sun.* in my sling.properties file and restarted CQ instance.

Caused by: java.lang.NoClassDefFoundError: Could not initialize class com.sun.proxy.$Proxy48 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at java.lang.reflect.Proxy.newInstance(Proxy.java:764) at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:755) at com.sun.xml.internal.ws.client.WSServiceDelegate$4.run(WSServiceDelegate.java:612) at java.security.AccessController.doPrivileged(Native Method) at com.sun.xml.internal.ws.client.WSServiceDelegate.createProxy(WSServiceDelegate.java:608) at com.sun.xml.internal.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:593) at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:331) at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:313) at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:295) at javax.xml.ws.Service.getPort(Service.java:119) at com.aem.weatherservice.Weather.getWeatherSoap(Weather.java:144) at org.apache.jsp.apps.zebra_002dwww_002dresponsive.components.content.text.text_jsp._jspService(text_jsp.java:248) at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:502) ... 96 more
1 Accepted Solution

Avatar

Correct answer by
Level 4

Hi Kautak and Ratna,

In my first post itself, I mentioned that I restarted the server after making changes to sling.properties file.

I was making changes in crx-quickstart/conf/sling.properties (which was mentioned in article) but I needed to make changes in crx-quickstart/sling.properties file. I followed this article http://www.one-inside.com/sling-properties-configuration-files-in-cq-5-6-1/ and got to know that at very first start of CQ instance, CQ creates a new sling.properties file directly under crx-quickstart folder. If we start the server again using "start" script, it picks the newly created sling.properties file, not the original one but if you start the server from JAR file, it picks the original sling.properties file.

Now I am all set after making changes to crx-quickstart/sling.properties file.

View solution in original post

6 Replies

Avatar

Level 10

This error means that the setting in the sling file has not taken effect.

Make sure you place it exactly as shown here:

Just tested on 5.6 - and it works nicely: 

Avatar

Level 4

Hi Scott,

This time I added the line at the same place you mentioned but still no luck.

Avatar

Level 10

Hi Prohira,

After adding the line: sling.bootdelegation.com.sun=com.sun.*, under the sling.properties file, you need to restart the instance and try to install the same package and check it again.

It will work!!

I have tested it, it works.

Thanks,
Ratna Kumar.

Avatar

Administrator

Hi

As stated by Ratna, we need to "restart the server".

It was working for me too.

It mentioned in the community article too :- Link: https://helpx.adobe.com/experience-manager/using/creating-cq-bundles-consume-web.html

//Add the following line of code to this file: sling.bootdelegation.com.sun=com.sun.*. Then restart the server. Once you perform this task, you can follow along with this article.

I hope this would help you.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Avatar

Correct answer by
Level 4

Hi Kautak and Ratna,

In my first post itself, I mentioned that I restarted the server after making changes to sling.properties file.

I was making changes in crx-quickstart/conf/sling.properties (which was mentioned in article) but I needed to make changes in crx-quickstart/sling.properties file. I followed this article http://www.one-inside.com/sling-properties-configuration-files-in-cq-5-6-1/ and got to know that at very first start of CQ instance, CQ creates a new sling.properties file directly under crx-quickstart folder. If we start the server again using "start" script, it picks the newly created sling.properties file, not the original one but if you start the server from JAR file, it picks the original sling.properties file.

Now I am all set after making changes to crx-quickstart/sling.properties file.

Avatar

Level 10

That is good information to place in the note. I will update the note with that so people starting without using JAR will see that.