Grails Version 2.2.4 Jax RS Plugin Version 0.8
I have grails service under Grails-app service folder as below
@Transactional
class HdfsService {
def write(){
Configuration configuration = new Configuration();
FileSystem hdfs = FileSystem.get( new URI( "hdfs://192.168.4.110:9000" ), configuration );
Path file = new Path("hdfs://192.168.4.110:9000/vinod/table.html");
if ( hdfs.exists( file )) { hdfs.delete( file, true ); }
OutputStream os = hdfs.create( file,
new Progressable() {
public void progress() {
//println("...bytes written: [ "+bytesWritten+" ]");
} });
BufferedWriter br = new BufferedWriter( new OutputStreamWriter( os, "UTF-8" ) );
br.write("Hello World");
br.close();
hdfs.close();
}
}
I have a JAX-RS resource in my Grails App as below
class CDSResource implements CDSService {
def hdfsService;
@Override
CDSResponse pushRawData(CDSRequest cdsRequest) {
println(" Inside CDS Resource")
// hdfsService.write()
return null;
}
}
I find the Grails Service is not getting autowired. Please help