adobe / aem-cif-project-archetype

Maven template to create new CIF Project AEM projects that follow best practices
Apache License 2.0
20 stars 12 forks source link

Commerce does not work for a new project based on Archetype 0.7.0 #78

Closed aleksitto-gh closed 4 years ago

aleksitto-gh commented 4 years ago

Expected Behaviour

Actual Behaviour

Reproduce Scenario (including but not limited to)

Steps to Reproduce

I tried to add missed library dependency and after that I found that "core-cif-components-apps-0.7.0" requires additional dependency "cif-virtual-catalog-content". After including all missed dependencies all packages were installed correctly and I found the Bind Products item in the AEM Commerce Products console. But now I have another error when I click the "Bind Products" which shows "Unable to compile class for JSP: An error occurred at line: 15 in the generated java file Only a type can be imported."

Exception:

org.apache.sling.scripting.jsp.jasper.JasperException: Unable to compile class for JSP:

An error occurred at line: 15 in the generated java file Only a type can be imported. com.adobe.cq.commerce.virtual.catalog.data.CatalogDataResourceProviderFactory resolves to a package

An error occurred at line: 16 in the generated java file Only a type can be imported. com.adobe.cq.commerce.virtual.catalog.data.CatalogDataResourceProviderManager resolves to a package

An error occurred at line: 29 in the jsp file: /libs/commerce/gui/components/admin/products/bindproducttreewizard/commerceproviderdatasource/commerceproviderdatasource.jsp CatalogDataResourceProviderFactory cannot be resolved to a type 26: <%@include file="/libs/foundation/global.jsp" %> 27: <% 28: // Get data for datasource 29: Map<String, CatalogDataResourceProviderFactory<?>> dataResourceProviderFactories = 30: sling.getService(CatalogDataResourceProviderManager.class).getProviderFactories(); 31: 32: // Build datasource

An error occurred at line: 30 in the jsp file: /libs/commerce/gui/components/admin/products/bindproducttreewizard/commerceproviderdatasource/commerceproviderdatasource.jsp CatalogDataResourceProviderManager cannot be resolved to a type 27: <% 28: // Get data for datasource 29: Map<String, CatalogDataResourceProviderFactory<?>> dataResourceProviderFactories = 30: sling.getService(CatalogDataResourceProviderManager.class).getProviderFactories(); 31: 32: // Build datasource 33: ArrayList resourceList = new ArrayList();

at org.apache.sling.scripting.jsp.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:93) at org.apache.sling.scripting.jsp.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330) at org.apache.sling.scripting.jsp.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:136) at org.apache.sling.scripting.jsp.jasper.compiler.Compiler.compile(Compiler.java:304) at org.apache.sling.scripting.jsp.jasper.compiler.Compiler.compile(Compiler.java:282) at org.apache.sling.scripting.jsp.jasper.compiler.Compiler.compile(Compiler.java:269) at org.apache.sling.scripting.jsp.jasper.JspCompilationContext.compile(JspCompilationContext.java:501)

Platform and Version

Sample Code that illustrates the problem

Logs taken while reproducing problem

mhaack commented 4 years ago

Please create the project with optionEmbedConnector=y option this should help. Or get the CIF Connector all package from https://search.maven.org/search?q=g:com.adobe.commerce.cif%20AND%20a:cif-connector-all and install before deploying the sample project.

aleksitto-gh commented 4 years ago

It works, thanks for the quick response

mhaack commented 4 years ago

👍