Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

AEM 6.2 Error

Avatar

Avatar
Validate 10
Level 2
rahul_kumar11
Level 2

Likes

3 likes

Total Posts

36 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
View profile

Avatar
Validate 10
Level 2
rahul_kumar11
Level 2

Likes

3 likes

Total Posts

36 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
View profile
rahul_kumar11
Level 2

08-10-2016

Hi,

We are using EP API's with AEM.

We have used below code in JSP

 

CommerceService commerceService = resource.adaptTo(CommerceService.class);
CommerceSession commerceSession = commerceService.login(slingRequest, slingResponse);    

 

It was working fine in AEM 6.0 but in After moving to AEM6.2 it is showing below error.

commerceSession cannot be resolved to a variable

Thanks,

Kumar.

Replies

Avatar

Avatar
Validate 1
Employee
Opkar_Gill
Employee

Likes

138 likes

Total Posts

952 posts

Correct Reply

280 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Validate 1
Employee
Opkar_Gill
Employee

Likes

138 likes

Total Posts

952 posts

Correct Reply

280 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile
Opkar_Gill
Employee

09-10-2016

Hi,

Is the CommerceService class actually available in AEM? Check in the dependancy finder with the full class name: {HOST}/system/console/depfinder

I take it there is a an ElasticPath bundle you need to deploy? did you deploy the latest package for elastic path and AEM 6.2? Does the bundle start?

You really need to show the full error that you got in error.log

Regards,

Opkar

[0]https://docs.adobe.com/docs/en/aem/6-2/deploy/ecommerce/elasticpath.html

Avatar

Avatar
Validate 10
Level 2
rahul_kumar11
Level 2

Likes

3 likes

Total Posts

36 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
View profile

Avatar
Validate 10
Level 2
rahul_kumar11
Level 2

Likes

3 likes

Total Posts

36 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
View profile
rahul_kumar11
Level 2

11-10-2016

Hi,

Showing below ERROR.

*ERROR* [0:0:0:0:0:0:0:1 [1476202522242] GET /content/xyz/en_gb/product.M12534567.html HTTP/1.1] com.day.cq.wcm.tags.IncludeTag Error while executing script init.jsp
org.apache.sling.api.scripting.ScriptEvaluationException: An exception occurred processing JSP page /apps/projectname/components/page/productdetailpage/init.jsp at line 31
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:416)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:184)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:491)
    at com.day.cq.wcm.tags.IncludeTag.includeScript(IncludeTag.java:178)
    at com.day.cq.wcm.tags.IncludeTag.doEndTag(IncludeTag.java:95)
    at org.apache.jsp.apps.projectname.components.page.projectnamebasepage.projectnamebasepage_jsp._jspx_meth_cq_005finclude_005f0(projectnamebasepage_jsp.java:334)
    at org.apache.jsp.apps.projectname.components.page.projectnamebasepage.projectnamebasepage_jsp._jspService(projectnamebasepage_jsp.java:177)
    at org.apache.sling.scripting.jsp.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:502)
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:449)
    at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java:284)
    at org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.java:102)
    at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngineFactory.java:536)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:388)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:184)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:491)
    at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:546)
    at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:44)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:77)
    at com.day.cq.personalization.impl.TargetComponentFilter.doFilter(TargetComponentFilter.java:96)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilterWithErrorHandling(WCMDebugFilter.java:187)
    at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:154)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:265)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at com.day.cq.wcm.core.impl.WCMDeveloperModeFilter.doFilter(WCMDeveloperModeFilter.java:114)
    at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:68)
    at org.apache.sling.engine.impl.SlingRequestProcessorImpl.processComponent(SlingRequestProcessorImpl.java:282)
    at org.apache.sling.engine.impl.SlingRequestProcessorImpl.dispatchRequest(SlingRequestProcessorImpl.java:322)
    at org.apache.sling.engine.impl.request.SlingRequestDispatcher.dispatch(SlingRequestDispatcher.java:211)
    at org.apache.sling.engine.impl.request.SlingRequestDispatcher.include(SlingRequestDispatcher.java:104)
    at com.day.cq.wcm.core.impl.WCMComponentFilter$ForwardRequestDispatcher.include(WCMComponentFilter.java:503)
    at org.apache.jsp.libs.cq.Page.Page_jsp._jspService(Page_jsp.java:106)

 

In JSP file we have used.

 CommerceService commerceService = resource.adaptTo(CommerceService.class);
 CommerceSession commerceSession = commerceService.login(slingRequest, slingResponse);    

 

In AEM6.0 It was working properly. Showing errors in AEM6.2

 

Thanks,

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

11-10-2016

There have been a few changes with eCommerce APIs. See this content for eCommerce: 

Ask the Experts -- http://scottsdigitalcommunity.blogspot.ca/2016/08/working-with-aem-ecommerce-august-2016.html

Article - https://helpx.adobe.com/experience-manager/using/ecommerce62.html

Avatar

Avatar
Validate 10
Level 2
rahul_kumar11
Level 2

Likes

3 likes

Total Posts

36 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
View profile

Avatar
Validate 10
Level 2
rahul_kumar11
Level 2

Likes

3 likes

Total Posts

36 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Boost 3
Boost 1
View profile
rahul_kumar11
Level 2

13-10-2016

Hi,

@Opkar

Added Elastic path bundles and the status of the bundles are active state.

Still showing below Error.

*ERROR* [127.0.0.1 [1476345714841] GET /content/xyz/en_id/product.1234567893X.html HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught SlingException
java.lang.Error: Unresolved compilation problem: 
    The type com.elasticpath.aem.commerce.ElasticPathCommerceSession cannot be resolved. It is indirectly referenced from required .class files

    at org.apache.jsp.apps.projectname.components.page.productdetailpage.init_jsp.<init>(init_jsp.java:1)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.loadServlet(JspServletWrapper.java:165)
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.prepareServlet(JspServletWrapper.java:434)
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:486)
    at org.apache.sling.scripting.jsp.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:449)
    at org.apache.sling.scripting.jsp.JspScriptEngineFactory.callJsp(JspScriptEngineFactory.java:284)
    at org.apache.sling.scripting.jsp.JspScriptEngineFactory.access$100(JspScriptEngineFactory.java:102)
    at org.apache.sling.scripting.jsp.JspScriptEngineFactory$JspScriptEngine.eval(JspScriptEngineFactory.java:536)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.call(DefaultSlingScript.java:388)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.eval(DefaultSlingScript.java:184)
    at org.apache.sling.scripting.core.impl.DefaultSlingScript.service(DefaultSlingScript.java:491)
    at com.day.cq.wcm.tags.IncludeTag.includeScript(IncludeTag.java:178)
    at com.day.cq.wcm.tags.IncludeTag.doEndTag(IncludeTag.java:95)

Thanks