Tomcat中的ApplicationFilterChain如何保证其成员变量(例如pos和n)的线程安全?

Tomcat中的ApplicationFilterChain是针对每个Url Pattern的单例,它如何保证其成员变量(例如pos和n)的线程安全?
贴上源码:

/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.catalina.core;

import java.io.IOException;
import java.security.Principal;
import java.security.PrivilegedActionException;
import java.util.Set;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.Servlet;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.catalina.Globals;
import org.apache.catalina.security.SecurityUtil;
import org.apache.tomcat.util.ExceptionUtils;
import org.apache.tomcat.util.res.StringManager;

/**
 * Implementation of <code>javax.servlet.FilterChain</code> used to manage
 * the execution of a set of filters for a particular request.  When the
 * set of defined filters has all been executed, the next call to
 * <code>doFilter()</code> will execute the servlet's <code>service()</code>
 * method itself.
 *
 * @author Craig R. McClanahan
 */
public final class ApplicationFilterChain implements FilterChain {

    // Used to enforce requirements of SRV.8.2 / SRV.14.2.5.1
    private static final ThreadLocal<ServletRequest> lastServicedRequest;
    private static final ThreadLocal<ServletResponse> lastServicedResponse;

    static {
        if (ApplicationDispatcher.WRAP_SAME_OBJECT) {
            lastServicedRequest = new ThreadLocal<>();
            lastServicedResponse = new ThreadLocal<>();
        } else {
            lastServicedRequest = null;
            lastServicedResponse = null;
        }
    }

    // -------------------------------------------------------------- Constants


    public static final int INCREMENT = 10;


    // ----------------------------------------------------- Instance Variables

    /**
     * Filters.
     */
    private ApplicationFilterConfig[] filters = new ApplicationFilterConfig[0];


    /**
     * The int which is used to maintain the current position
     * in the filter chain.
     */
    private int pos = 0;


    /**
     * The int which gives the current number of filters in the chain.
     */
    private int n = 0;


    /**
     * The servlet instance to be executed by this chain.
     */
    private Servlet servlet = null;


    /**
     * Does the associated servlet instance support async processing?
     */
    private boolean servletSupportsAsync = false;

    /**
     * The string manager for our package.
     */
    private static final StringManager sm =
      StringManager.getManager(Constants.Package);


    /**
     * Static class array used when the SecurityManager is turned on and
     * <code>doFilter</code> is invoked.
     */
    private static final Class<?>[] classType = new Class[]{
        ServletRequest.class, ServletResponse.class, FilterChain.class};

    /**
     * Static class array used when the SecurityManager is turned on and
     * <code>service</code> is invoked.
     */
    private static final Class<?>[] classTypeUsedInService = new Class[]{
        ServletRequest.class, ServletResponse.class};


    // ---------------------------------------------------- FilterChain Methods

    /**
     * Invoke the next filter in this chain, passing the specified request
     * and response.  If there are no more filters in this chain, invoke
     * the <code>service()</code> method of the servlet itself.
     *
     * @param request The servlet request we are processing
     * @param response The servlet response we are creating
     *
     * @exception IOException if an input/output error occurs
     * @exception ServletException if a servlet exception occurs
     */
    @Override
    public void doFilter(ServletRequest request, ServletResponse response)
        throws IOException, ServletException {

        if( Globals.IS_SECURITY_ENABLED ) {
            final ServletRequest req = request;
            final ServletResponse res = response;
            try {
                java.security.AccessController.doPrivileged(
                    new java.security.PrivilegedExceptionAction<Void>() {
                        @Override
                        public Void run()
                            throws ServletException, IOException {
                            internalDoFilter(req,res);
                            return null;
                        }
                    }
                );
            } catch( PrivilegedActionException pe) {
                Exception e = pe.getException();
                if (e instanceof ServletException)
                    throw (ServletException) e;
                else if (e instanceof IOException)
                    throw (IOException) e;
                else if (e instanceof RuntimeException)
                    throw (RuntimeException) e;
                else
                    throw new ServletException(e.getMessage(), e);
            }
        } else {
            internalDoFilter(request,response);
        }
    }

    private void internalDoFilter(ServletRequest request,
                                  ServletResponse response)
        throws IOException, ServletException {

        // Call the next filter if there is one
        if (pos < n) {
            ApplicationFilterConfig filterConfig = filters[pos++];
            try {
                Filter filter = filterConfig.getFilter();

                if (request.isAsyncSupported() && "false".equalsIgnoreCase(
                        filterConfig.getFilterDef().getAsyncSupported())) {
                    request.setAttribute(Globals.ASYNC_SUPPORTED_ATTR, Boolean.FALSE);
                }
                if( Globals.IS_SECURITY_ENABLED ) {
                    final ServletRequest req = request;
                    final ServletResponse res = response;
                    Principal principal =
                        ((HttpServletRequest) req).getUserPrincipal();

                    Object[] args = new Object[]{req, res, this};
                    SecurityUtil.doAsPrivilege ("doFilter", filter, classType, args, principal);
                } else {
                    filter.doFilter(request, response, this);
                }
            } catch (IOException | ServletException | RuntimeException e) {
                throw e;
            } catch (Throwable e) {
                e = ExceptionUtils.unwrapInvocationTargetException(e);
                ExceptionUtils.handleThrowable(e);
                throw new ServletException(sm.getString("filterChain.filter"), e);
            }
            return;
        }

        // We fell off the end of the chain -- call the servlet instance
        try {
            if (ApplicationDispatcher.WRAP_SAME_OBJECT) {
                lastServicedRequest.set(request);
                lastServicedResponse.set(response);
            }

            if (request.isAsyncSupported() && !servletSupportsAsync) {
                request.setAttribute(Globals.ASYNC_SUPPORTED_ATTR,
                        Boolean.FALSE);
            }
            // Use potentially wrapped request from this point
            if ((request instanceof HttpServletRequest) &&
                    (response instanceof HttpServletResponse) &&
                    Globals.IS_SECURITY_ENABLED ) {
                final ServletRequest req = request;
                final ServletResponse res = response;
                Principal principal =
                    ((HttpServletRequest) req).getUserPrincipal();
                Object[] args = new Object[]{req, res};
                SecurityUtil.doAsPrivilege("service",
                                           servlet,
                                           classTypeUsedInService,
                                           args,
                                           principal);
            } else {
                servlet.service(request, response);
            }
        } catch (IOException | ServletException | RuntimeException e) {
            throw e;
        } catch (Throwable e) {
            e = ExceptionUtils.unwrapInvocationTargetException(e);
            ExceptionUtils.handleThrowable(e);
            throw new ServletException(sm.getString("filterChain.servlet"), e);
        } finally {
            if (ApplicationDispatcher.WRAP_SAME_OBJECT) {
                lastServicedRequest.set(null);
                lastServicedResponse.set(null);
            }
        }
    }


    /**
     * The last request passed to a servlet for servicing from the current
     * thread.
     *
     * @return The last request to be serviced.
     */
    public static ServletRequest getLastServicedRequest() {
        return lastServicedRequest.get();
    }


    /**
     * The last response passed to a servlet for servicing from the current
     * thread.
     *
     * @return The last response to be serviced.
     */
    public static ServletResponse getLastServicedResponse() {
        return lastServicedResponse.get();
    }


    // -------------------------------------------------------- Package Methods

    /**
     * Add a filter to the set of filters that will be executed in this chain.
     *
     * @param filterConfig The FilterConfig for the servlet to be executed
     */
    void addFilter(ApplicationFilterConfig filterConfig) {

        // Prevent the same filter being added multiple times
        for(ApplicationFilterConfig filter:filters)
            if(filter==filterConfig)
                return;

        if (n == filters.length) {
            ApplicationFilterConfig[] newFilters =
                new ApplicationFilterConfig[n + INCREMENT];
            System.arraycopy(filters, 0, newFilters, 0, n);
            filters = newFilters;
        }
        filters[n++] = filterConfig;

    }


    /**
     * Release references to the filters and wrapper executed by this chain.
     */
    void release() {
        for (int i = 0; i < n; i++) {
            filters[i] = null;
        }
        n = 0;
        pos = 0;
        servlet = null;
        servletSupportsAsync = false;
    }


    /**
     * Prepare for reuse of the filters and wrapper executed by this chain.
     */
    void reuse() {
        pos = 0;
    }


    /**
     * Set the servlet that will be executed at the end of this chain.
     *
     * @param servlet The Wrapper for the servlet to be executed
     */
    void setServlet(Servlet servlet) {
        this.servlet = servlet;
    }


    void setServletSupportsAsync(boolean servletSupportsAsync) {
        this.servletSupportsAsync = servletSupportsAsync;
    }


    /**
     * Identifies the Filters, if any, in this FilterChain that do not support
     * async.
     *
     * @param result The Set to which the fully qualified class names of each
     *               Filter in this FilterChain that does not support async will
     *               be added
     */
    public void findNonAsyncFilters(Set<String> result) {
        for (int i = 0; i < n ; i++) {
            ApplicationFilterConfig filter = filters[i];
            if ("false".equalsIgnoreCase(filter.getFilterDef().getAsyncSupported())) {
                result.add(filter.getFilterClass());
            }
        }
    }
}

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
将一个简单的数据库查询部署到Tomcat时java.lang.NoClassDefFoundError: Could not initialize class

在完成一个数据库查询操作部署到Tomcat时报错java.lang.NoClassDefFoundError: Could not initialize class. 在没有使用服务器时,查询功能可以正常运行. 在启动服务器查询时报错 Servlet代码如下: ``` package com.lxl.web.servlet; import com.lxl.smis.dao.impl.IStudentDAO; import com.lxl.smis.dao.impl.StudentDAOImpl; import com.lxl.smis.domain.Student; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.List; @WebServlet("/student/list") public class ListStudentServlet extends HttpServlet { private IStudentDAO dao; public void init() throws ServletException { dao = new StudentDAOImpl(); } @Override protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { //1.接受请求参数,封装对象 //2.调用业务方法处理请求 System.out.println("hello"); List<Student> stus= dao.listAll(); for (Student stu : stus) { System.out.println(stu); } //3.控制界面跳转 } } ``` 错误提示: ![图片说明](https://img-ask.csdn.net/upload/201911/16/1573886138_700745.png) ```16-Nov-2019 15:29:27.029 严重 [http-nio-8080-exec-3] org.apache.catalina.core.StandardWrapperValve.invoke Servlet.service() for servlet [com.lxl.web.servlet.ListStudentServlet] in context with path [] threw exception [Servlet execution threw an exception] with root cause java.lang.NoClassDefFoundError: Could not initialize class com.lxl.smis.util.JDBCUtil at com.lxl.smis.util.JDBCTemplate.query(JDBCTemplate.java:73) at com.lxl.smis.dao.impl.StudentDAOImpl.listAll(StudentDAOImpl.java:41) at com.lxl.web.servlet.ListStudentServlet.service(ListStudentServlet.java:28) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:526) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:861) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1579) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) ``` 使用DeBug运行 感觉是这里出现问题,但并不知道到是什么意思 ![图片说明](https://img-ask.csdn.net/upload/201911/16/1573886445_32104.png) 查找网上解决方法 说这个报错的问题原因就是static变量的初始化失败导致 但我如果不用Servlet运行这个查找功能,直接在本地实现这个方法,是可以正常运行的. 请教一下各位大佬,是什么原因? 我是初学JAVA的小白,各位大佬见笑了.

如何在SSH框架中不使用依赖注入定义变量

``` BusinessManager businessManagerA= new BusinessManager(); List<Business> bs = businessManagerA.findAll(); if(Utils.hasReailyValue(bs)){ for(Business b :bs){ Date a = b.getPolicyuserfuldate(); int mus = Utils.musDataYear(a); System.out.println("年份差是:" + mus); if(mus < b.getPolicyperiod()){ if(b.getBad()==0){ Date ten = Utils.getTenDaysbefore(); //比较10天前的日期 if(Utils.compare(a, ten)){ b.setRemindtime(3); businessManagerA.update(b); } } } } } ``` 问题,报空指针异常 java.lang.NullPointerException cn.nku.it.action.BusinessAction.test(BusinessAction.java:346) cn.nku.it.action.VisitorAction.Business(VisitorAction.java:375) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:441) com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:280) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:243) javacommon.struts2.interceptor.SharedRenderVariableInterceptor.intercept(SharedRenderVariableInterceptor.java:30) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:165) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:252) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:122) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488) org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:102) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) javacommon.filter.LoggerMDCFilter.doFilterInternal(LoggerMDCFilter.java:39) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) cn.org.rapid_framework.web.scope.FlashFilter.doFilterInternal(FlashFilter.java:28) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) java.lang.Thread.run(Thread.java:619)

java.sql.SQLException: ORA-01006: 绑定变量不存在

错误显示 at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:189) at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:242) at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:554) at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1478) at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteDescribe(TTC7Protocol.java:677) at oracle.jdbc.driver.OracleStatement.doExecuteQuery(OracleStatement.java:2371) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2660) at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:457) at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:387) at cn.ntt.Dao.InfoDao.searchInfo(InfoDao.java:91) at cn.ntt.servlet.InfoServlet.doPost(InfoServlet.java:96) at cn.ntt.servlet.InfoServlet.doGet(InfoServlet.java:21) at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) 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 cn.ntt.Util.EncodingFilter.doFilter(EncodingFilter.java:44) 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.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504) 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) Dao里的代码 public List<Info> searchInfo(String sqlvalue,String subsql,String type,int start,int end){ List<Info> list = new ArrayList<Info>(); Connection conn=null; PreparedStatement ps=null; ResultSet rs =null; try { conn = JdbcUtil.getConn(); String sql="SELECT * FROM T_INFO "; if(!"".equals(subsql)&&subsql!=null){ if(subsql.equals("info_content")){ sql+="WHERE INFO_CONTENT "; }else if(subsql.equals("info_phone")){ sql+="WHERE INFO_PHONE "; }else if(subsql.equals("info_email")){ sql+="WHERE INFO_EMAIL "; }else if(subsql.equals("id")){ sql+="WHERE ID "; }else if(subsql.equals("info_title")){ sql+="WHERE INFO_TITLE "; }else if(subsql.equals("info_linkman")){ sql+="WHERE INFO_LINKMAN "; }if(type.equals("all")){ sql += " = '" + sqlvalue + "'"; }else if(type.equals("like")){ sql += "like '%" + sqlvalue + "%' "; } sql+=" ORDER BY ID DESC"; sql="SELECT * FROM(SELECT U.*, ROWNUM RN FROM("+sql+")"+ "U WHERE ROWNUM<=?) A WHERE A.RN>=?"; } //编译SQL语句 ps=conn.prepareStatement(sql); ps.setInt(1, end); ps.setInt(2,start); rs = ps.executeQuery();//结果集,只有遍历时才用 while(rs.next()){ Info info =new Info(); info.setId(rs.getInt("ID")); info.setInfo_type(rs.getString("INFO_TYPE")); info.setInfo_title(rs.getString("INFO_TITLE")); info.setInfo_content(rs.getString("INFO_CONTENT")); info.setInfo_phone(rs.getString("INFO_PHONE")); info.setInfo_linkman(rs.getString("INFO_LINKMAN")); info.setInfo_email(rs.getString("INFO_EMAIL")); list.add(info); } }catch(SQLException e){ e.printStackTrace(); }finally{ JdbcUtil.closeConn(rs, ps, conn); } return list; } Servlet的代码 else if("search".equals(flag)){ //获取left.jsp中关键字查询和条件查询 String sqlvalue=req.getParameter("sqlvalue"); String subsql=req.getParameter("subsql"); String type=req.getParameter("type"); List<Info> list=infoDao.search(sqlvalue, subsql, type); int total=list.size();//总共的条数 int totalPage=0;//总共的页数 if(total%5==0){ totalPage=total/5; }else{ totalPage=total/5+1; } /*totalPage=total%3==0?total/3:total/3+1;*/ String cp=req.getParameter("currPage"); if(cp==null||cp==""){ cp="1"; } int currPage=Integer.parseInt(cp); if(currPage<1){ currPage=1; }else if(currPage>totalPage){ currPage=totalPage; } int start=0;//开始的条数 int end=0;//结束的条数 start=(currPage-1)*5+1; end=currPage*5; //存放进searchInfo这个Dao方法里 List<Info> infolist=infoDao.searchInfo(sqlvalue, subsql, type, start, end); req.setAttribute("start", start); req.setAttribute("end", end); req.setAttribute("currPage", currPage); req.setAttribute("totalPage", totalPage); req.setAttribute("infolist", infolist); req.setAttribute("infolist", infolist); req.getRequestDispatcher("pages/show/searchshow.jsp").forward(req, resp); }

IDEA软件数据库数据分页显示时运行报错,mysql数据库,语言javaEE,SPringmvc,themeleaf

2018-12-24 22:17:28.254 ERROR 17368 --- [nio-8080-exec-3] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.NullPointerException] with root cause java.lang.NullPointerException: null at student.stusys.controller.CStudent.queryStudent_Page(CStudent.java:150) ~[classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121] at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:209) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:891) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:991) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:925) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:974) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:866) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:635) ~[tomcat-embed-core-8.5.34.jar:8.5.34] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:851) ~[spring-webmvc-5.0.9.RELEASE.jar:5.0.9.RELEASE] at javax.servlet.http.HttpServlet.service(HttpServlet.java:742) ~[tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-embed-websocket-8.5.34.jar:8.5.34] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.34.jar:8.5.34] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.34.jar:8.5.34] at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.34.jar:8.5.34] at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.34.jar:8.5.34] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.9.RELEASE.jar:5.0.9.RELEASE] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) ~[tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:493) [tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) [tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:800) [tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:806) [tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1498) [tomcat-embed-core-8.5.34.jar:8.5.34] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.34.jar:8.5.34] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_121] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_121] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.34.jar:8.5.34] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_121] ``` ```

thymeleaf 模板th:onclick语法报错

https://start.spring.io/添加的项目: ![图片说明](https://img-ask.csdn.net/upload/201810/13/1539445006_398224.png) 首页: ![图片说明](https://img-ask.csdn.net/upload/201810/13/1539445071_676283.png) thymeleaf模板: ![图片说明](https://img-ask.csdn.net/upload/201810/13/1539445109_284341.png) 端口设置: ![图片说明](https://img-ask.csdn.net/upload/201810/13/1539445142_145620.png) 网页报错: ![图片说明](https://img-ask.csdn.net/upload/201810/13/1539445223_826955.png) 报错代码: ``` 2018-10-13 23:39:36.578 INFO 8104 --- [p-nio-80-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet' 2018-10-13 23:39:36.578 INFO 8104 --- [p-nio-80-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' 2018-10-13 23:39:36.593 INFO 8104 --- [p-nio-80-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 15 ms 2018-10-13 23:39:36.831 ERROR 8104 --- [p-nio-80-exec-1] org.thymeleaf.TemplateEngine : [THYMELEAF][http-nio-80-exec-1] Exception processing template "index": Only variable expressions returning numbers or booleans are allowed in this context, any other datatypes are not trusted in the context of this expression, including Strings or any other object that could be rendered as a text literal. A typical case is HTML attributes for event handlers (e.g. "onload"), in which textual data from variables should better be output to "data-*" attributes and then read from the event handler. (template: "index" - line 6, col 7) org.thymeleaf.exceptions.TemplateProcessingException: Only variable expressions returning numbers or booleans are allowed in this context, any other datatypes are not trusted in the context of this expression, including Strings or any other object that could be rendered as a text literal. A typical case is HTML attributes for event handlers (e.g. "onload"), in which textual data from variables should better be output to "data-*" attributes and then read from the event handler. (template: "index" - line 6, col 7) at org.thymeleaf.standard.expression.VariableExpression.executeVariableExpression(VariableExpression.java:181) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.standard.expression.SimpleExpression.executeSimple(SimpleExpression.java:66) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.standard.expression.Expression.execute(Expression.java:109) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.standard.expression.Expression.execute(Expression.java:138) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.standard.processor.StandardDOMEventAttributeTagProcessor.doProcess(StandardDOMEventAttributeTagProcessor.java:214) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.processor.element.AbstractAttributeTagProcessor.doProcess(AbstractAttributeTagProcessor.java:74) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.processor.element.AbstractElementTagProcessor.process(AbstractElementTagProcessor.java:95) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.util.ProcessorConfigurationUtils$ElementTagProcessorWrapper.process(ProcessorConfigurationUtils.java:633) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.engine.ProcessorTemplateHandler.handleOpenElement(ProcessorTemplateHandler.java:1314) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.engine.OpenElementTag.beHandled(OpenElementTag.java:205) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.engine.TemplateModel.process(TemplateModel.java:136) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.engine.TemplateManager.parseAndProcess(TemplateManager.java:661) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1098) [thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1072) [thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.spring5.view.ThymeleafView.renderFragment(ThymeleafView.java:362) [thymeleaf-spring5-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.spring5.view.ThymeleafView.render(ThymeleafView.java:189) [thymeleaf-spring5-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1370) [spring-webmvc-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1116) [spring-webmvc-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1055) [spring-webmvc-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) [spring-webmvc-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:998) [spring-webmvc-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:890) [spring-webmvc-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:875) [spring-webmvc-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-embed-websocket-9.0.12.jar:9.0.12] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) [spring-web-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92) [spring-web-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) [spring-web-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) [spring-web-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) [spring-web-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:770) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.12.jar:9.0.12] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135) [na:na] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [na:na] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.12.jar:9.0.12] at java.base/java.lang.Thread.run(Thread.java:844) [na:na] 2018-10-13 23:39:36.836 ERROR 8104 --- [p-nio-80-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateProcessingException: Only variable expressions returning numbers or booleans are allowed in this context, any other datatypes are not trusted in the context of this expression, including Strings or any other object that could be rendered as a text literal. A typical case is HTML attributes for event handlers (e.g. "onload"), in which textual data from variables should better be output to "data-*" attributes and then read from the event handler. (template: "index" - line 6, col 7)] with root cause org.thymeleaf.exceptions.TemplateProcessingException: Only variable expressions returning numbers or booleans are allowed in this context, any other datatypes are not trusted in the context of this expression, including Strings or any other object that could be rendered as a text literal. A typical case is HTML attributes for event handlers (e.g. "onload"), in which textual data from variables should better be output to "data-*" attributes and then read from the event handler. (template: "index" - line 6, col 7) at org.thymeleaf.standard.expression.VariableExpression.executeVariableExpression(VariableExpression.java:181) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.standard.expression.SimpleExpression.executeSimple(SimpleExpression.java:66) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.standard.expression.Expression.execute(Expression.java:109) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.standard.expression.Expression.execute(Expression.java:138) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.standard.processor.StandardDOMEventAttributeTagProcessor.doProcess(StandardDOMEventAttributeTagProcessor.java:214) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.processor.element.AbstractAttributeTagProcessor.doProcess(AbstractAttributeTagProcessor.java:74) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.processor.element.AbstractElementTagProcessor.process(AbstractElementTagProcessor.java:95) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.util.ProcessorConfigurationUtils$ElementTagProcessorWrapper.process(ProcessorConfigurationUtils.java:633) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.engine.ProcessorTemplateHandler.handleOpenElement(ProcessorTemplateHandler.java:1314) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.engine.OpenElementTag.beHandled(OpenElementTag.java:205) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.engine.TemplateModel.process(TemplateModel.java:136) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.engine.TemplateManager.parseAndProcess(TemplateManager.java:661) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1098) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.TemplateEngine.process(TemplateEngine.java:1072) ~[thymeleaf-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.spring5.view.ThymeleafView.renderFragment(ThymeleafView.java:362) ~[thymeleaf-spring5-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.thymeleaf.spring5.view.ThymeleafView.render(ThymeleafView.java:189) ~[thymeleaf-spring5-3.0.10.RELEASE.jar:3.0.10.RELEASE] at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1370) ~[spring-webmvc-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.springframework.web.servlet.DispatcherServlet.processDispatchResult(DispatcherServlet.java:1116) ~[spring-webmvc-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1055) ~[spring-webmvc-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) ~[spring-webmvc-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:998) ~[spring-webmvc-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:890) ~[spring-webmvc-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:634) ~[tomcat-embed-core-9.0.12.jar:9.0.12] at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:875) ~[spring-webmvc-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) ~[tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) ~[tomcat-embed-websocket-9.0.12.jar:9.0.12] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.12.jar:9.0.12] at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.12.jar:9.0.12] at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92) ~[spring-web-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.12.jar:9.0.12] at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) ~[spring-web-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.12.jar:9.0.12] at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) ~[spring-web-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.1.BUILD-20181012.212217-45.jar:5.1.1.BUILD-SNAPSHOT] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:199) ~[tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:770) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) [tomcat-embed-core-9.0.12.jar:9.0.12] at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-9.0.12.jar:9.0.12] at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135) [na:na] at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [na:na] at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-9.0.12.jar:9.0.12] at java.base/java.lang.Thread.run(Thread.java:844) [na:na] ``` 以上会报错,下边是不会报错的: ![图片说明](https://img-ask.csdn.net/upload/201810/13/1539445396_262348.png) ![图片说明](https://img-ask.csdn.net/upload/201810/13/1539445434_672624.png) 暂时只发现th:onclick受到影响,以前没出现过这样的问题,网上找了一天也没找到答案,有没有大神帮忙解决下,谢谢。

Struts1.3+spring2.5+hibernate3.2部署tomcat6.0.18报错请教

<p><span style="font-size: small;">Struts1.3+spring2.5+hibernate3.2部署在tomcat6.0.18虽然成功,但是对数据库的查询回报错。 <br>添加修改都能成功。在Myeclipse6.5里运行项目完全没有问题。但是部署到tomcat6.0.18里,查询就报错。</span></p> <p><span style="font-size: small;">郁闷了很久了。希望得到帮助。</span></p> <p><span style="font-size: small;">---------------------------------错误信息--------------------------------</span></p> <p>2009-6-24 17:45:02 org.apache.catalina.core.ApplicationContext log<br>信息: Initializing Spring root WebApplicationContext<br>2009-6-24 17:45:41 org.apache.catalina.core.ApplicationDispatcher invoke<br>严重: Servlet.service() for servlet jsp threw exception<br>javax.servlet.ServletException: javax/servlet/jsp/tagext/Tag<br> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:275)<br> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)<br> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)<br> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<br> at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)<br> at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)<br> at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)<br> at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)<br> at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)<br> at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)<br> at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)<br> at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)<br> at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)<br> at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)<br> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)<br> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)<br> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<br> at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)<br> at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)<br> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)<br> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<br> at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)<br> at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)<br> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)<br> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<br> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)<br> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)<br> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)<br> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)<br> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)<br> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)<br> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)<br> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)<br> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)<br> at java.lang.Thread.run(Thread.java:619)<br>2009-6-24 17:45:41 org.apache.catalina.core.StandardWrapperValve invoke<br>严重: Servlet.service() for servlet action threw exception<br>javax.servlet.ServletException: javax/servlet/jsp/tagext/Tag<br> at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:275)<br> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)<br> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)<br> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<br> at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:630)<br> at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)<br> at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)<br> at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)<br> at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1085)<br> at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:398)<br> at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:241)<br> at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)<br> at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)<br> at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)<br> at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)<br> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)<br> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<br> at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)<br> at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)<br> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)<br> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<br> at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)<br> at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)<br> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)<br> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<br> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)<br> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)<br> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)<br> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)<br> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)<br> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)<br> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845)<br> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)<br> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)<br> at java.lang.Thread.run(Thread.java:619)</p> <p>-------------------------------------------------------------------------------------------------------------------------</p> <p> </p> <p>先谢谢啦!</p> <p> </p> <p>----------------------------------------------------------------------------------------</p> <p>以我的推测应该是tomcat没有识别出页面标签,也许问题出在servlet-api.jar,或jsp-api.jar上。</p> <p>但是如果把这两个jar加到项目的lib目录里是报错的,貌似环境变量里配也试过了,tomcat的高版本6.0.20和低版本5.5也试过了,都不好使。</p> <p> </p> <p> </p><br /><strong>问题补充:</strong><br />先感谢lovewhzlq的回复,您说的servlet版本低指的是哪里的低,tomcat lib里的,还是说我项目里的jar包版本低。我项目里没有servlet的jar包,因为tomcat都有提供。在myeclipse6.5里运行一点问题都没有。但不知为什么拿出来运行,查询就报错,现在我推断很有可能是就是页面标签的问题。我下面贴上来一个查询后分页的页面。大家再帮忙看看哪里的标签有问题? <br /> <br />&lt;%@ page language="java" pageEncoding="UTF-8"%&gt; <br />&lt;%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%&gt; <br />&lt;%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %&gt; <br />&lt;%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %&gt; <br />&lt;%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %&gt; <br />&lt;%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %&gt; <br />&lt;% <br />String path = request.getContextPath(); <br />String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; <br />%&gt; <br />&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt; <br />&lt;html&gt; <br />&nbsp; &lt;head&gt; <br />&nbsp;&nbsp;&nbsp; &lt;base href="&lt;%=basePath%&gt;"&gt; <br />&nbsp;&nbsp;&nbsp; &lt;title&gt;河北大学综合新闻网&lt;/title&gt; <br />&nbsp; &lt;/head&gt; <br />&nbsp; &lt;body&gt; <br />&nbsp;&nbsp;&nbsp; &lt;center&gt; <br /> &lt;h3&gt; <br /> 回收站 <br /> &lt;/h3&gt; <br /> &lt;table border="2" width="600"&gt; <br /> &lt;tr&gt; <br /> &lt;td&gt; <br /> 标题 <br /> &lt;/td&gt; <br /> &lt;td&gt; <br /> 发布时间 <br /> &lt;/td&gt; <br /> &lt;td&gt; <br /> 状态 <br /> &lt;/td&gt; <br /> &lt;td&gt; <br /> 操作 <br /> &lt;/td&gt; <br /> &lt;/tr&gt; <br /> &lt;c:forEach items="${requestScope['messageList']}" var="message"&gt; <br /> &lt;tr&gt; <br /> &lt;td&gt; <br /> &lt;c:out value="${message.title}" /&gt; <br /> &lt;/td&gt; <br /> &lt;td&gt; <br /> &lt;c:out value="${message.addTime}" /&gt; <br /> &lt;/td&gt; <br /> &lt;td&gt; <br /> &lt;c:if test="${1==message.isPost}"&gt; <br /> 已审核通过 <br /> &lt;/c:if&gt; <br /> &lt;c:if test="${0==message.isPost}"&gt; <br /> 未审核 <br /> &lt;/c:if&gt; <br /> &lt;/td&gt; <br /> &lt;td&gt; <br /> &lt;a href="./getMessage.do?id=&lt;c:out value="${message.id}"/&gt;"&gt;查看详细&lt;/a&gt;&amp;nbsp;&amp;nbsp; <br /> &lt;a href="./setNoDelMessage.do?id=&lt;c:out value="${message.id}"/&gt;" <br /> onclick="javascript:return confirm('您要还原这条信息吗?')"&gt;还原&lt;/a&gt;&amp;nbsp;&amp;nbsp; <br /> &lt;a href="./deleteMessage.do?id=&lt;c:out value="${message.id}"/&gt;" <br /> onclick="javascript:return confirm('您要删除这条信息吗?')"&gt;删除&lt;/a&gt; <br /> &lt;/td&gt; <br /> &lt;tr&gt; <br /> &lt;/c:forEach&gt; <br /> &lt;/table&gt; <br /> &lt;table align="center" width="500"&gt; <br />&nbsp;&nbsp;&nbsp; &lt;tr&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;td align="center" colspan="10"&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 每页&lt;bean:write name="messagePage" property="pageSize"/&gt;条记录 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 共&lt;bean:write name="messagePage" property="rowCount"/&gt;条记录 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 当前第(&lt;bean:write name="messagePage" property="currentPage"/&gt;/&lt;bean:write name="messagePage" property="totalPage"/&gt;)页 <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;logic:present name="messagePage"&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;html:link page="/listRecycle.do?pno=1"&gt;首页&lt;/html:link&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;logic:equal name="messagePage" property="hasPreviousPage" value="false"&gt;上一页&lt;/logic:equal&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;logic:equal name="messagePage" property="hasPreviousPage" value="true"&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;a href="./listRecycle.do?pno=&lt;bean:write name="messagePage" property="prePage"/&gt;"&gt;上一页&lt;/a&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/logic:equal&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;logic:equal name="messagePage" property="hasNextPage" value="false"&gt;下一页&lt;/logic:equal&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;logic:equal name="messagePage" property="hasNextPage" value="true"&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;a href="./listRecycle.do?pno=&lt;bean:write name="adminPage" property="nextPage"/&gt;"&gt;下一页&lt;/a&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/logic:equal&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;a href="./listRecycle.do?pno=&lt;bean:write name='messagePage' property='totalPage'/&gt;"&gt;末页&lt;/a&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/logic:present&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/td&gt; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;/tr&gt; <br />&nbsp;&nbsp;&nbsp; &lt;/table&gt; <br /> &lt;/center&gt; <br />&nbsp; &lt;/body&gt; <br />&lt;/html&gt; <br /><br /><strong>问题补充:</strong><br />----------------------- <br />我工程里的lib下包含了jstl-1.2.jar,standard-1.0.6.jar。会不会是jstl版本低了?<br /><strong>问题补充:</strong><br />我换了您说的1.1和1.0但是还是一直有问题一样的错,不过错误已经确定就是出在jstl上。因为我换成struts1标签展示信息没有问题,一用jstl就报错。 <br />您可否给点您使用jstl的建议或者您配置jstl时候导入的jar版本和tld文件,以及需要注意什么,谢谢。<br /><strong>问题补充:</strong><br />重新导入了一次jstl,用的1.1版本,还是存在问题。tomcat里也安了jstl,而且版本一致,tld也在web.xml里配了,不过还是报最早的错。哎~~我还是用struts标签吧。谢谢您的答复。给分。

int类型转换成User对象类型报错问题

想询问一下大佬们,出现了Integer转换成User对象报错的问题代码如下 ``` private void UserUpdate(HttpServletRequest req, HttpServletResponse resp) throws IOException { //获取数据 String pwd=req.getParameter("pwd"); //从session中获取用户信息//下面的User的转换出了问题 User u=(User) req.getSession().getAttribute("servlet"); int uid=u.getUid(); //调用service处理 int index=us.Update(pwd,uid); System.out.println("index="+index); if(index>0){ //获取session对象 HttpSession hs=req.getSession(); hs.setAttribute("pwd","true"); //重定向到登录页面 resp.sendRedirect("/Login.jsp"); } —————————————————————————————————————————————————————— : Servlet.service() for servlet [servlet] in context with path [/New] threw exception java.lang.ClassCastException: java.lang.Integer cannot be cast to com.cwj.pojo.User at com.cwj.servlet.UserServlet.UserUpdate(UserServlet.java:88) at com.cwj.servlet.UserServlet.service(UserServlet.java:41) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.logging.log4j.core.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:66) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:1025) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1137) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:319) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:748) ```

关于fire workflow的创建流程不能获取WorkflowSession

transactionTemplate.execute(new TransactionCallback() { @Override public Object doInTransaction(TransactionStatus arg0) { try { // 1、保存请假信息 leaveApplicationDAO.save(leaveApplicationInfo); // 2、创建流程实例 IWorkflowSession workflowSession = runtimeContext .getWorkflowSession(); IProcessInstance processInstance = workflowSession .createProcessInstance("LeaveApplicationProcess", currentUser == null ? "--" : currentUser .getId()); // 3、设置流程变量 processInstance.setProcessInstanceVariable("sn", leaveApplicationInfo.getSn()); processInstance.setProcessInstanceVariable("applicantId", leaveApplicationInfo.getApplicantId()); processInstance.setProcessInstanceVariable("leaveDays", leaveApplicationInfo.getLeaveDays()); // 4、启动流程实例 processInstance.run(); } catch (EngineException e) { e.printStackTrace(); req.setAttribute("ERR", "错误: "+e.getMessage()); } catch (KernelException e) { e.printStackTrace(); req.setAttribute("ERR", "错误: "+e.getMessage()); } return null; } }); 报的错误是 严重: Servlet.service() for servlet [submitApplicationServlet] in context with path [/sshWorkFlow] threw exception [Servlet execution threw an exception] with root cause java.lang.ClassNotFoundException: org.fireflow.engine.impl.WorkflowSession$1 at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1333) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1167) at org.fireflow.engine.impl.WorkflowSession._createProcessInstance(WorkflowSession.java:95) at org.fireflow.engine.impl.WorkflowSession.createProcessInstance(WorkflowSession.java:227) at org.fireflow.example.leaveapplication.bizservlets.SubmitApplicationServlet$1.doInTransaction(SubmitApplicationServlet.java:68) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133) at org.fireflow.example.leaveapplication.bizservlets.SubmitApplicationServlet.doPost(SubmitApplicationServlet.java:55) at javax.servlet.http.HttpServlet.service(HttpServlet.java:648) 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 org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:85) 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.fireflow.example.ou.CurrentUserFilter.doFilter(CurrentUserFilter.java:32) 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:106) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502) 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:616) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1100) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:687) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745)

Spring mvc 中的mapper.xml的SQL语句报错

### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval=2,conn_timeout=1,resp_timeout=1,test_retry=1,freq=2,monit_conn_timeout=' at line 1 ### The error may involve com.security.dao.TemplateNetworkDao.updateTempNetwork-Inline ### The error occurred while setting parameters ### SQL: update conf_template_network set interval=?,conn_timeout=?,resp_timeout=?,test_retry=?,freq=?,monit_conn_timeout=?,monit_resp_timeout=?,monit_retry=? where id=? ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval=2,conn_timeout=1,resp_timeout=1,test_retry=1,freq=2,monit_conn_timeout=' at line 1 ; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval=2,conn_timeout=1,resp_timeout=1,test_retry=1,freq=2,monit_conn_timeout=' at line 1_ 我的SQL语句是 ``` <update id="updateTempNetwork" parameterType="int"> update conf_template_network set interval=#{interval},conn_timeout=#{conn_timeout},resp_timeout=#{resp_timeout},test_retry=#{test_retry},freq=#{freq},monit_conn_timeout=#{monit_conn_timeout},monit_resp_timeout=#{monit_resp_timeout},monit_retry=#{monit_retry} where id=#{id} </update> ``` 找了半天也没找到哪写错了,而且也没有使用mysql的关键字,提示说monit_conn_timeout附近的错误 # ## ——————————————————————————————————** # ## 更新:好像是SQL语句太长了,把前边的字段改短后,前边的字段就能正确显示,但是后边超出长度的部分还是会报错 我把前边长的字段用a,b替代之后,变短了: ``` <update id="updateTempNetwork" parameterType="com.security.entity.TemplateNetwork"> update conf_template_network set interval=#{interval},conn_timeout=#{conn_timeout},resp_timeout=#{resp_timeout},test_retry=#{test_retry},freq=#{freq},a=#{a},b=#{b},monit_retry=#{monit_retry} where id=#{id} </update> ``` 错误就移到了后边: Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval=3,conn_timeout=3,resp_timeout=3,test_retry=3,freq=1,a=2,b=1,monit_retry' at line 1 ; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval=3,conn_timeout=3,resp_timeout=3,test_retry=3,freq=1,a=2,b=1,monit_retry' at line 1 好像跟长度又没关系 把后边的字段都砍掉了之后 ``` <update id="updateTempNetwork" parameterType="com.security.entity.TemplateNetwork"> update conf_template_network set interval=#{interval},conn_timeout=#{conn_timeout},resp_timeout=#{resp_timeout},test_retry=#{test_retry},freq=#{freq} where id=#{id} </update> ``` 还是会报错: 移到了最后: ### SQL: update conf_template_network set interval=?,conn_timeout=?,resp_timeout=?,test_retry=?,freq=? where id=? ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval=1,conn_timeout=2,resp_timeout=2,test_retry=1,freq=1 where id=1' at line 1 ; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval=1,conn_timeout=2,resp_timeout=2,test_retry=1,freq=1 where id=1' at line 1 at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.doTranslate(SQLErrorCodeSQLExceptionTranslator.java:231) at org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:73) at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:73) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446) at $Proxy29.update(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:294) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:62) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59) at $Proxy37.updateTempNetwork(Unknown Source) at com.security.service.impl.TemplateNetworkImpl.updateTempNetwork(TemplateNetworkImpl.java:35) at com.security.service.impl.TemplateNetworkImpl$$FastClassBySpringCGLIB$$16455d80.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673) at com.security.service.impl.TemplateNetworkImpl$$EnhancerBySpringCGLIB$$a87fea1.updateTempNetwork(<generated>) at com.security.controller.TemplateNetworkController.updateTempNetwork(TemplateNetworkController.java:47) 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.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) at javax.servlet.http.HttpServlet.service(HttpServlet.java:646) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.logging.log4j.web.Log4jServletFilter.doFilter(Log4jServletFilter.java:71) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316) 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) Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'interval=1,conn_timeout=2,resp_timeout=2,test_retry=1,freq=1 where id=1' at line 1 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at com.mysql.jdbc.Util.handleNewInstance(Util.java:408) at com.mysql.jdbc.Util.getInstance(Util.java:383) at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1062) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4226) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4158) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2615) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2776) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2840) at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2082) at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1302) at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.execute(NewProxyPreparedStatement.java:67) 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.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59) at $Proxy48.execute(Unknown Source) at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:46) at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:74) at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:50) at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117) at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76) at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:198) 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.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433) # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 结贴啦结帖啦! # 休息两天果然脑细胞就活过来了,周一一大早就找到了bug # interval是mySQL的关键字,用作变量名,所以报错了,换个名字就好了。已经是第二次撞到关键字了,以后起变量名要小心了。 # 非常感谢各位的帮助!!

安卓开发报错Illegal operation on empty result set.

各位大神,我在myeclipse里编写服务器,报如下错误: url = select * from user where username = 'null' stmt = com.mysql.jdbc.Statement@39c51b0e java.sql.SQLException: Illegal operation on empty result set. at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910) at com.mysql.jdbc.ResultSet.checkRowPos(ResultSet.java:685) at com.mysql.jdbc.ResultSet.getStringInternal(ResultSet.java:5476) at com.mysql.jdbc.ResultSet.getString(ResultSet.java:5420) at com.mysql.jdbc.ResultSet.getString(ResultSet.java:5436) at com.test.servlet.loadMessage.doLogin(loadMessage.java:81) at com.test.servlet.loadMessage.doGet(loadMessage.java:61) at javax.servlet.http.HttpServlet.service(HttpServlet.java:620) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) result = {"result_code":2} at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2442) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2431) 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) 菜鸟刚开始学,求各位大神指点啊啊啊 错误代码可能在这里,但是没看出来哪里错了。。。。 String doLogin(String username, String password) { HashMap<String, Object> resultMap = new HashMap<String, Object>(); String sql = "select * from " + DBManager.TABLE_NAME + " where " + DBManager.COLUMN_USERNAME + " = " + "'" + username + "'" ; System.out.println("url = " + sql); 。。。。。。 } username这个变量是个参数啊,它的使用在这里:感觉也没错啊: String username = request.getParameter("username"); String password = request.getParameter("password"); String result = doLogin(username, password); 不懂,求教!!!

JSTL里的自定义中定义函数的连接字符怎么弄

JSTL里的自定义中定义函数的连接字符怎么 我是用el隐士变量连接字符串,用+号,不用+怎么都不对, 例如这样写就是对的 ${kanbafn:str(pageContext.request.scheme)} 但是如果我任意给pageContext.request.scheme连接个字符串传过去就有错误 例如:${kanbafn:str(pageContext.request.scheme+"a")} ${kanbafn:str(pageContext.request.scheme"a")} 这两种都不对,反正就是有异常 [b]问题补充:[/b] [code="java"]<c:set var="a" value="string value of a"> ${kanbafn:str(pageContext.request.scheme+a)} [/code] 这样写提示 [code="java"]java.lang.NumberFormatException: For input string: "http" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) at java.lang.Long.parseLong(Long.java:403) at java.lang.Long.<init>(Long.java:671) at org.apache.el.lang.ELArithmetic$LongDelegate.coerce(ELArithmetic.java:188) at org.apache.el.lang.ELArithmetic.coerce(ELArithmetic.java:356) at org.apache.el.lang.ELArithmetic.add(ELArithmetic.java:237) at org.apache.el.parser.AstPlus.getValue(AstPlus.java:24) at org.apache.el.parser.AstFunction.getValue(AstFunction.java:85) at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:186) at org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:923) at org.apache.jsp.test_jsp._jspService(test_jsp.java:86) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at com.kanba.filter.EncodingFilter.doFilter(EncodingFilter.java:26) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Thread.java:619)[/code] 去年+a就正确了

Linux中的绝对路径 在java

File file = new File("/usr/local/apache2/htdocs/eworld01/tap.xml"); BufferedReader red = new FileReader(file); 为什么这路径读不到~~ [b]问题补充:[/b] 由于我对Linux中的路径很不熟悉 异常如下: An error occurred at line: 21 in the jsp file: /createSitemap.jsp The method readConfigSitemap() in the type CreateSitemap is not applicable for the arguments (String) 18: BufferedReader bf = null; 19: try { 20: //鐢熸垚sitemap.xml鏂囦欢 21: String path_name = createSitemap.readConfigSitemap(path_url); 22: //path_name = "/usr/local/apache2/htdocs/eworld01"; 23: //璇诲嚭sitemap.xml鏂囦欢 24: File file = new File(path_url+"/tap.xml"); Stacktrace: at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:93) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330) at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:435) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:298) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:277) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:265) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:564) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:302) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265) at javax.servlet.http.HttpServlet.service(HttpServlet.java:803) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:200) at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283) at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:773) at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:703) at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:895) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Thread.java:619) [b]问题补充:[/b] 多谢各位的回答~ 其实问题很简单~就是简单的I/O流的输出 这个错我也知道是路径出错了 只想问一下Linux中的路径是怎样子的,Linux是没有盘符的 /usr/local/apache2/htdocs/eworld01/tap.xml 这个路劲有错吗?我真的想不明白为什么会报着路劲错! [b]问题补充:[/b] :o 请问 pJun 兄台 了解过Linux中的路径没~~其实和XP本地路径是完全不同的~~ /usr/local/apache2/htdocs/eworld01/tap.xml这路径有错吗?用IO流读得到吗? [b]问题补充:[/b] 再次谢谢各位的帮助~ 其实问题早以解决了 只想了解的更多一点 我这问题是用全局变量解决的 [b]问题补充:[/b] 不好意思 贴出来的时候搞乱了~多谢 fengyunhust 兄台的指出 看得挺仔细的 好欣赏哦~我们在工作中无论做什么多要细心点,否则损的是自己

Struts Problem Report Unable to instantiate Action

[code="java"][/code] 我用struts2 做的毕设, 我按网上所说,不要在成员变量或者是构造方法里调用ActionContext,而把它放在其它方法里. 于是我把ServletActionContext放到getters中, 问题依然存在,不知道还有什么原因会导致该问题的呢? struts.xml配置: <struts> <include file="struts-default.xml"/> <package name="storeManage" extends="struts-default"> <action name="checkAction" class="MPDMS.view.storeManage.CheckAction"> <result name="success">/common/page/success.jsp</result> <result name="error">/common/page/error.jsp</result> <result name="input">/common/page/none.jsp</result> </action> 页面上的链接: <s:url id="right" action="storeManage/checkAction"> <s:param name="enterStatus" value="%{'符合'}"/> <s:param name="enterNumber" value="#attr.godownEntry.enterNumber"/> </s:url> checkAction部分代码: public class CheckAtion extends ActionSupport{ private static final long serialVersionUID = 1L; private Long enterNumber; private String enterStatus; public Long getEnterNumber() { if(enterNumber == null ) { enterNumber = Long.parseLong((String)(ServletActionContext.getRequest().getParameter(&quot;enterNumber&quot;))); } return enterNumber; } public String getEnterStatus() { if(enterStatus.trim() == null) { enterStatus = (String)(ServletActionContext.getRequest().getParameter(&quot;enterStatus&quot;)); enterStatus = ConvertCharacter.convertCh(enterStatus); } return enterStatus; } public String execute() { GodownService checkService = new GodownService(); if(getEnterNumber() != null &amp;&amp; getEnterStatus() != null) { if(checkService.setEnterStatus(enterNumber, enterStatus)) { System.out.println(&quot;at CheckAction.execute()setEnterStatus success&quot;); return SUCCESS; } else { System.out.println(&quot;at CheckAction.execute() setEnterStatus fail&quot;); return ERROR; } }else { System.out.println(&quot;at CheckAction.execute()\n&quot; + &quot;enterNumber == null &amp;&amp; enterStatus.trim() == null&quot;); return INPUT; } } 报错: Struts Problem Report Struts has detected an unhandled exception: Messages: MPDMS.view.storeManage.CheckAction Unable to instantiate Action, MPDMS.view.storeManage.CheckAction, defined for 'checkAction' in namespace ''MPDMS.view.storeManage.CheckAction File: org/apache/catalina/loader/WebappClassLoader.java Line number: 1,387 -------------------------------------------------------------------------------- Stacktraces Unable to instantiate Action, MPDMS.view.storeManage.CheckAction, defined for 'checkAction' in namespace ''MPDMS.view.storeManage.CheckAction com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:306) com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:387) com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186) org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61) org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39) com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:458) org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:102) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) java.lang.Thread.run(Unknown Source) java.lang.ClassNotFoundException: MPDMS.view.storeManage.CheckAction org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387) org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233) com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:146) com.opensymphony.xwork2.ObjectFactory.getClassInstance(ObjectFactory.java:96) com.opensymphony.xwork2.spring.SpringObjectFactory.getClassInstance(SpringObjectFactory.java:206) com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:128) com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:139) com.opensymphony.xwork2.ObjectFactory.buildAction(ObjectFactory.java:109) com.opensymphony.xwork2.DefaultActionInvocation.createAction(DefaultActionInvocation.java:287) com.opensymphony.xwork2.DefaultActionInvocation.init(DefaultActionInvocation.java:387) com.opensymphony.xwork2.DefaultActionProxy.prepare(DefaultActionProxy.java:186) org.apache.struts2.impl.StrutsActionProxy.prepare(StrutsActionProxy.java:61) org.apache.struts2.impl.StrutsActionProxyFactory.createActionProxy(StrutsActionProxyFactory.java:39) com.opensymphony.xwork2.DefaultActionProxyFactory.createActionProxy(DefaultActionProxyFactory.java:47) org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:458) org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:395) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.apache.struts2.dispatcher.ActionContextCleanUp.doFilter(ActionContextCleanUp.java:102) org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:845) org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583) org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) java.lang.Thread.run(Unknown Source) -------------------------------------------------------------------------------- You are seeing this page because development mode is enabled. Development mode, or devMode, enables extra debugging behaviors and reports to assist developers. To disable this mode, set: struts.devMode=false in your WEB-INF/classes/struts.properties file.

kylin bulid cube 超时问题该如何解决

如图: ![图片说明](https://img-ask.csdn.net/upload/201811/07/1541579752_827015.png) log:org.apache.kafka.common.errors.TimeoutException: Timeout expired while fetching topic metadata 2018-11-07 16:31:52,520 ERROR [http-bio-7070-exec-5] controller.BasicController:61 : org.apache.kylin.rest.exception.InternalErrorException: Timeout expired while fetching topic metadata at org.apache.kylin.rest.controller.CubeController.buildInternal(CubeController.java:396) at org.apache.kylin.rest.controller.CubeController.rebuild2(CubeController.java:377) at org.apache.kylin.rest.controller.CubeController.build2(CubeController.java:368) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:133) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:97) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:827) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:738) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:967) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:901) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:970) at org.springframework.web.servlet.FrameworkServlet.doPut(FrameworkServlet.java:883) at javax.servlet.http.HttpServlet.service(HttpServlet.java:653) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:317) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127) at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:114) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilterInternal(BasicAuthenticationFilter.java:158) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:200) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:64) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:331) at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:214) at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:177) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:209) at com.thetransactioncompany.cors.CORSFilter.doFilter(CORSFilter.java:244) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1115) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:318) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: org.apache.kafka.common.errors.TimeoutException: Timeout expired while fetching topic metadata 本集群为信息:ambari kerberos kafka0.10 hadoop2.5 kylin2.3.2 可以正常读取hive 表格 以及执行sql等。但是流式CUBE就出这些问题 kafka环境变量已配 请求大家帮忙

java java.lang.IllegalArgumentException空值问题

2011-11-15 10:37:29 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet [dispatcher] in context with path [/FireProofing] threw exception [Request processing failed; nested exception is org.springframework.orm.hibernate3.HibernateSystemException: Null value was assigned to a property of primitive type setter of ff.model.PTZ.northMigration; nested exception is org.hibernate.PropertyAccessException: Null value was assigned to a property of primitive type setter of ff.model.PTZ.northMigration] with root cause java.lang.IllegalArgumentException at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.hibernate.property.BasicPropertyAccessor$BasicSetter.set(BasicPropertyAccessor.java:66) at org.hibernate.tuple.entity.AbstractEntityTuplizer.setPropertyValues(AbstractEntityTuplizer.java:583) at org.hibernate.tuple.entity.PojoEntityTuplizer.setPropertyValues(PojoEntityTuplizer.java:229) at org.hibernate.persister.entity.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:3847) at org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:152) at org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:982) at org.hibernate.loader.Loader.doQuery(Loader.java:857) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274) at org.hibernate.loader.Loader.doList(Loader.java:2533) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276) at org.hibernate.loader.Loader.list(Loader.java:2271) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:452) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:363) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102) at org.springframework.orm.hibernate3.HibernateTemplate$30.doInHibernate(HibernateTemplate.java:921) at org.springframework.orm.hibernate3.HibernateTemplate$30.doInHibernate(HibernateTemplate.java:1) at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406) at org.springframework.orm.hibernate3.HibernateTemplate.executeWithNativeSession(HibernateTemplate.java:374) at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:912) at org.springframework.orm.hibernate3.HibernateTemplate.find(HibernateTemplate.java:904) at ff.dao.impl.PTZDaoHImpl.getAllPTZs(PTZDaoHImpl.java:30) at ff.service.impl.PTZServiceImpl.getPTZList(PTZServiceImpl.java:96) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) at $Proxy49.getPTZList(Unknown Source) at ff.controller.PTZController.getAllPTZs(PTZController.java:86) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:471) at org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:408) at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153) at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:669) at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:574) at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at ff.filter.loginFilter.doFilter(loginFilter.java:51) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:240) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:164) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:498) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:562) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:394) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:243) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:188) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) 说空值,参数传递问题,能说一下我具体在哪步出现错误么,按照提示他说我在model中有错误,难道是我在model中有变量没有get、set?我已经全部get、set了,求指点

argument type mismatch 参数类型不匹配的问题

public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("UTF-8"); try { User u = new User(); System.out.println("封装数据前:"+u); //获取表单数据 Map<String,String[]> map = request.getParameterMap(); for (Map.Entry<String, String[]> m : map.entrySet()) { String name = m.getKey(); String[] value = m.getValue(); //创建一属性描述器 PropertyDescriptor pd = new PropertyDescriptor(name,User.class); //得到setter属性 Method setter = pd.getWriteMethod(); if(value.length==1){ setter.invoke(u, value[0]);//给一个值的变量赋值 }else{ setter.invoke(u, (Object)value);//相当于给复选框赋值 } } System.out.println("封装数据后:"+u); } catch (Exception e) { e.printStackTrace(); } } ``` ``` 报错: 封装数据前:User [userName=null, pwd=null, sex=null, hobby=null, city=null] java.lang.IllegalArgumentException: argument type mismatch at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at Demon.servlet.servletDemo3.doGet(servletDemo3.java:39) at Demon.servlet.servletDemo3.doPost(servletDemo3.java:80) at javax.servlet.http.HttpServlet.service(HttpServlet.java:646) at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:315) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619) 这个是哪里错了

struts2利用domain model传参数的问题

就是我想发表一篇评论,评论有两个属性,String类型的content和自定义类型的User。 提交表单时我的action能接到一般的属性,如String,int.但是自定义属性User怎么都接受不到。。我看了下错误异常觉得可能是session中取出的值是object类型的,如果是的话,该怎么强转成User类型的呢。 原码如下: //这段是我的domain model public class Message { private int id; private String content; private String pubTime; private User user; public String getPubTime() { return pubTime; } public void setPubTime(String pubTime) { this.pubTime = pubTime; } public int getId() { return id; } public void setId(int id) { this.id = id; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public User getUser() { return user; } public void setUser(User user) { this.user = user; } } ////////////////////// ///这段是我的action public class MessageAction extends ActionSupport { private static final long serialVersionUID = 1L; private Message msg; private MessageDao md = new MessageDao(); public Message getMsg() { return msg; } public void setMsg(Message msg) { this.msg = msg; } public String add(){ if(md.add(msg) == null){ this.addFieldError("error", "add failed~!"); return ERROR; } return SUCCESS; } public String delete(){ return SUCCESS; } public String modify(){ return SUCCESS; } } ///////////////////// /////这是我前台页面的表单 <form action=admin/Message_add method=post> <%-- 这是隐藏属性--文章的作者 --%> <input type="hidden" name="msg.user" value=<s:property value="#session.logined"/>> <textarea name="msg.content" rows=4 cols=125 id="msgContent"></textarea> <input type="submit" name="submit" value="提交" onClick="return validateSubmit()"> <input type="reset" name="reset" value="重置"> </form> ///////////////// /////给我报了这么个错误 2009-10-25 18:36:37 com.opensymphony.xwork2.util.logging.commons.CommonsLogger warn 警告: Error setting expression 'msg.user' with value '[Ljava.lang.String;@f007ad' ognl.MethodFailedException: Method "setUser" failed for object com.tls.model.Message@1325aef [java.lang.NoSuchMethodException: com.tls.model.Message.setUser([Ljava.lang.String;)] at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1265) at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:1454) at ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:85) at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:162) at com.opensymphony.xwork2.ognl.accessor.ObjectAccessor.setProperty(ObjectAccessor.java:28) at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:2225) at ognl.ASTProperty.setValueBody(ASTProperty.java:127) at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220) at ognl.SimpleNode.setValue(SimpleNode.java:301) at ognl.ASTChain.setValueBody(ASTChain.java:227) at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220) at ognl.SimpleNode.setValue(SimpleNode.java:301) at ognl.Ognl.setValue(Ognl.java:737) at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:198) at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:161) at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:149) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:276) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:187) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488) at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.NoSuchMethodException: com.tls.model.Message.setUser([Ljava.lang.String;) at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1206) ... 67 more /-- Encapsulated exception ------------\ java.lang.NoSuchMethodException: com.tls.model.Message.setUser([Ljava.lang.String;) at ognl.OgnlRuntime.callAppropriateMethod(OgnlRuntime.java:1206) at ognl.OgnlRuntime.setMethodValue(OgnlRuntime.java:1454) at ognl.ObjectPropertyAccessor.setPossibleProperty(ObjectPropertyAccessor.java:85) at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:162) at com.opensymphony.xwork2.ognl.accessor.ObjectAccessor.setProperty(ObjectAccessor.java:28) at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:2225) at ognl.ASTProperty.setValueBody(ASTProperty.java:127) at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220) at ognl.SimpleNode.setValue(SimpleNode.java:301) at ognl.ASTChain.setValueBody(ASTChain.java:227) at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:220) at ognl.SimpleNode.setValue(SimpleNode.java:301) at ognl.Ognl.setValue(Ognl.java:737) at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:198) at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:161) at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:149) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:276) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:187) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:195) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:179) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:235) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:89) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:130) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:126) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:138) at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:165) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:179) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:176) at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:237) at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:488) at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:875) at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665) at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528) at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81) at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689) at java.lang.Thread.run(Unknown Source) \--------------------------------------/ 请问高手是什么原因啊~! [b]问题补充:[/b] 1楼的大哥能说详细点吗? [b]问题补充:[/b] 回 :蔡华江 可是我message类里面不是定义了一个成员变量User了不~ 我的domain model可以自动接收前台传过来的参数啊,那个msg.user不就是我message类里的user这个属性么? 我现在是要把struts与hibernate相结合,所以想传个user对象过去,请问struts2不能传递对象么? [b]问题补充:[/b] 那像我这样的情况如果要传个对象过去应该怎么办呢?

JAVA6动态编译的问题

在使用JAVA6动态编译时遇到的一个问题,动态编译方法已经写就。通过main方法调用的动态编译时,编译通过,并可以使用编译生成的类。但是,在Tomcat下调用同样的方法进行动态编译时,编译无法通过。其原因是找不到对应的包。因为动态生成的类中import了其他的一些类。我猜是tomcat的某些加载机制影响了动态编译过程,导致动态编译找不引用的类。请问各位,是否有方法解决? [b]问题补充:[/b] 补充代码: 参数 files是一个JavaFile类型的数组,其中包含了Java类的源文件 [code="java"] public static Class[] complie(JavaFile[] files) throws Exception { JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); //ClassLoader clsLoader=ToolProvider.getSystemToolClassLoader(); DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<JavaFileObject>(); MemoryFileManager filemanage = new MemoryFileManager(compiler .getStandardFileManager(diagnostics, null, null)); //MemoryFileManager filemanage = new MemoryFileManager(compiler //.getStandardFileManager(diagnostics, null, null)); //Log.info("Location\t"+filemanage.) ArrayList<JavaFileObject> clsFiles=new ArrayList<JavaFileObject>(); for(JavaFile file:files) { JavaFileObject clsfile = MemoryFileManager.makeSource(file .getFileName(), file.toString()); clsFiles.add(clsfile); Log.info("compile:"+file.getFileName()+"\t"+clsfile.getName()+"\t"+clsfile.getKind()+"\t"+clsfile.toUri()); } Iterable<? extends JavaFileObject> compilationUnits=clsFiles; JavaCompiler.CompilationTask task = compiler.getTask(null, filemanage, diagnostics, null, options.getClassNames(), compilationUnits); boolean success=false; try { success = task.call(); } catch (Exception e) { e.printStackTrace(); } Class[] clazz=new Class[files.length]; if(success) { for(int i=0;i<clazz.length;i++) { clazz[i] = filemanage.getClassLoader(null).loadClass(files[i].getFileName()); } } else { for (Diagnostic diagnostic : diagnostics.getDiagnostics()) System.out.printf( "Code: %s%n" + "Kind: %s%n" + "Position: %s%n" + "Start Position: %s%n" + "End Position: %s%n" + "Source: %s%n" + "Message: %s%n", diagnostic.getCode(), diagnostic.getKind(), diagnostic.getPosition(), diagnostic.getStartPosition(), diagnostic.getEndPosition(), diagnostic.getSource(), diagnostic.getMessage(null)); } filemanage.close(); return clazz; } [/code] [b]问题补充:[/b] TOMCAT下的编译诊断信息: [code="java"] Code: compiler.err.doesnt.exist Kind: ERROR Position: 0 Start Position: 0 End Position: 0 Source: mfm:///RuntimeEntitySysUser.java from JavaSourceFromString Message: mfm:///RuntimeEntitySysUser.java:1: 软件包 com.youngor.dboperator 不存在 Code: compiler.err.doesnt.exist Kind: ERROR Position: 104 Start Position: 78 End Position: 112 Source: mfm:///RuntimeEntitySysUser.java from JavaSourceFromString Message: mfm:///RuntimeEntitySysUser.java:4: 软件包 com.youngor.webcore.entity 不存在 Code: compiler.err.doesnt.exist Kind: ERROR Position: 146 Start Position: 124 End Position: 156 Source: mfm:///RuntimeEntitySysUser.java from JavaSourceFromString Message: mfm:///RuntimeEntitySysUser.java:6: 软件包 com.youngor.dboperator 不存在 Code: compiler.err.doesnt.exist Kind: ERROR Position: 202 Start Position: 180 End Position: 212 Source: mfm:///RuntimeEntitySysUser.java from JavaSourceFromString Message: mfm:///RuntimeEntitySysUser.java:9: 软件包 com.youngor.dboperator 不存在 Code: compiler.err.doesnt.exist Kind: ERROR Position: 239 Start Position: 213 End Position: 251 Source: mfm:///RuntimeEntitySysUser.java from JavaSourceFromString Message: mfm:///RuntimeEntitySysUser.java:9: 软件包 com.youngor.webcore.entity 不存在 Code: compiler.err.doesnt.exist Kind: ERROR Position: 0 Start Position: 0 End Position: 0 Source: mfm:///RuntimeEntitySysPosition.java from JavaSourceFromString Message: mfm:///RuntimeEntitySysPosition.java:1: 软件包 com.youngor.dboperator 不存在 Code: compiler.err.doesnt.exist Kind: ERROR Position: 108 Start Position: 82 End Position: 120 Source: mfm:///RuntimeEntitySysPosition.java from JavaSourceFromString Message: mfm:///RuntimeEntitySysPosition.java:4: 软件包 com.youngor.webcore.entity 不存在 Code: compiler.err.cant.resolve.location Kind: ERROR Position: 328 Start Position: 328 End Position: 337 Source: mfm:///RuntimeEntitySysUser.java from JavaSourceFromString Message: mfm:///RuntimeEntitySysUser.java:14: 找不到符号 符号: 类 EntitySet 位置: 类 RuntimeEntitySysUser Code: compiler.err.cant.resolve.location Kind: ERROR Position: 383 Start Position: 383 End Position: 392 Source: mfm:///RuntimeEntitySysUser.java from JavaSourceFromString Message: mfm:///RuntimeEntitySysUser.java:14: 找不到符号 符号: 变量 DefaultDB 位置: 类 RuntimeEntitySysUser Code: compiler.err.doesnt.exist Kind: ERROR Position: 436 Start Position: 410 End Position: 448 Source: mfm:///RuntimeEntitySysUser.java from JavaSourceFromString Message: mfm:///RuntimeEntitySysUser.java:14: 软件包 com.youngor.webcore.entity 不存在 Code: compiler.err.cant.resolve.location Kind: ERROR Position: 619 Start Position: 619 End Position: -1 Source: mfm:///RuntimeEntitySysUser.java from JavaSourceFromString Message: mfm:///RuntimeEntitySysUser.java:16: 找不到符号 符号: 变量 super 位置: 类 RuntimeEntitySysUser Code: compiler.err.cant.resolve.location Kind: ERROR Position: 667 Start Position: 667 End Position: -1 Source: mfm:///RuntimeEntitySysUser.java from JavaSourceFromString Message: mfm:///RuntimeEntitySysUser.java:18: 找不到符号 符号: 变量 super 位置: 类 RuntimeEntitySysUser [/code] Tomcat输出的异常信息: [code="java"] java.lang.NullPointerException at com.youngor.dboperator.EntityUtil.getInstance(EntityUtil.java:36) at com.youngor.dboperator.Entity.getInstance(Entity.java:103) at com.youngor.dboperator.SQLServer2000Adaptor.getEntitySetBySQL(SQLServer2000Adaptor.java:283) at com.youngor.dboperator.SQLServer2000Adaptor.getEntitySet(SQLServer2000Adaptor.java:220) at com.youngor.dboperator.InnerDBOperator.getEntitySet(InnerDBOperator.java:451) at com.youngor.dboperator.DBOperator.getEntitySet(DBOperator.java:350) at com.youngor.dboperator.DefaultDB.getEntitySet(DefaultDB.java:147) at com.youngor.dboperator.DefaultDB.getEntitySet(DefaultDB.java:213) at com.youngor.webcore.entity.SysUser.getEntitySet(SysUser.java:501) at com.youngor.webcore.entity.SysUser.doTest(SysUser.java:610) at org.apache.jsp.login_jsp._jspService(login_jsp.java:66) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:857) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:565) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1509) at java.lang.Thread.run(Thread.java:619) java.lang.NullPointerException at com.youngor.dboperator.SQLServer2000Adaptor.getEntitySetBySQL(SQLServer2000Adaptor.java:284) at com.youngor.dboperator.SQLServer2000Adaptor.getEntitySet(SQLServer2000Adaptor.java:220) at com.youngor.dboperator.InnerDBOperator.getEntitySet(InnerDBOperator.java:451) at com.youngor.dboperator.DBOperator.getEntitySet(DBOperator.java:350) at com.youngor.dboperator.DefaultDB.getEntitySet(DefaultDB.java:147) at com.youngor.dboperator.DefaultDB.getEntitySet(DefaultDB.java:213) at com.youngor.webcore.entity.SysUser.getEntitySet(SysUser.java:501) at com.youngor.webcore.entity.SysUser.doTest(SysUser.java:610) at org.apache.jsp.login_jsp._jspService(login_jsp.java:66) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286) at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:857) at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:565) at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1509) at java.lang.Thread.run(Thread.java:619) [/code] [b]问题补充:[/b] public static Class[] complie(JavaFile[] files) throws Exception 这个方法是用main(String[] args)方法测试成功。放到JSP页面中调用输错。错误信息已经在上面给出。 [b]问题补充:[/b] 把com.youngor.*之类的类文件,放到tomcat下的common或shared下对应的classes或lib下,应该就不会报这个异常 或许可以解决问题。但是这不太符合Web应用部署的常规做法,不知“lovewhzlq”是否还有其他可行方法,不吝赐教。 [b]问题补充:[/b] 问题基本解决,需要为编译过程指定编译的类路径; [code="java"] C:\myproject>javac -help 用法:javac <选项> <源文件> 其中,可能的选项包括: -g 生成所有调试信息 -g:none 不生成任何调试信息 -g:{lines,vars,source} 只生成某些调试信息 -nowarn 不生成任何警告 -verbose 输出有关编译器正在执行的操作的消息 -deprecation 输出使用已过时的 API 的源位置 -classpath <路径> 指定查找用户类文件的位置 -cp <路径> 指定查找用户类文件的位置 -sourcepath <路径> 指定查找输入源文件的位置 -bootclasspath <路径> 覆盖引导类文件的位置 -extdirs <目录> 覆盖安装的扩展目录的位置 -endorseddirs <目录> 覆盖签名的标准路径的位置 -d <目录> 指定存放生成的类文件的位置 -encoding <编码> 指定源文件使用的字符编码 -source <版本> 提供与指定版本的源兼容性 -target <版本> 生成特定 VM 版本的类文件 -version 版本信息 -help 输出标准选项的提要 -X 输出非标准选项的提要 -J<标志> 直接将 <标志> 传递给运行时系统 [/code] 修改部分代码如下: [code="java"] String cp=PathTool.get(AdvancedCompilerAPIDemo.class); Log.info(cp); int i=cp.indexOf("/WEB-INF/classes/"); cp=cp.substring(0, i+17); Log.info(cp); Iterable<String> options = Arrays.asList("-d", cp,"-cp",cp); // 编译选项,将编译产生的类文件放在当前目录下 CompilationTask task = compiler.getTask(null, fileManager, diagnostics, options, null, sourcefiles); [/code] 这里找到了WEb应用的classes目录并设置为编译输出目录和类路径。编译通过并可以使用了。

struts2 的一个警告 ,请大家帮忙看下

<p>WARN http-8080-3 com.opensymphony.xwork2.ognl.OgnlValueStack - Error setting expression 'priceImport[]' with value '[Ljava.lang.String;@18f419e'<br> ognl.ExpressionSyntaxException: Malformed OGNL expression: <span style="font-size: large;"><span style="color: red;">priceImport[]</span></span> [ognl.ParseException: Encountered " "]" "] "" at line 1, column 13.<br>Was expecting one of:<br>    ":" ...<br>    "not" ...<br>    "+" ...<br>    "-" ...<br>    "~" ...<br>    "!" ...<br>    "(" ...<br>    "true" ...<br>    "false" ...<br>    "null" ...<br>    "#this" ...<br>    "#root" ...<br>    "#" ...<br>    "[" ...<br>    "{" ...<br>    "@" ...<br>    "new" ...<br>    &lt;IDENT&gt; ...<br>    &lt;DYNAMIC_SUBSCRIPT&gt; ...<br>    "\'" ...<br>    "`" ...<br>    "\"" ...<br>    &lt;INT_LITERAL&gt; ...<br>    &lt;FLT_LITERAL&gt; ...<br>    ]<br> at ognl.Ognl.parseExpression(Ognl.java:112)<br> at com.opensymphony.xwork2.ognl.OgnlUtil.compile(OgnlUtil.java:225)<br> at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:209)<br> at com.opensymphony.xwork2.ognl.OgnlValueStack.trySetValue(OgnlValueStack.java:173)<br> at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:160)<br> at com.opensymphony.xwork2.ognl.OgnlValueStack.setValue(OgnlValueStack.java:151)<br> at com.opensymphony.xwork2.interceptor.ParametersInterceptor.setParameters(ParametersInterceptor.java:288)<br> at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:199)<br> at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)<br> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)<br> at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207)<br> at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)<br> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)<br> at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190)<br> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)<br> at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75)<br> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)<br> at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94)<br> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)<br> at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243)<br> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)<br> at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100)<br> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)<br> at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141)<br> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)<br> at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267)<br> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)<br> at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:142)<br> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)<br> at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:166)<br> at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98)<br> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)<br> at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176)<br> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)<br> at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164)<br> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)<br> at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190)<br> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)<br> at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187)<br> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)<br> at cn.onestoplog.enrate.interceptor.CheckLoginInterceptor.intercept(CheckLoginInterceptor.java:102)<br> at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248)<br> at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52)<br> at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485)<br> at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77)<br> at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91)<br> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)<br> at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)<br> at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)<br> at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)<br> at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)<br> at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)<br> at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)<br> at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)<br> at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852)<br> at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)<br> at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)<br> at java.lang.Thread.run(Thread.java:619)<br>===================================================================<br>这是后台日志报的警告<br>先说下环境, 前台使用jquery post数据到action</p> <pre name="code" class="js">var arr = new Array(); var subarray = new Array(); subarray.push('aaa');//0 subarray.push('bbb');//1 subarray.push('ccc');//2 arr.push(subarray); $.ajax({ type : "POST", url : "rate/addSeaRate.html", data : { 'Subject' : $('#Subject').val(), 'priceImport[]' : new Array(arr) }, dataType : "json", success : function(data) { if(data.json.key[0]==true){ alert('Post Ocean Freight Rate Success.'); }else{ alert("Post Error. Please Post Again."); } }, error : function(json) { alert("Post Error. Please Post Again."); } });</pre> <p> <br>2.后台接受数据<br>    <span style="white-space: pre;"> String priceImport = request.getParameter("priceImport[]");</span><br> <br>3.然后截取 priceImport  这个变量 获得数组后迭代取值操作。</p> <p> 功能上是ok的 。  但是系统就是报上面贴的警告 。 说 <span style="white-space: pre;">priceImport[] 这个名字有缺陷 , 请问怎么fix这个警告</span></p> <p> </p>

大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了

大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

你以为这样写Java代码很6,但我看不懂

为了提高 Java 编程的技艺,我最近在 GitHub 上学习一些高手编写的代码。下面这一行代码(出自大牛之手)据说可以征服你的朋友,让他们觉得你写的代码很 6,来欣赏一下吧。 IntStream.range(1, 5).boxed().map(i -&gt; { System.out.print("Happy Birthday "); if (i == 3) return "dear NAME"...

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

程序员写出这样的代码,能不挨骂吗?

当你换槽填坑时,面对一个新的环境。能够快速熟练,上手实现业务需求是关键。但是,哪些因素会影响你快速上手呢?是原有代码写的不够好?还是注释写的不够好?昨夜...

带了6个月的徒弟当了面试官,而身为高级工程师的我天天修Bug......

即将毕业的应届毕业生一枚,现在只拿到了两家offer,但最近听到一些消息,其中一个offer,我这个组据说客户很少,很有可能整组被裁掉。 想问大家: 如果我刚入职这个组就被裁了怎么办呢? 大家都是什么时候知道自己要被裁了的? 面试软技能指导: BQ/Project/Resume 试听内容: 除了刷题,还有哪些技能是拿到offer不可或缺的要素 如何提升面试软实力:简历, 行为面试,沟通能...

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

程序员为什么千万不要瞎努力?

本文作者用对比非常鲜明的两个开发团队的故事,讲解了敏捷开发之道 —— 如果你的团队缺乏统一标准的环境,那么即使勤劳努力,不仅会极其耗时而且成果甚微,使用...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

Python爬虫,高清美图我全都要(彼岸桌面壁纸)

爬取彼岸桌面网站较为简单,用到了requests、lxml、Beautiful Soup4

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

Java岗开发3年,公司临时抽查算法,离职后这几题我记一辈子

前几天我们公司做了一件蠢事,非常非常愚蠢的事情。我原以为从学校出来之后,除了找工作有测试外,不会有任何与考试有关的事儿。 但是,天有不测风云,公司技术总监、人事总监两位大佬突然降临到我们事业线,叫上我老大,给我们组织了一场别开生面的“考试”。 那是一个风和日丽的下午,我翘着二郎腿,左手端着一杯卡布奇诺,右手抓着我的罗技鼠标,滚动着轮轴,穿梭在头条热点之间。 “淡黄的长裙~蓬松的头发...

大牛都会用的IDEA调试技巧!!!

导读 前天面试了一个985高校的实习生,问了他平时用什么开发工具,他想也没想的说IDEA,于是我抛砖引玉的问了一下IDEA的调试用过吧,你说说怎么设置断点...

面试官:你连SSO都不懂,就别来面试了

大厂竟然要考我SSO,卧槽。

立即提问
相关内容推荐