I am working on a jhipster application.Upon compilation time, I get a series of errors relating to symbol not found.
I have tried looking at the stack trace and re ran the code after commenting out some lines. Here is the piece of code resulting in an error:
@RequestMapping("/api")
public class PhotoResource {
private final Logger log = LoggerFactory.getLogger(PhotoResource.class);
private static final String ENTITY_NAME = "photo";
private final PhotoRepository photoRepository;
public PhotoResource(PhotoRepository photoRepository) {
this.photoRepository = photoRepository;
}
/**
* POST /photos : Create a new photo.
*
* @param photo the photo to create
* @return the ResponseEntity with status 201 (Created) and with body the new photo, or with status 400 (Bad Request) if the photo has already an ID
* @throws URISyntaxException if the Location URI syntax is incorrect
*/
@PostMapping("/photos")
@Timed
public ResponseEntity<Photo> createPhoto(@Valid @RequestBody Photo photo) throws Exception {
log.debug("REST request to save Photo : {}", photo);
if (photo.getId() != null) {
throw new BadRequestAlertException("A new photo cannot already have an ID", ENTITY_NAME, "idexists");
}
try {
photo = setMetadata(photo);
} catch (ImageProcessingException ipe) {
log.error(ipe.getMessage());
}
Photo result = photoRepository.save(photo);
return ResponseEntity.created(new URI("/api/photos/" + result.getId()))
.headers(HeaderUtil.createEntityCreationAlert(ENTITY_NAME, result.getId().toString()))
.body(result);
}
The error I get is as follows:
[ERROR] /home/nompumelelo/Desktop/gallery/src/main/java/io/github/jhipster/application/web/rest/PhotoResource.java:[50,19] cannot find symbol
[ERROR] symbol: class PhotoRepository
[ERROR] location: class com.okta.developer.web.rest.PhotoResource
[ERROR] /home/nompumelelo/Desktop/gallery/src/main/java/io/github/jhipster/application/web/rest/PhotoResource.java:[52,26] cannot find symbol
[ERROR] symbol: class PhotoRepository
[ERROR] location: class com.okta.developer.web.rest.PhotoResource
[ERROR] /home/nompumelelo/Desktop/gallery/src/main/java/io/github/jhipster/application/web/rest/PhotoResource.java:[65,66] cannot find symbol
[ERROR] symbol: class Photo
[ERROR] location: class com.okta.developer.web.rest.PhotoResource
[ERROR] /home/nompumelelo/Desktop/gallery/src/main/java/io/github/jhipster/application/web/rest/PhotoResource.java:[65,27] cannot find symbol
[ERROR] symbol: class Photo
[ERROR] location: class com.okta.developer.web.rest.PhotoResource