0
Grails Version 2.2.4 Jax RS Plugin Version 0,8Grails служба не autowired внутри класса jaxrs ресурсов
У меня есть Grails службу по служебной папке Grails-приложения, как показано ниже
@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();
}
}
У меня есть Ресурс JAX-RS в моем приложении Grails, как показано ниже
class CDSResource implements CDSService {
def hdfsService;
@Override
CDSResponse pushRawData(CDSRequest cdsRequest) {
println(" Inside CDS Resource")
// hdfsService.write()
return null;
}
}
Я нахожу, что служба Grails не проходит автоматически. Пожалуйста, помогите
с его помощью для файлов под Grailsapp/resources files? –