Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

Classpath changed after migration?

Avatar

Former Community Member

Hi, I made a migration from 5.6 to 6.1 and everything worked fine. But I tried to make the app work in a 6.1 instance without a migration and it doesn't work, it seems that it can't find the imports

 

org.apache.sling.api.scripting.ScriptEvaluationException: org.apache.sling.scripting.jsp.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 25 in the generated java file Only a type can be imported. com.mrm.cq.mrmwp.components.ComponentCssConfiguration resolves to a package An error occurred at line: 26 in the generated java file Only a type can be imported. com.mrm.cq.mrmwp.components.ComponentADTMConfiguration resolves to a package
An error occurred at line: 11 en el archivo jsp: /apps/mrmwp/pages/globalpage/head.jsp
ComponentCssConfiguration cannot be resolved to a type 8: <% 9:  boolean disabled = com.day.cq.wcm.api.WCMMode.fromRequest(request) == com.day.cq.wcm.api.WCMMode.DISABLED; 10:  pageContext.setAttribute("isDisabled", disabled); 11:  ComponentCssConfiguration comp = new ComponentCssConfiguration(pageContext); 12:  pageContext.setAttribute("comp", comp); 13:  ComponentADTMConfiguration adtm = new ComponentADTMConfiguration(pageContext); 14:  pageContext.setAttribute("adtm", adtm);%>  

 

 

I checked that the content works, so it leaves the problem to the app.

 

How can I fix this?. What does the migration tool do to the app that makes it work?

 

Thanks.

 

EDIT: adding my pom

 

<reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> <version>${pmd.version}</version> <configuration> <linkXref>true</linkXref> <sourceEncoding>${file.encoding}</sourceEncoding> <minimumTokens>100</minimumTokens> <targetJdk>${java.target.version}</targetJdk> <minimumPriority>2</minimumPriority> </configuration> </plugin> <plugin> <groupId>org.apache.felix</groupId> <artifactId>maven-bundle-plugin</artifactId> <version>2.1.0</version> <configuration> <instructions> <Export-Package>com.mrm.cq.mrmwp.test.*</Export-Package> <Sling-Test-Regexp>.*Test</Sling-Test-Regexp> <Private-Package></Private-Package> <Import-Package></Import-Package> </instructions> </configuration> </plugin> </plugins> </reporting>
4 Replies

Avatar

Level 10

Are all backend services running? Does your AEM application make use of an OSGi bundle? 

Avatar

Former Community Member

Hi! Thanks for your answer.

 

Yes and yes.

 

Something I found is that in the instance that works fine it has 475 bundles active, but in the other instance 458. I'll try to check which bundles where not installed, but if this is the problem, how can I fix this the way the migration tool does it?.

 

Thanks.

 

EDIT:

Here we have the services missing in the 6.1 instance that doesn't work.

 

254     Adobe Project Tartan - Account Support API Bundlecom.adobe.mac.core.api.accountsupport 1.0.6 granite Active 253  Adobe Project Tartan - Core API Bundlecom.adobe.mac.core.api 1.1.6 granite Active 252  Adobe Project Tartan - Core Bundlecom.adobe.mac.core 1.1.6 granite Active 255  Adobe Project Tartan - Notification Supportcom.adobe.mac.core.api.notificationsupport 0.0.8 tartan Active 256  Adobe Project Tartan - Notification Supportcom.adobe.mac.core.notificationsupport 0.0.8 tartan Active 257  Adobe Shared Cloud Integration - Core Bundlescc-core 1.0.28 sharedcloud Active 163  Collab Blog - Bundlecom.day.cq.collab.cq-collab-blog 5.6.10 cq5 Active 164  Collab Calendar - Bundlecom.day.cq.collab.cq-collab-calendar 5.6.9 cq5 Active 165  Collab Commons - Bundlecom.day.cq.collab.cq-collab-commons 5.6.43 cq5 Active 166  Collab Core - Bundlecom.day.cq.collab.cq-collab-core 5.6.73 cq5 Active 167  Collab Forum - Bundlecom.day.cq.collab.cq-collab-forum 5.6.61 cq5 Active 174  Day Communique 5 APNS Clientcom.day.cq.cq-apns-client 0.1.6  Active 175  Day Communique 5 APNS Corecom.day.cq.cq-apns-core 5.4.0 cq5 Active 231  Day Communique 5 DAM CreativeCloud Integrationcom.day.cq.dam.cq-dam-creativecloud 5.6.8 cq5 Active 250  Day CRX SCM Integrationcom.day.crx.crx-scm-integration 2.3.11 cq5 Active 282  Social Storage - Bundlecom.adobe.cq.social.cq-social-storage 1.0.11 cq5 Active 249  svnkit bundlecom.day.commons.osgi.wrapper.svnkit 1.3.0.0002  Active

Avatar

Level 10

Your issue is that you have missing bundles - is the AEM instance you are testing with a fresh install? 

Avatar

Former Community Member

Yes, these are instances created just for the migration.

 

I manage to get the bundles from the instance that works and installed them in the instance that doesn't work, and I get:

 

org.apache.sling.api.scripting.ScriptEvaluationException: javax.servlet.ServletException: java.lang.Error: Unresolved compilation problems: Only a type can be imported. com.mrm.cq.mrmwp.components.ComponentCssConfiguration resolves to a package Only a type can be imported. com.mrm.cq.mrmwp.components.ComponentADTMConfiguration resolves to a package ComponentCssConfiguration cannot be resolved to a type ComponentCssConfiguration cannot be resolved to a type ComponentADTMConfiguration cannot be resolved to a type ComponentADTMConfiguration cannot be resolved to a type

 

How should I proceed?

Thanks.