Spring-Boot BeanCreatingException










0















My project was running but after 5 minutes there is no change and i recompile my project there is an error just enter code here like this.



2018-11-12 14:04:27.508 INFO 7904 --- [ main] c.i.IwbEmuhasebeAdapterApplication : Starting IwbEmuhasebeAdapterApplication on PRMS-ALC with PID 7904 (D:eclipse-workspaceiwb-emuhasebe-adaptertargetclasses started by Alican in D:eclipse-workspaceiwb-emuhasebe-adapter)
2018-11-12 14:04:27.516 INFO 7904 --- [ main] c.i.IwbEmuhasebeAdapterApplication : No active profile set, falling back to default profiles: default
2018-11-12 14:04:27.626 INFO 7904 --- [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@5a45133e: startup date [Mon Nov 12 14:04:27 EET 2018]; root of context hierarchy
2018-11-12 14:04:30.873 INFO 7904 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8083 (http)
2018-11-12 14:04:30.940 INFO 7904 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-11-12 14:04:30.940 INFO 7904 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.34
2018-11-12 14:04:30.969 INFO 7904 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:Program FilesJavajdk1.8.0_171bin;C:WindowsSunJavabin;C:Windowssystem32;C:Windows;C:Program FilesJavajdk1.8.0_171jrebin;C:/Program Files/Java/jre1.8.0_191/bin/server;C:/Program Files/Java/jre1.8.0_191/bin;C:/Program Files/Java/jre1.8.0_191/lib/amd64;C:oracleproduct11.2.0dbhome_1bin;C:Program Files (x86)Common FilesOracleJavajavapath;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:WindowsSystem32OpenSSH;C:Program FilesJavajdk1.8.0_171;C:Program FilesGitcmd;C:Program Filesnodejs;C:Program FilesMongoDBServer3.6bin;C:Program FilesPuTTY;C:Program FilesJavajdk1.8.0_171bin;C:Program FilesJavajre1.8.0_191bin;C:UsersAlicanAppDataLocalMicrosoftWindowsApps;;C:Program Files (x86)Microsoft VS Codebin;C:UsersAlicanAppDataRoamingnpm;C:eclipse;;.]
2018-11-12 14:04:31.212 INFO 7904 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-11-12 14:04:31.213 INFO 7904 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 3599 ms
2018-11-12 14:04:31.354 INFO 7904 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
2018-11-12 14:04:31.359 INFO 7904 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-11-12 14:04:31.360 INFO 7904 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-11-12 14:04:31.360 INFO 7904 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-11-12 14:04:31.360 INFO 7904 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-11-12 14:04:31.800 WARN 7904 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'appServlet': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [com.iworkbetter.controller.AppServlet] from ClassLoader [sun.misc.Launcher$AppClassLoader@18b4aac2]
2018-11-12 14:04:31.804 INFO 7904 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]


Here is the my appServlet.java



@RestController
public class AppServlet
@Autowired
private AdapterEngine engine;

public AppServlet(AdapterEngine engine)
this.engine = engine;


@RequestMapping("/EFaturaSender")
public void hndEFaturaSender(HttpServletRequest request, HttpServletResponse response)
Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;

if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();



response.setContentType("text/html; charset=UTF-8");
engine.eFaturaSender(customizationId, AdapterUtil.uInt(requestParams.get("efatura_id")));


/*
* @RequestMapping("/EFaturaReceiverGelen") public void
* hndEFaturaReceiverGelen(HttpServletRequest request, HttpServletResponse
* response) throws IOException Map<String, String> requestParams =
* AdapterUtil.getParameterMap(request); int customizationId = 0;
*
* if (!AdapterUtil.isEmpty(requestParams.get("customizationId"))) try
* customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
* catch (Exception e) e.printStackTrace(); int insertedInvoice = 0;
* response.setContentType("text/html; charset=UTF-8"); insertedInvoice =
* engine.eFaturaGelenAra(customizationId,
* AdapterUtil.uDate(requestParams.get("start_dt")),
* AdapterUtil.uDate(requestParams.get("end_dt")));
* response.getWriter().write("'success':true,'insertedInvoice':" +
* insertedInvoice + "");
*
*
*/

@RequestMapping("/EFaturaReceiverGiden") // TODO Şimdilik gerek yok
public void hndEFaturaReceiverGiden(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException

Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;

if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();



int insertedInvoice = 0;
response.setContentType("text/html; charset=UTF-8");
try
insertedInvoice = engine.eFaturaAlGiden(customizationId, requestParams);
response.getWriter().write("'success':true,'insertedInvoice':" + insertedInvoice + "");
catch (Exception e)
response.getWriter().write("'success':false");
e.printStackTrace();
finally
response.getWriter().close();



@RequestMapping("/EFaturaMukellefGuncelle") // TODO
public void hndEFaturaMukellefGuncelle(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;
if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();



int insertedMukellef = 0;
response.setContentType("text/html; charset=UTF-8");
try
insertedMukellef = engine.eFaturaMukellefGuncelle(customizationId);
response.getWriter().write("'success':true,'insertedMukellef':" + insertedMukellef + "");
catch (IOException e)
response.getWriter().write("'success':false");
e.printStackTrace();
finally
response.getWriter().close();



@RequestMapping("/EFaturaGelenFaturaDurum")
public void hndGelenEFaturaDurumGuncelle(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;

if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();


response.setContentType("text/html; charset=UTF-8");
try
engine.eFaturaGelenDurumSorgula(customizationId, AdapterUtil.uInt(requestParams.get("efatura_id")));
response.getWriter().write("'success':true");
catch (Exception e)
response.getWriter().write("'success':false");
e.printStackTrace();
finally
response.getWriter().close();



@RequestMapping("/EFaturaGidenFaturaDurum")
public void hndGidenEFaturaDurumGuncelle(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;

if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();


response.setContentType("text/html; charset=UTF-8");
try
engine.eFaturaGidenFaturaDurumSorgula(customizationId, AdapterUtil.uInt(requestParams.get("efatura_id")));
response.getWriter().write("'success':true");
catch (Exception e)
response.getWriter().write("'success':false");
e.printStackTrace();
finally
response.getWriter().close();



@RequestMapping("/EFaturaYanıtla")
public void hndEFaturaYanitla(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;

if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();


response.setContentType("text/html; charset=UTF-8");
try
engine.eFaturaYanitla(customizationId, requestParams);
response.getWriter().write("'success':true");
catch (Exception e)
response.getWriter().write("'success':false");
e.printStackTrace();
finally
response.getWriter().close();



// @Scheduled(fixedRate = 200000) // gelen fatura icin scheduled
public void scheduled4ReceiverInvoice()
int customizationId = 0;// TODO
Date end_date = new Date();
GregorianCalendar start_date = new GregorianCalendar();
start_date.setTime(end_date);
start_date.add(Calendar.DATE, -6);// bugunle 6 gun oncesi
engine.eFaturaGelenAra(customizationId, start_date.getTime(), end_date);



// @Scheduled(fixedRate = 200000)
public void scheduled4MukellefUpdate()
int customizationId = 0;
engine.eFaturaMukellefGuncelle(customizationId);


@RequestMapping("EFaturaReceiverGelen")
public void deserializeTest(HttpServletRequest request, HttpServletResponse response)
throws JAXBException, IOException
Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;

if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();


int insertedInvoice = 0;
response.setContentType("text/html; charset=UTF-8");
insertedInvoice = engine.deserializeTest(customizationId, AdapterUtil.uDate(requestParams.get("start_dt")),
AdapterUtil.uDate(requestParams.get("end_dt")));
response.getWriter().write("'success':true,'insertedInvoice':" + insertedInvoice + "");



@RequestMapping("ShowInvoice")
public void showInvoiceOnBrowser(HttpServletRequest request, HttpServletResponse response) throws IOException
byte pdfBytes = engine.showInvoice();

JSONObject j = new JSONObject();
try
j.put("data1", pdfBytes);
catch (JSONException e2)
// TODO Auto-generated catch block
e2.printStackTrace();

// response.setContentType("application/json");
PrintWriter out = response.getWriter();
response.setContentType("application/json");
response.setCharacterEncoding("UTF-8");
out.print(j);
out.flush();

try
response.getWriter().write("'success':true,'data':" + "");
catch (IOException e)
// TODO Auto-generated catch block
e.printStackTrace();

/*
* response.setHeader("Content-Type", "text/plain");
* response.setHeader("success", "yes"); PrintWriter writer =
* response.getWriter(); writer.write(pdfBytes.toString()); writer.close();
*/





and this is the warning message:




2018-11-12 14:54:13.580 WARN 7784 --- [ main]
ConfigServletWebServerApplicationContext : Exception encountered
during context initialization - cancelling refresh attempt:
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'appServlet': Lookup method resolution failed;
nested exception is java.lang.IllegalStateException: Failed to
introspect Class [com.iworkbetter.controller.AppServlet] from
ClassLoader [sun.misc.Launcher$AppClassLoader@18b4aac2]











share|improve this question



















  • 2





    you should provide the code that generates that error... without it nobody can guess what is happening

    – DaFois
    Nov 12 '18 at 11:31











  • please check my edit @DaFois

    – asahin
    Nov 12 '18 at 11:57












  • You should make use of @Autowired without the braces. I dont know if this solves your problem.

    – sven.kwiotek
    Nov 12 '18 at 12:25











  • Sorry this is not the problem . I make a mistake when i was copy/paste @sven.kwiotek

    – asahin
    Nov 12 '18 at 12:27











  • You have to avoid double defined AdapterEngine. On the one hand you resolve the class by autowire as field and once again as constructor parameter.

    – sven.kwiotek
    Nov 12 '18 at 12:36















0















My project was running but after 5 minutes there is no change and i recompile my project there is an error just enter code here like this.



2018-11-12 14:04:27.508 INFO 7904 --- [ main] c.i.IwbEmuhasebeAdapterApplication : Starting IwbEmuhasebeAdapterApplication on PRMS-ALC with PID 7904 (D:eclipse-workspaceiwb-emuhasebe-adaptertargetclasses started by Alican in D:eclipse-workspaceiwb-emuhasebe-adapter)
2018-11-12 14:04:27.516 INFO 7904 --- [ main] c.i.IwbEmuhasebeAdapterApplication : No active profile set, falling back to default profiles: default
2018-11-12 14:04:27.626 INFO 7904 --- [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@5a45133e: startup date [Mon Nov 12 14:04:27 EET 2018]; root of context hierarchy
2018-11-12 14:04:30.873 INFO 7904 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8083 (http)
2018-11-12 14:04:30.940 INFO 7904 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-11-12 14:04:30.940 INFO 7904 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.34
2018-11-12 14:04:30.969 INFO 7904 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:Program FilesJavajdk1.8.0_171bin;C:WindowsSunJavabin;C:Windowssystem32;C:Windows;C:Program FilesJavajdk1.8.0_171jrebin;C:/Program Files/Java/jre1.8.0_191/bin/server;C:/Program Files/Java/jre1.8.0_191/bin;C:/Program Files/Java/jre1.8.0_191/lib/amd64;C:oracleproduct11.2.0dbhome_1bin;C:Program Files (x86)Common FilesOracleJavajavapath;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:WindowsSystem32OpenSSH;C:Program FilesJavajdk1.8.0_171;C:Program FilesGitcmd;C:Program Filesnodejs;C:Program FilesMongoDBServer3.6bin;C:Program FilesPuTTY;C:Program FilesJavajdk1.8.0_171bin;C:Program FilesJavajre1.8.0_191bin;C:UsersAlicanAppDataLocalMicrosoftWindowsApps;;C:Program Files (x86)Microsoft VS Codebin;C:UsersAlicanAppDataRoamingnpm;C:eclipse;;.]
2018-11-12 14:04:31.212 INFO 7904 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-11-12 14:04:31.213 INFO 7904 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 3599 ms
2018-11-12 14:04:31.354 INFO 7904 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
2018-11-12 14:04:31.359 INFO 7904 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-11-12 14:04:31.360 INFO 7904 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-11-12 14:04:31.360 INFO 7904 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-11-12 14:04:31.360 INFO 7904 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-11-12 14:04:31.800 WARN 7904 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'appServlet': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [com.iworkbetter.controller.AppServlet] from ClassLoader [sun.misc.Launcher$AppClassLoader@18b4aac2]
2018-11-12 14:04:31.804 INFO 7904 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]


Here is the my appServlet.java



@RestController
public class AppServlet
@Autowired
private AdapterEngine engine;

public AppServlet(AdapterEngine engine)
this.engine = engine;


@RequestMapping("/EFaturaSender")
public void hndEFaturaSender(HttpServletRequest request, HttpServletResponse response)
Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;

if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();



response.setContentType("text/html; charset=UTF-8");
engine.eFaturaSender(customizationId, AdapterUtil.uInt(requestParams.get("efatura_id")));


/*
* @RequestMapping("/EFaturaReceiverGelen") public void
* hndEFaturaReceiverGelen(HttpServletRequest request, HttpServletResponse
* response) throws IOException Map<String, String> requestParams =
* AdapterUtil.getParameterMap(request); int customizationId = 0;
*
* if (!AdapterUtil.isEmpty(requestParams.get("customizationId"))) try
* customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
* catch (Exception e) e.printStackTrace(); int insertedInvoice = 0;
* response.setContentType("text/html; charset=UTF-8"); insertedInvoice =
* engine.eFaturaGelenAra(customizationId,
* AdapterUtil.uDate(requestParams.get("start_dt")),
* AdapterUtil.uDate(requestParams.get("end_dt")));
* response.getWriter().write("'success':true,'insertedInvoice':" +
* insertedInvoice + "");
*
*
*/

@RequestMapping("/EFaturaReceiverGiden") // TODO Şimdilik gerek yok
public void hndEFaturaReceiverGiden(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException

Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;

if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();



int insertedInvoice = 0;
response.setContentType("text/html; charset=UTF-8");
try
insertedInvoice = engine.eFaturaAlGiden(customizationId, requestParams);
response.getWriter().write("'success':true,'insertedInvoice':" + insertedInvoice + "");
catch (Exception e)
response.getWriter().write("'success':false");
e.printStackTrace();
finally
response.getWriter().close();



@RequestMapping("/EFaturaMukellefGuncelle") // TODO
public void hndEFaturaMukellefGuncelle(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;
if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();



int insertedMukellef = 0;
response.setContentType("text/html; charset=UTF-8");
try
insertedMukellef = engine.eFaturaMukellefGuncelle(customizationId);
response.getWriter().write("'success':true,'insertedMukellef':" + insertedMukellef + "");
catch (IOException e)
response.getWriter().write("'success':false");
e.printStackTrace();
finally
response.getWriter().close();



@RequestMapping("/EFaturaGelenFaturaDurum")
public void hndGelenEFaturaDurumGuncelle(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;

if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();


response.setContentType("text/html; charset=UTF-8");
try
engine.eFaturaGelenDurumSorgula(customizationId, AdapterUtil.uInt(requestParams.get("efatura_id")));
response.getWriter().write("'success':true");
catch (Exception e)
response.getWriter().write("'success':false");
e.printStackTrace();
finally
response.getWriter().close();



@RequestMapping("/EFaturaGidenFaturaDurum")
public void hndGidenEFaturaDurumGuncelle(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;

if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();


response.setContentType("text/html; charset=UTF-8");
try
engine.eFaturaGidenFaturaDurumSorgula(customizationId, AdapterUtil.uInt(requestParams.get("efatura_id")));
response.getWriter().write("'success':true");
catch (Exception e)
response.getWriter().write("'success':false");
e.printStackTrace();
finally
response.getWriter().close();



@RequestMapping("/EFaturaYanıtla")
public void hndEFaturaYanitla(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;

if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();


response.setContentType("text/html; charset=UTF-8");
try
engine.eFaturaYanitla(customizationId, requestParams);
response.getWriter().write("'success':true");
catch (Exception e)
response.getWriter().write("'success':false");
e.printStackTrace();
finally
response.getWriter().close();



// @Scheduled(fixedRate = 200000) // gelen fatura icin scheduled
public void scheduled4ReceiverInvoice()
int customizationId = 0;// TODO
Date end_date = new Date();
GregorianCalendar start_date = new GregorianCalendar();
start_date.setTime(end_date);
start_date.add(Calendar.DATE, -6);// bugunle 6 gun oncesi
engine.eFaturaGelenAra(customizationId, start_date.getTime(), end_date);



// @Scheduled(fixedRate = 200000)
public void scheduled4MukellefUpdate()
int customizationId = 0;
engine.eFaturaMukellefGuncelle(customizationId);


@RequestMapping("EFaturaReceiverGelen")
public void deserializeTest(HttpServletRequest request, HttpServletResponse response)
throws JAXBException, IOException
Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;

if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();


int insertedInvoice = 0;
response.setContentType("text/html; charset=UTF-8");
insertedInvoice = engine.deserializeTest(customizationId, AdapterUtil.uDate(requestParams.get("start_dt")),
AdapterUtil.uDate(requestParams.get("end_dt")));
response.getWriter().write("'success':true,'insertedInvoice':" + insertedInvoice + "");



@RequestMapping("ShowInvoice")
public void showInvoiceOnBrowser(HttpServletRequest request, HttpServletResponse response) throws IOException
byte pdfBytes = engine.showInvoice();

JSONObject j = new JSONObject();
try
j.put("data1", pdfBytes);
catch (JSONException e2)
// TODO Auto-generated catch block
e2.printStackTrace();

// response.setContentType("application/json");
PrintWriter out = response.getWriter();
response.setContentType("application/json");
response.setCharacterEncoding("UTF-8");
out.print(j);
out.flush();

try
response.getWriter().write("'success':true,'data':" + "");
catch (IOException e)
// TODO Auto-generated catch block
e.printStackTrace();

/*
* response.setHeader("Content-Type", "text/plain");
* response.setHeader("success", "yes"); PrintWriter writer =
* response.getWriter(); writer.write(pdfBytes.toString()); writer.close();
*/





and this is the warning message:




2018-11-12 14:54:13.580 WARN 7784 --- [ main]
ConfigServletWebServerApplicationContext : Exception encountered
during context initialization - cancelling refresh attempt:
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'appServlet': Lookup method resolution failed;
nested exception is java.lang.IllegalStateException: Failed to
introspect Class [com.iworkbetter.controller.AppServlet] from
ClassLoader [sun.misc.Launcher$AppClassLoader@18b4aac2]











share|improve this question



















  • 2





    you should provide the code that generates that error... without it nobody can guess what is happening

    – DaFois
    Nov 12 '18 at 11:31











  • please check my edit @DaFois

    – asahin
    Nov 12 '18 at 11:57












  • You should make use of @Autowired without the braces. I dont know if this solves your problem.

    – sven.kwiotek
    Nov 12 '18 at 12:25











  • Sorry this is not the problem . I make a mistake when i was copy/paste @sven.kwiotek

    – asahin
    Nov 12 '18 at 12:27











  • You have to avoid double defined AdapterEngine. On the one hand you resolve the class by autowire as field and once again as constructor parameter.

    – sven.kwiotek
    Nov 12 '18 at 12:36













0












0








0








My project was running but after 5 minutes there is no change and i recompile my project there is an error just enter code here like this.



2018-11-12 14:04:27.508 INFO 7904 --- [ main] c.i.IwbEmuhasebeAdapterApplication : Starting IwbEmuhasebeAdapterApplication on PRMS-ALC with PID 7904 (D:eclipse-workspaceiwb-emuhasebe-adaptertargetclasses started by Alican in D:eclipse-workspaceiwb-emuhasebe-adapter)
2018-11-12 14:04:27.516 INFO 7904 --- [ main] c.i.IwbEmuhasebeAdapterApplication : No active profile set, falling back to default profiles: default
2018-11-12 14:04:27.626 INFO 7904 --- [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@5a45133e: startup date [Mon Nov 12 14:04:27 EET 2018]; root of context hierarchy
2018-11-12 14:04:30.873 INFO 7904 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8083 (http)
2018-11-12 14:04:30.940 INFO 7904 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-11-12 14:04:30.940 INFO 7904 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.34
2018-11-12 14:04:30.969 INFO 7904 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:Program FilesJavajdk1.8.0_171bin;C:WindowsSunJavabin;C:Windowssystem32;C:Windows;C:Program FilesJavajdk1.8.0_171jrebin;C:/Program Files/Java/jre1.8.0_191/bin/server;C:/Program Files/Java/jre1.8.0_191/bin;C:/Program Files/Java/jre1.8.0_191/lib/amd64;C:oracleproduct11.2.0dbhome_1bin;C:Program Files (x86)Common FilesOracleJavajavapath;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:WindowsSystem32OpenSSH;C:Program FilesJavajdk1.8.0_171;C:Program FilesGitcmd;C:Program Filesnodejs;C:Program FilesMongoDBServer3.6bin;C:Program FilesPuTTY;C:Program FilesJavajdk1.8.0_171bin;C:Program FilesJavajre1.8.0_191bin;C:UsersAlicanAppDataLocalMicrosoftWindowsApps;;C:Program Files (x86)Microsoft VS Codebin;C:UsersAlicanAppDataRoamingnpm;C:eclipse;;.]
2018-11-12 14:04:31.212 INFO 7904 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-11-12 14:04:31.213 INFO 7904 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 3599 ms
2018-11-12 14:04:31.354 INFO 7904 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
2018-11-12 14:04:31.359 INFO 7904 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-11-12 14:04:31.360 INFO 7904 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-11-12 14:04:31.360 INFO 7904 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-11-12 14:04:31.360 INFO 7904 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-11-12 14:04:31.800 WARN 7904 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'appServlet': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [com.iworkbetter.controller.AppServlet] from ClassLoader [sun.misc.Launcher$AppClassLoader@18b4aac2]
2018-11-12 14:04:31.804 INFO 7904 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]


Here is the my appServlet.java



@RestController
public class AppServlet
@Autowired
private AdapterEngine engine;

public AppServlet(AdapterEngine engine)
this.engine = engine;


@RequestMapping("/EFaturaSender")
public void hndEFaturaSender(HttpServletRequest request, HttpServletResponse response)
Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;

if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();



response.setContentType("text/html; charset=UTF-8");
engine.eFaturaSender(customizationId, AdapterUtil.uInt(requestParams.get("efatura_id")));


/*
* @RequestMapping("/EFaturaReceiverGelen") public void
* hndEFaturaReceiverGelen(HttpServletRequest request, HttpServletResponse
* response) throws IOException Map<String, String> requestParams =
* AdapterUtil.getParameterMap(request); int customizationId = 0;
*
* if (!AdapterUtil.isEmpty(requestParams.get("customizationId"))) try
* customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
* catch (Exception e) e.printStackTrace(); int insertedInvoice = 0;
* response.setContentType("text/html; charset=UTF-8"); insertedInvoice =
* engine.eFaturaGelenAra(customizationId,
* AdapterUtil.uDate(requestParams.get("start_dt")),
* AdapterUtil.uDate(requestParams.get("end_dt")));
* response.getWriter().write("'success':true,'insertedInvoice':" +
* insertedInvoice + "");
*
*
*/

@RequestMapping("/EFaturaReceiverGiden") // TODO Şimdilik gerek yok
public void hndEFaturaReceiverGiden(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException

Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;

if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();



int insertedInvoice = 0;
response.setContentType("text/html; charset=UTF-8");
try
insertedInvoice = engine.eFaturaAlGiden(customizationId, requestParams);
response.getWriter().write("'success':true,'insertedInvoice':" + insertedInvoice + "");
catch (Exception e)
response.getWriter().write("'success':false");
e.printStackTrace();
finally
response.getWriter().close();



@RequestMapping("/EFaturaMukellefGuncelle") // TODO
public void hndEFaturaMukellefGuncelle(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;
if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();



int insertedMukellef = 0;
response.setContentType("text/html; charset=UTF-8");
try
insertedMukellef = engine.eFaturaMukellefGuncelle(customizationId);
response.getWriter().write("'success':true,'insertedMukellef':" + insertedMukellef + "");
catch (IOException e)
response.getWriter().write("'success':false");
e.printStackTrace();
finally
response.getWriter().close();



@RequestMapping("/EFaturaGelenFaturaDurum")
public void hndGelenEFaturaDurumGuncelle(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;

if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();


response.setContentType("text/html; charset=UTF-8");
try
engine.eFaturaGelenDurumSorgula(customizationId, AdapterUtil.uInt(requestParams.get("efatura_id")));
response.getWriter().write("'success':true");
catch (Exception e)
response.getWriter().write("'success':false");
e.printStackTrace();
finally
response.getWriter().close();



@RequestMapping("/EFaturaGidenFaturaDurum")
public void hndGidenEFaturaDurumGuncelle(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;

if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();


response.setContentType("text/html; charset=UTF-8");
try
engine.eFaturaGidenFaturaDurumSorgula(customizationId, AdapterUtil.uInt(requestParams.get("efatura_id")));
response.getWriter().write("'success':true");
catch (Exception e)
response.getWriter().write("'success':false");
e.printStackTrace();
finally
response.getWriter().close();



@RequestMapping("/EFaturaYanıtla")
public void hndEFaturaYanitla(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;

if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();


response.setContentType("text/html; charset=UTF-8");
try
engine.eFaturaYanitla(customizationId, requestParams);
response.getWriter().write("'success':true");
catch (Exception e)
response.getWriter().write("'success':false");
e.printStackTrace();
finally
response.getWriter().close();



// @Scheduled(fixedRate = 200000) // gelen fatura icin scheduled
public void scheduled4ReceiverInvoice()
int customizationId = 0;// TODO
Date end_date = new Date();
GregorianCalendar start_date = new GregorianCalendar();
start_date.setTime(end_date);
start_date.add(Calendar.DATE, -6);// bugunle 6 gun oncesi
engine.eFaturaGelenAra(customizationId, start_date.getTime(), end_date);



// @Scheduled(fixedRate = 200000)
public void scheduled4MukellefUpdate()
int customizationId = 0;
engine.eFaturaMukellefGuncelle(customizationId);


@RequestMapping("EFaturaReceiverGelen")
public void deserializeTest(HttpServletRequest request, HttpServletResponse response)
throws JAXBException, IOException
Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;

if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();


int insertedInvoice = 0;
response.setContentType("text/html; charset=UTF-8");
insertedInvoice = engine.deserializeTest(customizationId, AdapterUtil.uDate(requestParams.get("start_dt")),
AdapterUtil.uDate(requestParams.get("end_dt")));
response.getWriter().write("'success':true,'insertedInvoice':" + insertedInvoice + "");



@RequestMapping("ShowInvoice")
public void showInvoiceOnBrowser(HttpServletRequest request, HttpServletResponse response) throws IOException
byte pdfBytes = engine.showInvoice();

JSONObject j = new JSONObject();
try
j.put("data1", pdfBytes);
catch (JSONException e2)
// TODO Auto-generated catch block
e2.printStackTrace();

// response.setContentType("application/json");
PrintWriter out = response.getWriter();
response.setContentType("application/json");
response.setCharacterEncoding("UTF-8");
out.print(j);
out.flush();

try
response.getWriter().write("'success':true,'data':" + "");
catch (IOException e)
// TODO Auto-generated catch block
e.printStackTrace();

/*
* response.setHeader("Content-Type", "text/plain");
* response.setHeader("success", "yes"); PrintWriter writer =
* response.getWriter(); writer.write(pdfBytes.toString()); writer.close();
*/





and this is the warning message:




2018-11-12 14:54:13.580 WARN 7784 --- [ main]
ConfigServletWebServerApplicationContext : Exception encountered
during context initialization - cancelling refresh attempt:
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'appServlet': Lookup method resolution failed;
nested exception is java.lang.IllegalStateException: Failed to
introspect Class [com.iworkbetter.controller.AppServlet] from
ClassLoader [sun.misc.Launcher$AppClassLoader@18b4aac2]











share|improve this question
















My project was running but after 5 minutes there is no change and i recompile my project there is an error just enter code here like this.



2018-11-12 14:04:27.508 INFO 7904 --- [ main] c.i.IwbEmuhasebeAdapterApplication : Starting IwbEmuhasebeAdapterApplication on PRMS-ALC with PID 7904 (D:eclipse-workspaceiwb-emuhasebe-adaptertargetclasses started by Alican in D:eclipse-workspaceiwb-emuhasebe-adapter)
2018-11-12 14:04:27.516 INFO 7904 --- [ main] c.i.IwbEmuhasebeAdapterApplication : No active profile set, falling back to default profiles: default
2018-11-12 14:04:27.626 INFO 7904 --- [ main] ConfigServletWebServerApplicationContext : Refreshing org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@5a45133e: startup date [Mon Nov 12 14:04:27 EET 2018]; root of context hierarchy
2018-11-12 14:04:30.873 INFO 7904 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8083 (http)
2018-11-12 14:04:30.940 INFO 7904 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2018-11-12 14:04:30.940 INFO 7904 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet Engine: Apache Tomcat/8.5.34
2018-11-12 14:04:30.969 INFO 7904 --- [ost-startStop-1] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [C:Program FilesJavajdk1.8.0_171bin;C:WindowsSunJavabin;C:Windowssystem32;C:Windows;C:Program FilesJavajdk1.8.0_171jrebin;C:/Program Files/Java/jre1.8.0_191/bin/server;C:/Program Files/Java/jre1.8.0_191/bin;C:/Program Files/Java/jre1.8.0_191/lib/amd64;C:oracleproduct11.2.0dbhome_1bin;C:Program Files (x86)Common FilesOracleJavajavapath;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:WindowsSystem32OpenSSH;C:Program FilesJavajdk1.8.0_171;C:Program FilesGitcmd;C:Program Filesnodejs;C:Program FilesMongoDBServer3.6bin;C:Program FilesPuTTY;C:Program FilesJavajdk1.8.0_171bin;C:Program FilesJavajre1.8.0_191bin;C:UsersAlicanAppDataLocalMicrosoftWindowsApps;;C:Program Files (x86)Microsoft VS Codebin;C:UsersAlicanAppDataRoamingnpm;C:eclipse;;.]
2018-11-12 14:04:31.212 INFO 7904 --- [ost-startStop-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext
2018-11-12 14:04:31.213 INFO 7904 --- [ost-startStop-1] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 3599 ms
2018-11-12 14:04:31.354 INFO 7904 --- [ost-startStop-1] o.s.b.w.servlet.ServletRegistrationBean : Servlet dispatcherServlet mapped to [/]
2018-11-12 14:04:31.359 INFO 7904 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'characterEncodingFilter' to: [/*]
2018-11-12 14:04:31.360 INFO 7904 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'hiddenHttpMethodFilter' to: [/*]
2018-11-12 14:04:31.360 INFO 7904 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'httpPutFormContentFilter' to: [/*]
2018-11-12 14:04:31.360 INFO 7904 --- [ost-startStop-1] o.s.b.w.servlet.FilterRegistrationBean : Mapping filter: 'requestContextFilter' to: [/*]
2018-11-12 14:04:31.800 WARN 7904 --- [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'appServlet': Lookup method resolution failed; nested exception is java.lang.IllegalStateException: Failed to introspect Class [com.iworkbetter.controller.AppServlet] from ClassLoader [sun.misc.Launcher$AppClassLoader@18b4aac2]
2018-11-12 14:04:31.804 INFO 7904 --- [ main] o.apache.catalina.core.StandardService : Stopping service [Tomcat]


Here is the my appServlet.java



@RestController
public class AppServlet
@Autowired
private AdapterEngine engine;

public AppServlet(AdapterEngine engine)
this.engine = engine;


@RequestMapping("/EFaturaSender")
public void hndEFaturaSender(HttpServletRequest request, HttpServletResponse response)
Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;

if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();



response.setContentType("text/html; charset=UTF-8");
engine.eFaturaSender(customizationId, AdapterUtil.uInt(requestParams.get("efatura_id")));


/*
* @RequestMapping("/EFaturaReceiverGelen") public void
* hndEFaturaReceiverGelen(HttpServletRequest request, HttpServletResponse
* response) throws IOException Map<String, String> requestParams =
* AdapterUtil.getParameterMap(request); int customizationId = 0;
*
* if (!AdapterUtil.isEmpty(requestParams.get("customizationId"))) try
* customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
* catch (Exception e) e.printStackTrace(); int insertedInvoice = 0;
* response.setContentType("text/html; charset=UTF-8"); insertedInvoice =
* engine.eFaturaGelenAra(customizationId,
* AdapterUtil.uDate(requestParams.get("start_dt")),
* AdapterUtil.uDate(requestParams.get("end_dt")));
* response.getWriter().write("'success':true,'insertedInvoice':" +
* insertedInvoice + "");
*
*
*/

@RequestMapping("/EFaturaReceiverGiden") // TODO Şimdilik gerek yok
public void hndEFaturaReceiverGiden(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException

Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;

if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();



int insertedInvoice = 0;
response.setContentType("text/html; charset=UTF-8");
try
insertedInvoice = engine.eFaturaAlGiden(customizationId, requestParams);
response.getWriter().write("'success':true,'insertedInvoice':" + insertedInvoice + "");
catch (Exception e)
response.getWriter().write("'success':false");
e.printStackTrace();
finally
response.getWriter().close();



@RequestMapping("/EFaturaMukellefGuncelle") // TODO
public void hndEFaturaMukellefGuncelle(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;
if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();



int insertedMukellef = 0;
response.setContentType("text/html; charset=UTF-8");
try
insertedMukellef = engine.eFaturaMukellefGuncelle(customizationId);
response.getWriter().write("'success':true,'insertedMukellef':" + insertedMukellef + "");
catch (IOException e)
response.getWriter().write("'success':false");
e.printStackTrace();
finally
response.getWriter().close();



@RequestMapping("/EFaturaGelenFaturaDurum")
public void hndGelenEFaturaDurumGuncelle(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;

if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();


response.setContentType("text/html; charset=UTF-8");
try
engine.eFaturaGelenDurumSorgula(customizationId, AdapterUtil.uInt(requestParams.get("efatura_id")));
response.getWriter().write("'success':true");
catch (Exception e)
response.getWriter().write("'success':false");
e.printStackTrace();
finally
response.getWriter().close();



@RequestMapping("/EFaturaGidenFaturaDurum")
public void hndGidenEFaturaDurumGuncelle(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;

if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();


response.setContentType("text/html; charset=UTF-8");
try
engine.eFaturaGidenFaturaDurumSorgula(customizationId, AdapterUtil.uInt(requestParams.get("efatura_id")));
response.getWriter().write("'success':true");
catch (Exception e)
response.getWriter().write("'success':false");
e.printStackTrace();
finally
response.getWriter().close();



@RequestMapping("/EFaturaYanıtla")
public void hndEFaturaYanitla(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;

if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();


response.setContentType("text/html; charset=UTF-8");
try
engine.eFaturaYanitla(customizationId, requestParams);
response.getWriter().write("'success':true");
catch (Exception e)
response.getWriter().write("'success':false");
e.printStackTrace();
finally
response.getWriter().close();



// @Scheduled(fixedRate = 200000) // gelen fatura icin scheduled
public void scheduled4ReceiverInvoice()
int customizationId = 0;// TODO
Date end_date = new Date();
GregorianCalendar start_date = new GregorianCalendar();
start_date.setTime(end_date);
start_date.add(Calendar.DATE, -6);// bugunle 6 gun oncesi
engine.eFaturaGelenAra(customizationId, start_date.getTime(), end_date);



// @Scheduled(fixedRate = 200000)
public void scheduled4MukellefUpdate()
int customizationId = 0;
engine.eFaturaMukellefGuncelle(customizationId);


@RequestMapping("EFaturaReceiverGelen")
public void deserializeTest(HttpServletRequest request, HttpServletResponse response)
throws JAXBException, IOException
Map<String, String> requestParams = AdapterUtil.getParameterMap(request);
int customizationId = 0;

if (!AdapterUtil.isEmpty(requestParams.get("customizationId")))
try
customizationId = AdapterUtil.uInt(requestParams.get("customizationId"));
catch (Exception e)
e.printStackTrace();


int insertedInvoice = 0;
response.setContentType("text/html; charset=UTF-8");
insertedInvoice = engine.deserializeTest(customizationId, AdapterUtil.uDate(requestParams.get("start_dt")),
AdapterUtil.uDate(requestParams.get("end_dt")));
response.getWriter().write("'success':true,'insertedInvoice':" + insertedInvoice + "");



@RequestMapping("ShowInvoice")
public void showInvoiceOnBrowser(HttpServletRequest request, HttpServletResponse response) throws IOException
byte pdfBytes = engine.showInvoice();

JSONObject j = new JSONObject();
try
j.put("data1", pdfBytes);
catch (JSONException e2)
// TODO Auto-generated catch block
e2.printStackTrace();

// response.setContentType("application/json");
PrintWriter out = response.getWriter();
response.setContentType("application/json");
response.setCharacterEncoding("UTF-8");
out.print(j);
out.flush();

try
response.getWriter().write("'success':true,'data':" + "");
catch (IOException e)
// TODO Auto-generated catch block
e.printStackTrace();

/*
* response.setHeader("Content-Type", "text/plain");
* response.setHeader("success", "yes"); PrintWriter writer =
* response.getWriter(); writer.write(pdfBytes.toString()); writer.close();
*/





and this is the warning message:




2018-11-12 14:54:13.580 WARN 7784 --- [ main]
ConfigServletWebServerApplicationContext : Exception encountered
during context initialization - cancelling refresh attempt:
org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'appServlet': Lookup method resolution failed;
nested exception is java.lang.IllegalStateException: Failed to
introspect Class [com.iworkbetter.controller.AppServlet] from
ClassLoader [sun.misc.Launcher$AppClassLoader@18b4aac2]








spring spring-boot






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 12 '18 at 20:18









Michael Petch

25.2k556101




25.2k556101










asked Nov 12 '18 at 11:08









asahinasahin

12




12







  • 2





    you should provide the code that generates that error... without it nobody can guess what is happening

    – DaFois
    Nov 12 '18 at 11:31











  • please check my edit @DaFois

    – asahin
    Nov 12 '18 at 11:57












  • You should make use of @Autowired without the braces. I dont know if this solves your problem.

    – sven.kwiotek
    Nov 12 '18 at 12:25











  • Sorry this is not the problem . I make a mistake when i was copy/paste @sven.kwiotek

    – asahin
    Nov 12 '18 at 12:27











  • You have to avoid double defined AdapterEngine. On the one hand you resolve the class by autowire as field and once again as constructor parameter.

    – sven.kwiotek
    Nov 12 '18 at 12:36












  • 2





    you should provide the code that generates that error... without it nobody can guess what is happening

    – DaFois
    Nov 12 '18 at 11:31











  • please check my edit @DaFois

    – asahin
    Nov 12 '18 at 11:57












  • You should make use of @Autowired without the braces. I dont know if this solves your problem.

    – sven.kwiotek
    Nov 12 '18 at 12:25











  • Sorry this is not the problem . I make a mistake when i was copy/paste @sven.kwiotek

    – asahin
    Nov 12 '18 at 12:27











  • You have to avoid double defined AdapterEngine. On the one hand you resolve the class by autowire as field and once again as constructor parameter.

    – sven.kwiotek
    Nov 12 '18 at 12:36







2




2





you should provide the code that generates that error... without it nobody can guess what is happening

– DaFois
Nov 12 '18 at 11:31





you should provide the code that generates that error... without it nobody can guess what is happening

– DaFois
Nov 12 '18 at 11:31













please check my edit @DaFois

– asahin
Nov 12 '18 at 11:57






please check my edit @DaFois

– asahin
Nov 12 '18 at 11:57














You should make use of @Autowired without the braces. I dont know if this solves your problem.

– sven.kwiotek
Nov 12 '18 at 12:25





You should make use of @Autowired without the braces. I dont know if this solves your problem.

– sven.kwiotek
Nov 12 '18 at 12:25













Sorry this is not the problem . I make a mistake when i was copy/paste @sven.kwiotek

– asahin
Nov 12 '18 at 12:27





Sorry this is not the problem . I make a mistake when i was copy/paste @sven.kwiotek

– asahin
Nov 12 '18 at 12:27













You have to avoid double defined AdapterEngine. On the one hand you resolve the class by autowire as field and once again as constructor parameter.

– sven.kwiotek
Nov 12 '18 at 12:36





You have to avoid double defined AdapterEngine. On the one hand you resolve the class by autowire as field and once again as constructor parameter.

– sven.kwiotek
Nov 12 '18 at 12:36












0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53260885%2fspring-boot-beancreatingexception%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53260885%2fspring-boot-beancreatingexception%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Kleinkühnau

Makov (Slowakei)

Deutsches Schauspielhaus