Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

博主,下载工程Maven编译后载入tomcat登录后无法显示数据 #8

Open
woodwater opened this issue Jul 21, 2017 · 11 comments
Labels

Comments

@woodwater
Copy link

_20170721205244

@woodwater
Copy link
Author

数据库中的表格均已建立,其他工程读取数据库消息也是正常,但是这个工程里总是报错,且显示的页码是NaN,搜了一下是Not a Number. 不知这是因为什么?

@ZHENFENG13
Copy link
Owner

接口返回的是500,应该是java后端报错了,你看一下控制台

@woodwater
Copy link
Author

七月 21, 2017 10:21:34 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:ssm-maven-improve' did not find a matching property.
七月 21, 2017 10:21:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server version: Apache Tomcat/8.0.45
七月 21, 2017 10:21:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server built: Jun 26 2017 20:06:07 UTC
七月 21, 2017 10:21:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Server number: 8.0.45.0
七月 21, 2017 10:21:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Name: Windows 7
七月 21, 2017 10:21:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: OS Version: 6.1
七月 21, 2017 10:21:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Architecture: x86
七月 21, 2017 10:21:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Java Home: C:\Program Files\Java\jre1.8.0_121
七月 21, 2017 10:21:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Version: 1.8.0_121-b13
七月 21, 2017 10:21:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: JVM Vendor: Oracle Corporation
七月 21, 2017 10:21:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_BASE: D:\install\wkspace\java\workspace2016.metadata.plugins\org.eclipse.wst.server.core\tmp0
七月 21, 2017 10:21:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: CATALINA_HOME: D:\Program Files\apache-tomcat-8.0.45
七月 21, 2017 10:21:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.base=D:\install\wkspace\java\workspace2016.metadata.plugins\org.eclipse.wst.server.core\tmp0
七月 21, 2017 10:21:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dcatalina.home=D:\Program Files\apache-tomcat-8.0.45
七月 21, 2017 10:21:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dwtp.deploy=D:\install\wkspace\java\workspace2016.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps
七月 21, 2017 10:21:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Djava.endorsed.dirs=D:\Program Files\apache-tomcat-8.0.45\endorsed
七月 21, 2017 10:21:34 下午 org.apache.catalina.startup.VersionLoggerListener log
信息: Command line argument: -Dfile.encoding=UTF-8
七月 21, 2017 10:21:34 下午 org.apache.catalina.core.AprLifecycleListener lifecycleEvent
信息: 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\jre1.8.0_121\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jre1.8.0_121/bin/client;C:/Program Files/Java/jre1.8.0_121/bin;C:/Program Files/Java/jre1.8.0_121/lib/i386;.;C:\ProgramData\Oracle\Java\javapath;D:\Program Files\Ruby21\bin;c:\Program Files\Intel\iCLS Client;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;c:\Program Files\Hewlett-Packard\HP ProtectTools Security Manager\Bin;C:\Program Files\Common Files\Acronis\SnapAPI;D:\Strawberry\perl\bin;D:\Strawberry\perl\site\bin;D:\Strawberry\c\bin;C:\Windows\system32\config\systemprofile.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm;C:\Program Files\Windows Kits\8.1\Windows Performance Toolkit;D:\Python27;C:\Program Files\Java\jdk1.8.0_121\bin;C:\Program Files\Java\jdk1.8.0_121\jre\bin;D:\Program Files\apache-maven-3.3.9-bin\apache-maven-3.3.9\bin;C:\Program Files\MySQL\MySQL Utilities 1.6;C:\Program Files\Java\jdk1.8.0_121\lib\dt.jar;D:\Program Files\Git\cmd;D:\Program Files\nodejs;D:\Program Files\gradle-3.5\bin;.;C:\ProgramData\Oracle\Java\javapath;D:\Program Files\Ruby21\bin;c:\Program Files\Intel\iCLS Client;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;c:\Program Files\Hewlett-Packard\HP ProtectTools Security Manager\Bin;C:\Program Files\Common Files\Acronis\SnapAPI;D:\Strawberry\perl\bin;D:\Strawberry\perl\site\bin;D:\Strawberry\c\bin;C:\Users\user.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm;C:\Program Files\Windows Kits\8.1\Windows Performance Toolkit;D:\Python27;C:\Program Files\Java\jdk1.8.0_121\bin;C:\Program Files\Java\jdk1.8.0_121\jre\bin;D:\Program Files\apache-maven-3.3.9-bin\apache-maven-3.3.9\bin;C:\Program Files\MySQL\MySQL Utilities 1.6;C:\Program Files\Java\jdk1.8.0_121\lib\dt.jar;C:\Users\user\AppData\Roaming\npm;D:\Program Files\eclipse;;.
七月 21, 2017 10:21:35 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["http-nio-8080"]
七月 21, 2017 10:21:35 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
七月 21, 2017 10:21:35 下午 org.apache.coyote.AbstractProtocol init
信息: Initializing ProtocolHandler ["ajp-nio-8009"]
七月 21, 2017 10:21:35 下午 org.apache.tomcat.util.net.NioSelectorPool getSharedSelector
信息: Using a shared selector for servlet write/read
七月 21, 2017 10:21:35 下午 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 667 ms
七月 21, 2017 10:21:35 下午 org.apache.catalina.core.StandardService startInternal
信息: Starting service Catalina
七月 21, 2017 10:21:35 下午 org.apache.catalina.core.StandardEngine startInternal
信息: Starting Servlet Engine: Apache Tomcat/8.0.45
七月 21, 2017 10:21:39 下午 org.apache.jasper.servlet.TldScanner scanJars
信息: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
七月 21, 2017 10:21:39 下午 org.apache.catalina.core.ApplicationContext log
信息: No Spring WebApplicationInitializer types detected on classpath
七月 21, 2017 10:21:39 下午 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
七月 21, 2017 10:21:43 下午 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring FrameworkServlet 'springMVC'
七月 21, 2017 10:21:43 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["http-nio-8080"]
七月 21, 2017 10:21:43 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler ["ajp-nio-8009"]
七月 21, 2017 10:21:43 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 8610 ms
七月 21, 2017 10:23:36 下午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [springMVC] in context with path [/ssm-maven] threw exception [Request processing failed; nested exception is java.lang.NumberFormatException: For input string: "NaN"] with root cause
java.lang.NumberFormatException: ## For input string: "NaN"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at com.ssm.maven.core.admin.UserController.list(UserController.java:118)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:178)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:444)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:432)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:969)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:871)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:845)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1533)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1489)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)

多谢楼主回复,上面的 NaN不知道为什么会报错? 我从您的Demo链接里看到是正常的。

@ZHENFENG13
Copy link
Owner

at com.ssm.maven.core.admin.UserController.list(UserController.java:118),这里已经很清楚了,类型转换的问题,在UserController.java的118行,你改一下就好了

@woodwater
Copy link
Author

谢谢楼主,刚开始学J,Thx

@woodwater
Copy link
Author

woodwater commented Jul 22, 2017

楼主,我把parseInt改成 PageBean pageBean = new PageBean(Integer.valueOf(page), Integer.valueOf(rows)); 后第一次载入后系统成功了。但是重启了一下电脑重新载入后,又开始报错,还是不太明白这个String-Int类型转换应该怎么弄?
感觉是传页码的时候传了一个空值,导致转换出错

@ZHENFENG13
Copy link
Owner

改了下代码,判空

@woodwater
Copy link
Author

多谢楼主反馈。
我在判空的函数里写了一下日志,日志里显示rows这个参数一直是NaN.
[14:51:00] UserController - page:1,rows: NaN
所以数据显示不全,我如果将rows手动赋值成3,数据就可以显示出来了。请问这个rows是从什么地方传进来的?UserMapper里面select count(*) from ssm_user?

@ZHENFENG13
Copy link
Owner

easyui内部封装的分页功能,pageination

@woodwater
Copy link
Author

多谢您回复了!
诡异的是明明前几天都是正常的,这几天再忙另一端的工程没有管他,等另一端搞定了,这个突然无法显示了。我再瞅瞅看。

@myrust
Copy link

myrust commented Apr 22, 2018

你是怎么编译的可以教教我吗?我使用eclipise,Eclipse中按File->Import->Existing Maven projects->next选择源码没反应?怎么做?谢谢大佬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants