[英]SpringInputGeneralFieldAttrProcessor in Spring-boot
[英]Spring-Boot BeanCreatingException
我的项目正在运行,但 5 分钟后没有任何变化,我重新编译我的项目时出现错误,只需在此处输入代码即可。
2018-11-12 14:04:27.508 INFO 7904 --- [ main] c.i.IwbEmuhasebeAdapterApplication : Starting IwbEmuhasebeAdapterApplication on PRMS-ALC with PID 7904 (D:\eclipse-workspace\iwb-emuhasebe-adapter\target\classes started by Alican in D:\eclipse-workspace\iwb-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 Files\Java\jdk1.8.0_171\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Java\jdk1.8.0_171\jre\bin;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:\oracle\product\11.2.0\dbhome_1\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Java\jdk1.8.0_171;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\Program Files\MongoDB\Server\3.6\bin;C:\Program Files\PuTTY\;C:\Program Files\Java\jdk1.8.0_171\bin\;C:\Program Files\Java\jre1.8.0_191\bin;C:\Users\Alican\AppData\Local\Microsoft\WindowsApps;;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Users\Alican\AppData\Roaming\npm;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]
这是我的 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();
*/
}
}
这是警告信息:
2018-11-12 14:54:13.580 WARN 7784 --- [main] ConfigServletWebServerApplicationContext:上下文初始化期间遇到异常 - 取消刷新尝试:org.springframework.beans.factory.BeanCreationException:创建名为“appServlet”的 bean 时出错:Lookup方法解析失败; 嵌套异常是 java.lang.IllegalStateException: Failed to introspect Class [com.iworkbetter.controller.AppServlet] from ClassLoader [sun.misc.Launcher$AppClassLoader@18b4aac2]
我有同样的问题。 我已经修复了两件事,问题解决了:
我发现我在 pom.xml 中打错了字。
我使用 Java 8 运行,但使用 Java 11 编译。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.