Error while connecting localhost in Eclipse

Statement : Error while connecting  localhost in Eclipse


  • Eclipse was using port 8080 for localhost
  • AEM was up and running on port 4502.

Solution :
Option-1:
  • Change the port number of localhost server in eclipse to 4502
  • Make sure to change the same(4502) port number in main project module POM file
Option-2:
  • Restart AEM server on port 8080 instead of 4502.
  • Make sure to change the port number 8080 in main project module POM file. That's it!.






javax.inject,version=[0.0,1) — Cannot be resolved

Statement: javax.inject,version=[0.0,1) — Cannot be resolved

Environment Details :
                                  - JRE 1.8
                                  - Eclipse oxyzen 3a IDE
                                  - AEM 6.2

Solution :
  •  add below dependency to POM file of core project as shown below and issue will get fix!.
 org.apache.sling org.apache.sling.models.api 1.2.2 provided   org.apache.sling org.apache.sling.models.impl 1.2.2 provided   org.apache.geronimo.specs geronimo-atinject_1.0_spec 1.0 provided 
  • Build the core project once again, follow the below steps shown in below screenshot.
  • Refresh the /System/console to check the status of sampleproject bundle to active state as shown below

import-org-junit-cannot-be-resolved

Statement : 

import-org-junit-cannot-be-resolved


Solution :
Perform  the below steps to resolve this
  • Right click on project-->Properties -> Java Build Path -> Libraries -> Add Library -> JUnit -> Junit 3/4
  • Rebuild the project module for which this error occured
  • Navigate to the work space path and download the Jar file or through localhost server in eclipse Sync this bundle, that's it. verify the same in Felix console
  • Or install through Felix console.