重启AEM 6.5后页面无法打开报503错误该如何解决?
问题背景
操作流程
- 克隆仓库https://github.com/adobe/aem-project-archetype,执行
mvn clean install命令 - 构建名为aemeducation的项目,执行命令:
mvn -B archetype:generate -D archetypeGroupId=com.adobe.aem -D archetypeArtifactId=aem-project-archetype -D archetypeVersion=30 -D appTitle="AEM Education" -D appId="aemeducation" -D groupId="com.company.aemeducation"
- 在新生成的项目根目录执行
mvn clean install -PautoInstallBundle -PautoInstallPackage命令 - 可通过content/aemeducation路径访问站点页面,但在http://localhost:4502/system/console/bundles页面出现报错,报错截图:

- 执行
bin/stop.bat、bin/start.bat重启AEM后,访问页面直接返回503错误,报错截图:
环境版本信息
Maven、Java版本
Apache Maven 3.8.4 (9b656c72d54e5bacbed989b64718c159fe39b537) Maven home: C:\Program Files\apache-maven-3.8.4 Java version: 1.8.0_311, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_311\jre Default locale: ru_RU, platform encoding: Cp1251 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
error.log日志内容
6.11.2021 14:47:02.841 *ERROR* [FelixDispatchQueue] aemeducation.core FrameworkEvent ERROR (org.osgi.framework.BundleException: Unable to resolve aemeducation.core [582](R 582.2): missing requirement [aemeducation.core [582](R 582.2)] osgi.wiring.package; (&(osgi.wiring.package=com.day.cq.wcm.api)(version>=1.29.0)(!(version>=2.0.0))) Unresolved requirements: [[aemeducation.core [582](R 582.2)] osgi.wiring.package; (&(osgi.wiring.package=com.day.cq.wcm.api)(version>=1.29.0)(!(version>=2.0.0)))]) org.osgi.framework.BundleException: Unable to resolve aemeducation.core [582](R 582.2): missing requirement [aemeducation.core [582](R 582.2)] osgi.wiring.package; (&(osgi.wiring.package=com.day.cq.wcm.api)(version>=1.29.0)(!(version>=2.0.0))) Unresolved requirements: [[aemeducation.core [582](R 582.2)] osgi.wiring.package; (&(osgi.wiring.package=com.day.cq.wcm.api)(version>=1.29.0)(!(version>=2.0.0)))] at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:4368) at org.apache.felix.framework.Felix.startBundle(Felix.java:2281) at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1539) at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308) at java.lang.Thread.run(Unknown Source)
问题定位
从错误日志可直接定位根因:项目核心bundle aemeducation.core 依赖com.day.cq.wcm.api包的1.29.0及以上版本,但当前本地AEM 6.5环境内置的该包版本低于1.29.0,导致OSGi依赖无法满足,bundle启动失败,最终返回503错误。
该问题的触发原因是使用的AEM项目原型(Archetype)版本和AEM环境版本不匹配:Archetype 30仅适配AEM 6.5 SP13及更高补丁版本,未打对应补丁的AEM 6.5环境无法满足其依赖要求。
解决方案
第一步:验证依赖版本
访问AEM OSGi bundle控制台http://localhost:4502/system/console/bundles,搜索com.day.cq.wcm.cq-wcm-api,查看其版本号,确认是否低于1.29.0。
第二步:选择修复方案(二选一即可)
方案1:升级AEM 6.5服务包
下载AEM 6.5 SP13或更高版本的官方服务包,上传到AEM包管理器安装,完成后重启AEM,重新部署项目即可。
方案2:更换适配当前AEM版本的Archetype
如果不希望升级AEM服务包,根据当前AEM的补丁版本选择对应版本的Archetype重新生成项目即可,对应参考:
- AEM 6.5 无服务包:使用Archetype 22
- AEM 6.5 SP6:使用Archetype 27
- AEM 6.5 SP12:使用Archetype 29
重新执行项目生成命令时,将archetypeVersion参数替换为适配的版本号即可。
第三步:验证修复
部署完成后查看OSGi控制台,确认aemeducation.core bundle状态为Active,再访问站点页面确认无503错误。
内容的提问来源于stack exchange,提问作者Hero Hamada
相关产品推荐
相关产品推荐

