cas server4.1.3集群退出的问题

一个Nginx+两个Tomcat组成的cas server集群,cas server主要配置如下:
ticketRegistry.xml文件:

    <bean id="ticketDataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
        p:driverClass="com.mysql.jdbc.Driver"
        p:jdbcUrl="jdbc:mysql://localhost:7999/casticket?useUnicode=true&amp;characterEncoding=UTF-8&amp;zeroDateTimeBehavior=convertToNull"
        p:user="root"
        p:password="root"
        p:initialPoolSize="6"
        p:minPoolSize="6"
        p:maxPoolSize="20"
        p:maxIdleTimeExcessConnections="1000"
        p:checkoutTimeout="2000"
        p:acquireIncrement="16"
        p:acquireRetryAttempts="5"
        p:acquireRetryDelay="2000"
        p:idleConnectionTestPeriod="30"
        p:preferredTestQuery="select 1" />

    <!-- Ticket Registry -->
    <!-- <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.DefaultTicketRegistry"/> -->
    <bean id="ticketRegistry" class="org.jasig.cas.ticket.registry.JpaTicketRegistry" />
    <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
    <util:list id="packagesToScan">
        <value>org.jasig.cas.ticket</value>
        <value>org.jasig.cas.adaptors.jdbc</value>
    </util:list>
    <bean id="jpaVendorAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
        p:generateDdl="true"
        p:showSql="true" />
    <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
        p:dataSource-ref="ticketDataSource"
        p:jpaVendorAdapter-ref="jpaVendorAdapter"
        p:packagesToScan-ref="packagesToScan">
        <property name="persistenceUnitName" value="CasPU"/>
        <property name="jpaProperties">
            <props>
                <prop key="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</prop>
                <prop key="hibernate.hbm2ddl.auto">update</prop>
            </props>
        </property>
    </bean>
    <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager"
        p:entityManagerFactory-ref="entityManagerFactory" />
    <!-- 使用这个报错 -->
    <!-- <tx:annotation-driven transaction-manager="transactionManager" /> -->
    <tx:advice id="txRegistryAdvice" transaction-manager="transactionManager">
        <tx:attributes>
            <tx:method name="deleteTicket" read-only="false" />
            <tx:method name="addTicket" read-only="false" />
            <tx:method name="updateTicket" read-only="false" />
            <tx:method name="getTicket" read-only="true" />
            <tx:method name="getTickets" read-only="true" />
            <tx:method name="add*" read-only="false"/>
            <tx:method name="delete*" read-only="false"/>
            <tx:method name="save*" read-only="false"/>
            <tx:method name="update*" read-only="false"/>
            <tx:method name="get*" read-only="true"/>
            <tx:method name="grant*" read-only="false"/>
            <tx:method name="validate*" read-only="true"/>
            <tx:method name="sessionCount" read-only="true" />
            <tx:method name="serviceTicketCount" read-only="true" />
        </tx:attributes>
    </tx:advice>
    <tx:advice id="txRegistryLockingAdvice" transaction-manager="transactionManager">
        <tx:attributes>
            <tx:method name="getOwner" read-only="true" />
            <tx:method name="acquire" read-only="false" />
            <tx:method name="release" read-only="false" />
        </tx:attributes>
    </tx:advice>
    <aop:config>
        <aop:pointcut id="ticketRegistryOperations" expression="execution(* org.jasig.cas.ticket.registry.JpaTicketRegistry.*(..))"/>
        <aop:pointcut id="ticketRegistryLockingOperations" expression="execution(* org.jasig.cas.ticket.registry.support.JpaLockingStrategy.*(..))"/>
        <aop:pointcut id="centralAuthenticationServiceOperations" expression="execution(* org.jasig.cas.CentralAuthenticationService.*(..))"/>
        <aop:advisor advice-ref="txRegistryAdvice" pointcut-ref="ticketRegistryOperations"/>       
        <aop:advisor advice-ref="txRegistryLockingAdvice" pointcut-ref="ticketRegistryLockingOperations"/>
        <aop:advisor advice-ref="txRegistryAdvice" pointcut-ref="centralAuthenticationServiceOperations"/>
    </aop:config>


    <!--Quartz -->
    <!-- TICKET REGISTRY CLEANER -->
    <bean id="cleanerLock" class="org.jasig.cas.ticket.registry.support.JpaLockingStrategy"
        p:uniqueId="${host.name}"
        p:applicationId="cas-ticket-registry-cleaner" />

    <bean id="ticketRegistryCleaner" class="org.jasig.cas.ticket.registry.support.DefaultTicketRegistryCleaner"
          c:centralAuthenticationService-ref="centralAuthenticationService"
          c:ticketRegistry-ref="ticketRegistry"
          p:lock-ref="cleanerLock"/>

    <bean id="jobDetailTicketRegistryCleaner"
          class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"
          p:targetObject-ref="ticketRegistryCleaner"
          p:targetMethod="clean"/>

    <bean id="triggerJobDetailTicketRegistryCleaner"
          class="org.springframework.scheduling.quartz.SimpleTriggerFactoryBean"
          p:jobDetail-ref="jobDetailTicketRegistryCleaner"
          p:startDelay="20000"
          p:repeatInterval="5000000"/>

Nginx.conf配置文件:

    upstream cas {
        server 10.0.0.8:8082 weight=1;
        server 10.0.0.8:8083 weight=1;
    }

    server {
        listen       8080;
        server_name  localhost;

        #charset koi8-r;

        #access_log  logs/host.access.log  main;

        location / {
        #proxy_redirect off;
        proxy_set_header Host $host;
        proxy_set_header Referer $http_referer;
        proxy_set_header Cookie $http_cookie;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://cas;
        }

两个tomcat使用memcached-session-manager实现session共享:

 <Manager className="de.javakaffee.web.msm.MemcachedBackupSessionManager"
        memcachedNodes="n1:localhost:11211"
        sticky="false"
        sessionBackupAsync="false"
        lockingMode="auto"
        requestUriIgnorePattern=".*\.(ico|png|gif|jpg|css|js)$"
        transcoderFactoryClass="de.javakaffee.web.msm.serializer.kryo.KryoTranscoderFactory" />

客户端SpringMVC项目web.xml文件:

 <filter>
        <filter-name>CAS Single Sign Out Filter</filter-name>
        <filter-class>org.jasig.cas.client.session.SingleSignOutFilter</filter-class>
        <init-param>
            <param-name>casServerUrlPrefix</param-name>
            <param-value>http://h4:8080/cas</param-value>
        </init-param>
    </filter>
    <!-- 该过滤器负责用户的认证工作,必须启用它 -->
    <filter>
        <filter-name>CASFilter</filter-name>
        <filter-class>org.jasig.cas.client.authentication.AuthenticationFilter</filter-class>
        <init-param>
            <param-name>casServerLoginUrl</param-name>
            <!-- 下面的URL是Cas服务器的登录地址 -->
            <param-value>http://h4:8080/cas/login</param-value>
        </init-param>
        <init-param>
            <param-name>serverName</param-name>
            <param-value>http://localhost:8888</param-value>
        </init-param>
    </filter>
    <!-- 该过滤器负责对Ticket的校验工作,必须启用它 -->
    <filter>
        <filter-name>CAS Validation Filter</filter-name>
        <filter-class>org.jasig.cas.client.validation.Cas20ProxyReceivingTicketValidationFilter</filter-class>
        <init-param>
            <param-name>casServerUrlPrefix</param-name>
            <!-- 下面的URL是Cas服务器的认证地址 -->
            <param-value>http://h4:8080/cas</param-value><!-- /login -->
        </init-param>
        <init-param>
            <param-name>serverName</param-name>
            <param-value>http://localhost:8888</param-value>
        </init-param>
        <init-param>
            <param-name>redirectAfterValidation</param-name>
            <param-value>true</param-value>
        </init-param>
        <init-param>
            <param-name>useSession</param-name>
            <param-value>true</param-value>
        </init-param>
        <!--<init-param>-->
            <!--<param-name>renew</param-name>-->
            <!--<param-value>false</param-value>-->
        <!--</init-param>-->
        <!--<init-param>-->
            <!--<param-name>gateway</param-name>-->
            <!--<param-value>false</param-value>-->
        <!--</init-param>-->
    </filter>
    <filter>
        <filter-name>CAS HttpServletRequest Wrapper Filter</filter-name>
        <filter-class>org.jasig.cas.client.util.HttpServletRequestWrapperFilter</filter-class>
    </filter>
    <!--
    该过滤器使得开发者可以通过org.jasig.cas.client.util.AssertionHolder来获取用户的登录名。
    比如AssertionHolder.getAssertion().getPrincipal().getName()。
    -->
    <filter>
        <filter-name>CAS Assertion Thread Local Filter</filter-name>
        <filter-class>org.jasig.cas.client.util.AssertionThreadLocalFilter</filter-class>
    </filter>
    <filter>
        <filter-name>CasForInvokeContextFilter</filter-name>
        <filter-class>javacommon.filter.LoginFilter</filter-class>
    </filter>
        <listener>
        <listener-class>org.jasig.cas.client.session.SingleSignOutHttpSessionListener</listener-class>
    </listener>

客户端项目退出时报错:
2016-10-18 10:58:35,558 ERROR [org.springframework.transaction.interceptor.TransactionInterceptor] - Application exception overridden by commit exception
INVALID_TICKET
at org.jasig.cas.CentralAuthenticationServiceImpl.getTicket(CentralAuthenticationServiceImpl.java:520)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
在winserver2012 上安装visualsvn server失败!

在windows server2012安装VisualSVN Server报错,求助! 报错信息:Custom action CreateAdminGroupExecute failed:Cannot create group 'VisualSVN Server Admins':系统找不到指定的文件

在Laravel 5.5中安装Passport包的问题

<div class="post-text" itemprop="text"> <p>I can't install "Passport" package in my laravel 5.5.</p> <p>When i try to install passport package by composer, i face lot of package stability issues.</p> <p>I use the following,</p> <pre><code>"require": { "php": "&gt;=7.0.0", "fideloper/proxy": "~3.3", "laravel/framework": "5.5.*", "laravel/tinker": "~1.0", "laravelcollective/html": "^5.2.0", "laravel/passport": "^1.0" } </code></pre> <p>when i try to install by,</p> <pre><code> composer update </code></pre> <p>I got following error,</p> <pre><code> Your requirements could not be resolved to an installable set of packages. Problem 1 - Conclusion: don't install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: don't install lucadegasperi/oauth2-server-laravel 4.0.2 - Conclusion: remove lucadegasperi/oauth2-server-laravel 4.0.1 - Conclusion: don't install laravel/passport v1.0.18|don't install league/oauth2-server 4.1.5|install league/oauth2-server 5.1.5 - Conclusion: don't install laravel/passport v1.0.18|don't install league/oauth2-server 4.1.4|install league/oauth2-server 5.1.4|install league/oauth2-server 5.1.5 - Conclusion: don't install laravel/passport v1.0.18|don't install league/oauth2-server 4.1.3|install league/oauth2-server 5.1.3|install league/oauth2-server 5.1.4|install league/oauth2-server 5.1.5 - Conclusion: don't install laravel/passport v1.0.18|don't install league/oauth2-server 4.1.2|install league/oauth2-server 5.1.2|install league/oauth2-server 5.1.3|install league/oauth2-server 5.1.4|install league/oauth2-server 5.1.5 - Conclusion: don't install laravel/passport v1.0.18|don't install league/oauth2-server 4.1.1|install league/oauth2-server 5.1.1|install league/oauth2-server 5.1.2|install league/oauth2-server 5.1.3|install league/oauth2-server 5.1.4|install league/oauth2-server 5.1.5 - Conclusion: don't install lucadegasperi/oauth2-server-laravel 4.0.0 - Conclusion: don't install laravel/passport v1.0.18|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: remove league/oauth2-server 4.1.6|install laravel/passport v1.0.18 - Conclusion: don't install league/oauth2-server 5.1.5|keep league/oauth2-server 4.1.6|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: don't install laravel/passport v1.0.17|keep league/oauth2-server 4.1.6|install league/oauth2-server 5.1.5|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: don't install laravel/passport v1.0.16|keep league/oauth2-server 4.1.6|install league/oauth2-server 5.1.5|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: don't install laravel/passport v1.0.15|keep league/oauth2-server 4.1.6|install league/oauth2-server 5.1.5|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: don't install laravel/passport v1.0.14|keep league/oauth2-server 4.1.6|install league/oauth2-server 5.1.5|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: don't install laravel/passport v1.0.13|keep league/oauth2-server 4.1.6|install league/oauth2-server 5.1.5|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: don't install laravel/passport v1.0.12|keep league/oauth2-server 4.1.6|install league/oauth2-server 5.1.5|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: don't install laravel/passport v1.0.11|keep league/oauth2-server 4.1.6|install league/oauth2-server 5.1.5|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: don't install laravel/passport v1.0.10|keep league/oauth2-server 4.1.6|install league/oauth2-server 5.1.5|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: don't install laravel/passport v1.0.9|keep league/oauth2-server 4.1.6|install league/oauth2-server 5.1.5|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: don't install laravel/passport v1.0.8|keep league/oauth2-server 4.1.6|install league/oauth2-server 5.1.5|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: don't install laravel/passport v1.0.7|keep league/oauth2-server 4.1.6|install league/oauth2-server 5.1.5|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: don't install laravel/passport v1.0.6|keep league/oauth2-server 4.1.6|install league/oauth2-server 5.1.5|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: don't install laravel/passport v1.0.5|keep league/oauth2-server 4.1.6|install league/oauth2-server 5.1.5|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: don't install laravel/passport v1.0.4|keep league/oauth2-server 4.1.6|install league/oauth2-server 5.1.5|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: don't install laravel/passport v1.0.3|keep league/oauth2-server 4.1.6|install league/oauth2-server 5.1.5|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: don't install laravel/passport v1.0.2|keep league/oauth2-server 4.1.6|install league/oauth2-server 5.1.5|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: don't install laravel/passport v1.0.1|keep league/oauth2-server 4.1.6|install league/oauth2-server 5.1.5|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: don't install league/oauth2-server 4.1.5|install league/oauth2-server 5.1.5|install laravel/passport v1.0.18 - Conclusion: don't install league/oauth2-server 4.1.6|install league/oauth2-server 5.1.5|install laravel/passport v1.0.18 - Conclusion: don't install league/oauth2-server 5.0.1|keep league/oauth2-server 4.1.6|install league/oauth2-server 4.1.5|install league/oauth2-server 4.1.6|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: don't install league/oauth2-server 5.0.2|keep league/oauth2-server 4.1.6|install league/oauth2-server 4.1.5|install league/oauth2-server 4.1.6|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: don't install league/oauth2-server 5.0.3|keep league/oauth2-server 4.1.6|install league/oauth2-server 4.1.5|install league/oauth2-server 4.1.6|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: don't install league/oauth2-server 5.1.0|keep league/oauth2-server 4.1.6|install league/oauth2-server 4.1.5|install league/oauth2-server 4.1.6|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: don't install league/oauth2-server 5.1.1|keep league/oauth2-server 4.1.6|install league/oauth2-server 4.1.5|install league/oauth2-server 4.1.6|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: don't install league/oauth2-server 5.1.2|keep league/oauth2-server 4.1.6|install league/oauth2-server 4.1.5|install league/oauth2-server 4.1.6|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Installation request for lucadegasperi/oauth2-server-laravel 4.0.x@dev -&gt; satisfiable by lucadegasperi/oauth2-server-laravel[4.0.0, 4.0.1, 4.0.2, 4.0.x-dev]. - Conclusion: don't install league/oauth2-server 5.1.3|keep league/oauth2-server 4.1.6|install league/oauth2-server 4.1.5|install league/oauth2-server 4.1.6|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - laravel/passport v1.0.0 requires league/oauth2-server ~5.0 -&gt; satisfiable by league/oauth2-server[5.0.0, 5.0.1, 5.0.2, 5.0.3, 5.1.0, 5.1.1, 5.1.2, 5.1.3, 5.1.4, 5.1.5]. - Conclusion: don't install league/oauth2-server 5.1.4|keep league/oauth2-server 4.1.6|install league/oauth2-server 4.1.5|install league/oauth2-server 4.1.6|install lucadegasperi/oauth2-server-laravel 4.0.0|install lucadegasperi/oauth2-server-laravel 4.0.2|install lucadegasperi/oauth2-server-laravel 4.0.x-dev - Conclusion: don't install league/oauth2-server 4.1.1|install league/oauth2-server 5.1.1|install league/oauth2-server 5.1.2|install league/oauth2-server 5.1.3|install league/oauth2-server 5.1.4|install league/oauth2-server 5.1.5|install laravel/passport v1.0.17|install laravel/passport v1.0.18 - Conclusion: don't install league/oauth2-server 4.1.2|install league/oauth2-server 5.1.2|install league/oauth2-server 5.1.3|install league/oauth2-server 5.1.4|install league/oauth2-server 5.1.5|install laravel/passport v1.0.17|install laravel/passport v1.0.18 - Installation request for laravel/passport ^1.0 -&gt; satisfiable by laravel/passport[v1.0.0, v1.0.1, v1.0.10, v1.0.11, v1.0.12, v1.0.13, v1.0.14, v1.0.15, v1.0.16, v1.0.17, v1.0.18, v1.0.2, v1.0.3, v1.0.4, v1.0.5, v1.0.6, v1.0.7, v1.0.8, v1.0.9]. - Conclusion: don't install league/oauth2-server 4.1.3|install league/oauth2-server 5.1.3|install league/oauth2-server 5.1.4|install league/oauth2-server 5.1.5|install laravel/passport v1.0.17|install laravel/passport v1.0.18 - lucadegasperi/oauth2-server-laravel 4.0.1 requires league/oauth2-server 4.1.* -&gt; satisfiable by league/oauth2-server[4.1.6, 4.1.0, 4.1.1, 4.1.2, 4.1.3, 4.1.4, 4.1.5]. - don't install league/oauth2-server 5.0.0|don't install league/oauth2-server 4.1.0 - Conclusion: don't install league/oauth2-server 4.1.4|install league/oauth2-server 5.1.4|install league/oauth2-server 5.1.5|install laravel/passport v1.0.17|install laravel/passport v1.0.18 </code></pre> <p>How to install passport package to my laravel (5.5) ?</p> <p>Thanks in advance !</p> </div>

SSB框架 mapper 注入时报错

这个项目是基于servlet开发的项目,现有的spring 和mybatis 现在想引入springMVC,controller,service两个在一起测试挺好的,但是链接上mapper(我这里没有DAO,mapper.java ---mapper.xml),但是在service @Auto.. 或者是@Resource都会报错, org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'planController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.zcloudMVC.service.TestService com.zcloudMVC.controller.PlanController.testService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testServiceImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.zcloudMVC.mapper.TestMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, mappedName=, description=, name=, type=class java.lang.Object, authenticationType=CONTAINER, lookup=)} at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:334) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1202) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:762) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757) ~[spring-context-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) ~[spring-context-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:663) [spring-webmvc-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:629) [spring-webmvc-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:677) [spring-webmvc-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:548) [spring-webmvc-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:489) [spring-webmvc-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136) [spring-webmvc-4.1.3.RELEASE.jar:4.1.3.RELEASE] at javax.servlet.GenericServlet.init(GenericServlet.java:241) [servlet-api-2.5-20081211.jar:na] at org.mortbay.jetty.servlet.ServletHolder.initServlet(ServletHolder.java:431) [jetty-6.1.19.jar:6.1.19] at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:263) [jetty-6.1.19.jar:6.1.19] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) [jetty-util-6.1.19.jar:6.1.19] at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:676) [jetty-6.1.19.jar:6.1.19] at org.mortbay.jetty.servlet.Context.startContext(Context.java:140) [jetty-6.1.19.jar:6.1.19] at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1239) [jetty-6.1.19.jar:6.1.19] at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517) [jetty-6.1.19.jar:6.1.19] at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:466) [jetty-6.1.19.jar:6.1.19] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) [jetty-util-6.1.19.jar:6.1.19] at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130) [jetty-6.1.19.jar:6.1.19] at org.mortbay.jetty.Server.doStart(Server.java:224) [jetty-6.1.19.jar:6.1.19] at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50) [jetty-util-6.1.19.jar:6.1.19] at com.emacle.httpstorageserv.HttpStorageServ.main(HttpStorageServ.java:145) [bin/:na] Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.zcloudMVC.service.TestService com.zcloudMVC.controller.PlanController.testService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testServiceImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.zcloudMVC.mapper.TestMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, mappedName=, description=, name=, type=class java.lang.Object, authenticationType=CONTAINER, lookup=)} at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:558) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:331) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] ... 30 common frames omitted Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testServiceImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.zcloudMVC.mapper.TestMapper] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, mappedName=, description=, name=, type=class java.lang.Object, authenticationType=CONTAINER, lookup=)} at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:308) ~[spring-context-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1202) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:537) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1127) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1051) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:949) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:530) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] ... 32 common frames omitted 贴出一部分 注解扫描 mapper扫描我都配置了,xml扫描路径也配置, 在service层没问题,怎么注入mapper的时候就报错了,求解 ![图片说明](https://img-ask.csdn.net/uploa![图片说明](https://img-ask.csdn.net/upload/201803/23/1521795969_267447.png)d/201803/23/1521795939_362694.png) ![图片说明](https://img-ask.csdn.net/upload/201803/23/1521795981_368559.png)

centos6.3内核2.6.32升级到3.1.2,在centos上安装xen4.1.3

在安装内核时, Linux becalmer 2.6.32-279.el6.x86_64 #1 SMP Fri Jun 22 12:19:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux [root@becalmer linux-3.1.2]# make -j4 install sh /usr/src/linux-3.1.2/arch/x86/boot/install.sh 3.1.2 arch/x86/boot/bzImage \ System.map "/boot" ln: creating symbolic link `/tmp/initramfs.FcknSS/usr/lib64/libfreeblpriv3.so': No such file or directory ln: creating symbolic link `/tmp/initramfs.FcknSS/usr/lib64/libfreeblpriv3.so': No such file or directory [root@becalmer linux-3.1.2]# uname -a

自定义了一个Property类用于读取应用上下文下面的所有properties文件

下面是定义的类,此类在windows下面运行很正常,但是在linux下面运行不正常,不知道是什么原因,有木有大神指教一下: package com.cdsf.basicmanage.redirect.util; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Properties; import java.util.concurrent.ConcurrentHashMap; public final class Property extends Properties { private static final long serialVersionUID = 1L; private static String baseURL = Property.class.getResource("/").getPath(); private final static class PropertyInstanceHandler { private final static Property properties = new Property(); } private static final String CLASS_PATH_NAME = "classes"; private static ConcurrentHashMap<String, String> concurrentHashMap = new ConcurrentHashMap<>(); private Property() { initIndex(baseURL.substring(1, baseURL.lastIndexOf(CLASS_PATH_NAME))); } public static Property getProperties() { return PropertyInstanceHandler.properties; } private void initIndex(String path) { File file = new File(path); if(!file.isFile()) { String[] files = file.list(); for (String dir : files) { if(dir.equals(CLASS_PATH_NAME)) continue; initIndex(path + File.separator + dir); } }else { String fullFileName = file.getName(); if(fullFileName.contains(".")) { if(fullFileName.substring(fullFileName.lastIndexOf("."),fullFileName.length()).equals(".properties")) { concurrentHashMap.put(fullFileName.substring(0,fullFileName.lastIndexOf(".")), file.getAbsolutePath()); concurrentHashMap.keys(); } } } } @Override public String getProperty(String key,String filename) { try { if(!concurrentHashMap.containsKey(filename)) { return ""; } load(new FileInputStream(new File(concurrentHashMap.get(filename)))); } catch (FileNotFoundException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } return super.getProperty(key); } } 这个类在服务器会报如下的错误: [2017-07-28 10:39:31][localhost-startStop-1][org.springframework.web.context.ContextLoader] - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.cdsf.basicmanage.redirect.ESRedirectController#0' defined in file [/home/apache-tomcat-7.0.57/webapps/bms/WEB-INF/classes/com/cdsf/basicmanage/redirect/ESRedirectController.class]: Instantiation of bean failed; nested exception is org.springframework.cglib.core.CodeGenerationException: java.lang.ExceptionInInitializerError-->null at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1093) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1038) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:504) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:762) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757) ~[spring-context-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) ~[spring-context-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403) ~[spring-web-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) ~[spring-web-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) [spring-web-4.1.3.RELEASE.jar:4.1.3.RELEASE] at com.cdsf.webmvc.ssm.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:40) [webmvc-ssm-2.0.6-SNAPSHOT.jar:na] at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4994) [catalina.jar:7.0.57] at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492) [catalina.jar:7.0.57] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:7.0.57] at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901) [catalina.jar:7.0.57] at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877) [catalina.jar:7.0.57] at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:649) [catalina.jar:7.0.57] at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1245) [catalina.jar:7.0.57] at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1895) [catalina.jar:7.0.57] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_112] at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_112] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_112] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_112] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_112] Caused by: org.springframework.cglib.core.CodeGenerationException: java.lang.ExceptionInInitializerError-->null at org.springframework.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:235) ~[spring-core-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:220) ~[spring-core-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:216) ~[spring-core-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.cglib.proxy.Enhancer.createUsingReflection(Enhancer.java:643) ~[spring-core-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.cglib.proxy.Enhancer.firstInstance(Enhancer.java:538) ~[spring-core-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.cglib.core.AbstractClassGenerator.create(AbstractClassGenerator.java:225) ~[spring-core-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.cglib.proxy.Enhancer.createHelper(Enhancer.java:377) ~[spring-core-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.cglib.proxy.Enhancer.create(Enhancer.java:285) ~[spring-core-4.1.3.RELEASE.jar:4.1.3.RELEASE] at com.cdsf.webmvc.ssm.context.InternalInstantiationStrategy.instantiate(InternalInstantiationStrategy.java:39) ~[webmvc-ssm-2.0.6-SNAPSHOT.jar:na] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1086) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] ... 27 common frames omitted Caused by: java.lang.ExceptionInInitializerError: null at com.cdsf.basicmanage.redirect.util.Property.getProperties(Property.java:23) ~[Property.class:na] at com.cdsf.basicmanage.redirect.ESRedirectController.<init>(ESRedirectController.java:33) ~[ESRedirectController.class:na] at com.cdsf.basicmanage.redirect.ESRedirectController$$EnhancerByCGLIB$$a021635f.<init>(<generated>) ~[spring-core-4.1.3.RELEASE.jar:na] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_112] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_112] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_112] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_112] at org.springframework.cglib.core.ReflectUtils.newInstance(ReflectUtils.java:228) ~[spring-core-4.1.3.RELEASE.jar:4.1.3.RELEASE] ... 36 common frames omitted Caused by: java.lang.NullPointerException: null at com.cdsf.basicmanage.redirect.util.Property.initIndex(Property.java:30) ~[Property.class:na] at com.cdsf.basicmanage.redirect.util.Property.<init>(Property.java:19) ~[Property.class:na] at com.cdsf.basicmanage.redirect.util.Property.<init>(Property.java:18) ~[Property.class:na] at com.cdsf.basicmanage.redirect.util.Property$PropertyInstanceHandler.<clinit>(Property.java:13) ~[Property$PropertyInstanceHandler.class:na] ... 44 common frames omitted Jul 28, 2017 10:39:31 AM org.apache.catalina.core.StandardContext startInternal SEVERE: Error listenerStart

使用gem安装redis问题,各位大佬帮下忙看看

在使用rubygems的时,在网上下载了一个redis-4.0.2.gem文件,然后放到linux中执行,gem install redis-4.0.2.gem 报错,如下图 ![图片说明](https://img-ask.csdn.net/upload/201905/29/1559111634_102756.jpg) 求各位大佬帮忙,小弟初学者

当进入“浏览”时,phpMyAdmin通过执行COUNT(*)来挂起服务器

<div class="post-text" itemprop="text"> <p>I have a very large table (~115 million rows). When I click it in phpMyAdmin everything blows up. By doing a <code>SHOW PROCESSLIST;</code> I can see that it's because phpMyAdmin has tried to execute the following query:</p> <pre><code>SELECT COUNT(*) FROM `friend_map`.`connections` </code></pre> <p>Since this is an <code>innoDB</code> table this requires a table scan and the server errors out before returning.</p> <p>It gives the error:</p> <pre><code>Error in Processing Request Error code: 504 Error text: Gateway Timeout </code></pre> <p>I have to manually kill the mysql process or the entire database remains unresponsive.</p> <p>Is there a way to tell phpMyAdmin not to execute this query?</p> <p>Edit: I should probably also note that I'm in the middle of a server migration. This worked fine with phpMyAdmin 3.5.1 but now I've switched to new servers and this error is happening on phpMyAdmin 4.1.3.</p> </div>

Laravel 5.7 - 广播 - socket.io - redis:客户端什么也没发生

<div class="post-text" itemprop="text"> <p>Since few days I read about how to setup laravel-echo on my local machine. I manage to be able to run laravel-echo-server with redis and socket.io.</p> <p>The problem is that the event is fired, but nothing happen on the client side.</p> <p>I know that the event is fired, because it's log into my horizon.log file.</p> <pre><code>Horizon started successfully. [2018-08-29 18:35:30][31] Processing: App\Events\NewModel [2018-08-29 18:35:31][31] Processed: App\Events\NewModel </code></pre> <p>Then, into my echo.log file, I can see that the user is connected to the channel and echo trigger the event.</p> <pre><code>L A R A V E L E C H O S E R V E R version 1.3.9 ⚠ Starting server in DEV mode... ✔ Running at localhost on port 60010 ✔ Channels are ready. ✔ Listening for http events... ✔ Listening for redis events... Server ready! [6:35:15 PM] - QW3VITRzWPH4FvxPAAAB joined channel: channel-name Channel: presence-channel-name Event: App\Events\NewModel </code></pre> <p>It run on port 60010, because when I tried to do it on port 6001, the client is unable to connect.</p> <p>I'm using virtualbox/homestead on a windows 10 machine.</p> <p>There is the port forwarding into my Homestead.yaml</p> <pre><code>ports: - send: 60010 to: 6001 </code></pre> <p>So, I don't understand why client don't log the event. There is why my code at the moment</p> echo.js <pre><code>/** * Echo exposes an expressive API for subscribing to channels and listening * for events that are broadcast by Laravel. Echo and event broadcasting * allows your team to easily build robust real-time web applications. */ import Echo from "laravel-echo" window.io = require('socket.io-client'); // Have this in case you stop running your laravel echo server if (typeof io !== 'undefined') { window.Echo = new Echo({ broadcaster: 'socket.io', host: window.location.hostname + ':60010', }); console.log('Connected to socket.io'); } else { console.log('Not connected to socket.io'); } window.Echo.channel('channel-name') .listen('NewModel', (e) =&gt; { console.log('1:'); console.log(e); }) .listen('App\Events\NewModel', (e) =&gt; { console.log('2:'); console.log(e); }) .listen('App.Events.NewModel', (e) =&gt; { console.log('3:'); console.log(e); }); </code></pre> laravel-echo-server.json <pre><code>{ "authHost": "https://app.torque.homestead", "authEndpoint": "/broadcasting/auth", "clients": [{ "appId": "appId", "key": "key" }], "database": "redis", "databaseConfig": { "redis": { "port": "6379", "host": "127.0.0.1" }, "sqlite": { "databasePath": "/database/laravel-echo-server.sqlite" } }, "devMode": true, "host": "", "port": "60010", "protocol": "https", "socketio": {}, "sslCertPath": "app.torque.homestead.crt", "sslKeyPath": "app.torque.homestead.key", "sslCertChainPath": "", "sslPassphrase": "", "apiOriginAllow": { "allowCors": false, "allowOrigin": "", "allowMethods": "", "allowHeaders": "" } } </code></pre> channels.php <pre><code>&lt;?php /* |-------------------------------------------------------------------------- | Broadcast Channels |-------------------------------------------------------------------------- | | Here you may register all of the event broadcasting channels that your | application supports. The given channel authorization callbacks are | used to check if an authenticated user can listen to the channel. | */ Broadcast::channel('App.User.{id}', function ($user, $id) { return (int) $user-&gt;id === (int) $id; }); Broadcast::channel('channel-name', function () { return true; }); </code></pre> <p>If you want to see another file, let me know. Actually I don't know what could be needed to fix the issue.</p> <p>I think the problem may come from the forwarding port... But like I said, using 6001 is not working.</p> <p>I tried many things like changing port(maybe not the right combination like client on 60010 and server on 6001????)</p> <p>I also change that line into echo.js many times</p> <pre><code>host: window.location.hostname + ':60010', </code></pre> <p>There is some version of what i'm using :</p> <pre><code>vagrant@homestead:~$ node -v v10.8.0 vagrant@homestead:~$ npm -v 6.4.0 vagrant@homestead:~$ php -v PHP 7.2.9-1+ubuntu18.04.1+deb.sury.org+1 (cli) (built: Aug 19 2018 07:16:54) ( NTS ) </code></pre> <p>packages.json</p> <pre><code>{ "private": true, "scripts": { "dev": "npm run development", "development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js", "watch": "npm run development -- --watch", "watch-poll": "npm run watch -- --watch-poll", "hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js", "prod": "npm run production", "production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js" }, "devDependencies": { "axios": "^0.18", "babel-preset-react": "^6.24.1", "bootstrap": "^4.1.3", "cross-env": "^5.2.0", "jquery": "^3.2", "laravel-mix": "^2.1.14", "lodash": "^4.17.4", "popper.js": "^1.14.4", "vue": "^2.5.17" }, "dependencies": { "@fortawesome/fontawesome": "^1.1.8", "@fortawesome/fontawesome-free-brands": "^5.0.13", "@fortawesome/fontawesome-free-regular": "^5.0.13", "@fortawesome/fontawesome-free-solid": "^5.0.13", "@fortawesome/fontawesome-free-webfonts": "^1.0.9", "@fortawesome/vue-fontawesome": "0.0.22", "ajv": "^6.5.3", "bootstrap-confirmation2": "^4.0.1", "datatables.net": "^1.10.19", "datatables.net-bs4": "^1.10.19", "datatables.net-buttons": "^1.5.3", "datatables.net-buttons-bs4": "^1.5.3", "express": "^4.16.3", "ioredis": "^4.0.0", "laravel-echo": "^1.4.0", "laravel-echo-server": "^1.3.9", "socket.io": "^2.1.1", "socket.io-client": "^2.1.1", "vee-validate": "^2.0.9", "vue-inject": "^2.1.1", "yarn": "^1.9.4" } } </code></pre> <p>composer.json</p> <pre><code>{ "name": "laravel/laravel", "description": "The Laravel Framework.", "keywords": ["framework", "laravel"], "license": "MIT", "type": "project", "require": { "php": "^7.1.3", "aloha/twilio": "^4.0", "eyewitness/eye": "dev-beta", "fideloper/proxy": "^4.0", "guzzlehttp/guzzle": "^6.3", "laravel/framework": "5.7.*", "laravel/horizon": "^1.3", "laravel/passport": "^6.0", "laravel/tinker": "^1.0", "predis/predis": "^1.1" }, "require-dev": { "filp/whoops": "^2.0", "fzaninotto/faker": "^1.4", "mockery/mockery": "^1.0", "nunomaduro/collision": "^2.0", "phpunit/phpunit": "^7.0" }, "autoload": { "classmap": [ "database/seeds", "database/factories" ], "psr-4": { "App\\": "app/" } }, "autoload-dev": { "psr-4": { "Tests\\": "tests/" } }, "extra": { "laravel": { "dont-discover": [ ] } }, "scripts": { "post-root-package-install": [ "@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" ], "post-create-project-cmd": [ "@php artisan key:generate" ], "post-autoload-dump": [ "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump", "@php artisan package:discover" ] }, "config": { "preferred-install": "dist", "sort-packages": true, "optimize-autoloader": true }, "minimum-stability": "dev", "prefer-stable": true } </code></pre> <h2>Thank you for helping me!</h2> <h2>--EDIT--</h2> <p>After mcklayin suggest me, I look for redis data. So I run this :</p> <pre><code>vagrant@homestead:/var/lib$ redis-cli --scan presence-channel-name:members horizon:1 horizon:34 horizon:supervisors horizon:measured_jobs horizon:9 horizon:monitor:time-to-clear horizon:job:App\Jobs\ProcessModels horizon:35 horizon:queue:default horizon:job_id horizon:job:App\Events\NewModel horizon:masters horizon:last_snapshot_at horizon:33 horizon:master:homestead-xVse horizon:failed_jobs horizon:32 horizon:supervisor:homestead-xVse:supervisor-1 horizon:recent_jobs horizon:measured_queues </code></pre> <h2>--EDIT 2--</h2> <p>There is the App\Events\NewModel.php file</p> <pre><code>&lt;?php namespace App\Events; use Illuminate\Broadcasting\Channel; use Illuminate\Queue\SerializesModels; use Illuminate\Broadcasting\PrivateChannel; use Illuminate\Broadcasting\PresenceChannel; use Illuminate\Foundation\Events\Dispatchable; use Illuminate\Broadcasting\InteractsWithSockets; use Illuminate\Contracts\Broadcasting\ShouldBroadcast; class NewModel implements ShouldBroadcast { use Dispatchable, InteractsWithSockets, SerializesModels; public $data; /** * Create a new event instance. * * @return void */ public function __construct($data) { $this-&gt;data = $data; } /** * Get the channels the event should broadcast on. * * @return \Illuminate\Broadcasting\Channel|array */ public function broadcastOn() { return new PrivateChannel('channel-name'); } public function broadcastAs() { return 'NewModel'; } } </code></pre> </div>

spring实现session共享报错 求大神指教

抛出异常: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisTemplate' defined in class path resource [spring.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: or org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) ~[spring-web-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) [spring-web-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4994) [catalina.jar:7.0.57] at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492) [catalina.jar:7.0.57] at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) [catalina.jar:7.0.57] at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575) [catalina.jar:7.0.57] at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565) [catalina.jar:7.0.57] at java.util.concurrent.FutureTask.run(Unknown Source) [na:1.8.0_101] at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_101] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_101] at java.lang.Thread.run(Unknown Source) [na:1.8.0_101] Caused by: java.lang.NoSuchMethodError: org.springframework.core.serializer.support.DeserializingConverter.<init>(Ljava/lang/ClassLoader;)V at org.springframework.data.redis.serializer.JdkSerializationRedisSerializer.<init>(JdkSerializationRedisSerializer.java:53) ~[spring-data-redis-1.7.3.RELEASE.jar:na] at org.springframework.data.redis.core.RedisTemplate.afterPropertiesSet(RedisTemplate.java:119) ~[spring-data-redis-1.7.3.RELEASE.jar:na] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1625) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1562) ~[spring-beans-4.1.3.RELEASE.jar:4.1.3.RELEASE] ... 21 common frames omitted 四月 11, 2017 4:06:28 下午 org.apache.catalina.core.StandardContext listenerStart 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisTemplate' defined in class path resource [spring.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.springframework.core.serializer.support.DeserializingConverter.<init>(Ljava/lang/ClassLoader;)V at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1566) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:539) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:476) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:302) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:298) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:762) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:757) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:480) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:403) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:306) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:106) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4994) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575) at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.NoSuchMethodError: org.springframework.core.serializer.support.DeserializingConverter.<init>(Ljava/lang/ClassLoader;)V at org.springframework.data.redis.serializer.JdkSerializationRedisSerializer.<init>(JdkSerializationRedisSerializer.java:53) at org.springframework.data.redis.core.RedisTemplate.afterPropertiesSet(RedisTemplate.java:119) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1625) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1562) ... 21 more

kindeditor编辑器里粘excel表格里的数据,边框不见啦!

kindeditor编辑器里粘excel表格里的数据,边框不见啦!有的是样式也变啦!这个如何解决,大家给看看,谢谢!

Hadoop2.4.0环境下HBase-0.9.60-hadoo2版本冲突问题

我的Hadoop环境是Hadoop2.4.0,HBase是HBase-0.9.60-hadoo2,今天使用HBase API编写了一个程序,运行的时候曝下面的错误: 2014-09-01 18:16:00,247 WARN [main] util.NativeCodeLoader (NativeCodeLoader.java:<clinit>(62)) - Unable to load native-hadoop library for your platform... using builtin-java classes where applicable 2014-09-01 18:16:00,283 ERROR [main] util.Shell (Shell.java:getWinUtilsPath(303)) - Failed to locate the winutils binary in the hadoop binary path java.io.IOException: Could not locate executable null\bin\winutils.exe in the Hadoop binaries. at org.apache.hadoop.util.Shell.getQualifiedBinPath(Shell.java:278) at org.apache.hadoop.util.Shell.getWinUtilsPath(Shell.java:300) at org.apache.hadoop.util.Shell.<clinit>(Shell.java:293) at org.apache.hadoop.util.StringUtils.<clinit>(StringUtils.java:76) at org.apache.hadoop.conf.Configuration.getStrings(Configuration.java:1514) at org.apache.hadoop.hbase.zookeeper.ZKConfig.makeZKProps(ZKConfig.java:113) at org.apache.hadoop.hbase.zookeeper.ZKConfig.getZKQuorumServersString(ZKConfig.java:265) at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.<init>(ZooKeeperWatcher.java:159) at org.apache.hadoop.hbase.zookeeper.ZooKeeperWatcher.<init>(ZooKeeperWatcher.java:134) at org.apache.hadoop.hbase.client.ZooKeeperKeepAliveConnection.<init>(ZooKeeperKeepAliveConnection.java:43) at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.getKeepAliveZooKeeperWatcher(HConnectionManager.java:1710) at org.apache.hadoop.hbase.client.ZooKeeperRegistry.getClusterId(ZooKeeperRegistry.java:82) at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.retrieveClusterId(HConnectionManager.java:806) at org.apache.hadoop.hbase.client.HConnectionManager$HConnectionImplementation.<init>(HConnectionManager.java:633) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:526) at org.apache.hadoop.hbase.client.HConnectionManager.createConnection(HConnectionManager.java:387) at org.apache.hadoop.hbase.client.HConnectionManager.createConnection(HConnectionManager.java:366) at org.apache.hadoop.hbase.client.HConnectionManager.getConnection(HConnectionManager.java:247) at org.apache.hadoop.hbase.client.HBaseAdmin.<init>(HBaseAdmin.java:183) at cn.haha.HBase.HBaseApp1.main(HBaseApp1.java:26) 2014-09-01 18:16:00,297 INFO [main] zookeeper.ZooKeeper (Environment.java:logEnv(100)) - Client environment:zookeeper.version=3.4.5-1392090, built on 09/30/2012 17:52 GMT 2014-09-01 18:16:00,297 INFO [main] zookeeper.ZooKeeper (Environment.java:logEnv(100)) - Client environment:host.name=Admin-PC 2014-09-01 18:16:00,297 INFO [main] zookeeper.ZooKeeper (Environment.java:logEnv(100)) - Client environment:java.version=1.7.0_65 2014-09-01 18:16:00,297 INFO [main] zookeeper.ZooKeeper (Environment.java:logEnv(100)) - Client environment:java.vendor=Oracle Corporation 2014-09-01 18:16:00,297 INFO [main] zookeeper.ZooKeeper (Environment.java:logEnv(100)) - Client environment:java.home=C:\workDir\jdk7u65\jre 2014-09-01 18:16:00,297 INFO [main] zookeeper.ZooKeeper (Environment.java:logEnv(100)) - Client environment:java.class.path=E:\workDir\workspace_eclipse\HBase-0.96\bin;E:\workDir\workspace_eclipse\HBase-0.96\lib\activation-1.1.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\aopalliance-1.0.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\asm-3.1.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\avro-1.7.4.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\commons-beanutils-1.7.0.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\commons-beanutils-core-1.8.0.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\commons-cli-1.2.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\commons-codec-1.7.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\commons-collections-3.2.1.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\commons-compress-1.4.1.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\commons-configuration-1.6.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\commons-daemon-1.0.13.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\commons-digester-1.8.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\commons-el-1.0.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\commons-httpclient-3.1.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\commons-io-2.4.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\commons-lang-2.6.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\commons-logging-1.1.1.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\commons-math-2.1.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\commons-net-3.1.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\findbugs-annotations-1.3.9-1.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\gmbal-api-only-3.0.0-b023.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\grizzly-framework-2.1.2.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\grizzly-http-2.1.2.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\grizzly-http-server-2.1.2.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\grizzly-http-servlet-2.1.2.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\grizzly-rcm-2.1.2.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\guava-12.0.1.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\guice-3.0.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\guice-servlet-3.0.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hadoop-annotations-2.2.0.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hadoop-auth-2.2.0.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hadoop-client-2.2.0.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hadoop-common-2.2.0.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hadoop-hdfs-2.2.0-tests.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hadoop-hdfs-2.2.0.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hadoop-mapreduce-client-app-2.2.0.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hadoop-mapreduce-client-common-2.2.0.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hadoop-mapreduce-client-core-2.2.0.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hadoop-mapreduce-client-jobclient-2.2.0-tests.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hadoop-mapreduce-client-jobclient-2.2.0.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hadoop-mapreduce-client-shuffle-2.2.0.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hadoop-yarn-api-2.2.0.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hadoop-yarn-client-2.2.0.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hadoop-yarn-common-2.2.0.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hadoop-yarn-server-common-2.2.0.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hadoop-yarn-server-nodemanager-2.2.0.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hamcrest-core-1.3.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hbase-client-0.96.2-hadoop2.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hbase-common-0.96.2-hadoop2-tests.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hbase-common-0.96.2-hadoop2.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hbase-examples-0.96.2-hadoop2.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hbase-hadoop-compat-0.96.2-hadoop2.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hbase-hadoop2-compat-0.96.2-hadoop2.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hbase-it-0.96.2-hadoop2-tests.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hbase-it-0.96.2-hadoop2.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hbase-prefix-tree-0.96.2-hadoop2.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hbase-protocol-0.96.2-hadoop2.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hbase-server-0.96.2-hadoop2-tests.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hbase-server-0.96.2-hadoop2.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hbase-shell-0.96.2-hadoop2.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hbase-testing-util-0.96.2-hadoop2.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\hbase-thrift-0.96.2-hadoop2.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\htrace-core-2.04.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\httpclient-4.1.3.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\httpcore-4.1.3.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jackson-core-asl-1.8.8.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jackson-jaxrs-1.8.8.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jackson-mapper-asl-1.8.8.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jackson-xc-1.8.8.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jamon-runtime-2.3.1.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jasper-compiler-5.5.23.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jasper-runtime-5.5.23.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\javax.inject-1.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\javax.servlet-3.1.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\javax.servlet-api-3.0.1.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jaxb-api-2.2.2.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jaxb-impl-2.2.3-1.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jersey-client-1.9.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jersey-core-1.8.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jersey-grizzly2-1.9.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jersey-guice-1.9.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jersey-json-1.8.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jersey-server-1.8.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jersey-test-framework-core-1.9.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jersey-test-framework-grizzly2-1.9.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jets3t-0.6.1.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jettison-1.3.1.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jetty-6.1.26.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jetty-sslengine-6.1.26.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jetty-util-6.1.26.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jruby-complete-1.6.8.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jsch-0.1.42.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jsp-2.1-6.1.14.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jsp-api-2.1-6.1.14.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\jsr305-1.3.9.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\junit-4.11.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\libthrift-0.9.0.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\log4j-1.2.17.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\management-api-3.0.0-b012.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\metrics-core-2.1.2.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\netty-3.6.6.Final.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\paranamer-2.3.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\protobuf-java-2.5.0.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\servlet-api-2.5-6.1.14.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\slf4j-api-1.6.4.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\slf4j-log4j12-1.6.4.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\snappy-java-1.0.4.1.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\xmlenc-0.52.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\xz-1.0.jar;E:\workDir\workspace_eclipse\HBase-0.96\lib\zookeeper-3.4.5.jar 2014-09-01 18:16:00,297 INFO [main] zookeeper.ZooKeeper (Environment.java:logEnv(100)) - Client environment:java.library.path=C:\workDir\jdk7u65\bin;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;C:/workDir/jdk7u65/bin/../jre/bin/client;C:/workDir/jdk7u65/bin/../jre/bin;C:/workDir/jdk7u65/bin/../jre/lib/i386;C:\Program Files (x86)\Common Files\NetSarang;C:\workDir\jdk7u65\bin;E:\workDir\apache-tomcat-7.0.55;E:\workDir\apache-tomcat-7.0.55;%CATALINA_HOME%\common\lib\common\lib\bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Lenovo\Fingerprint Manager Pro\;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x86;C:\Program Files (x86)\Intel\OpenCL SDK\3.0\bin\x64;C:\Program Files (x86)\IDM Computer Solutions\UltraEdit\;E:\workDir\eclipse-indigo-3.7.2;;. 2014-09-01 18:16:00,297 INFO [main] zookeeper.ZooKeeper (Environment.java:logEnv(100)) - Client environment:java.io.tmpdir=C:\Users\ADMINI~1\AppData\Local\Temp\ 2014-09-01 18:16:00,298 INFO [main] zookeeper.ZooKeeper (Environment.java:logEnv(100)) - Client environment:java.compiler=<NA> 2014-09-01 18:16:00,298 INFO [main] zookeeper.ZooKeeper (Environment.java:logEnv(100)) - Client environment:os.name=Windows 7 2014-09-01 18:16:00,298 INFO [main] zookeeper.ZooKeeper (Environment.java:logEnv(100)) - Client environment:os.arch=x86 2014-09-01 18:16:00,298 INFO [main] zookeeper.ZooKeeper (Environment.java:logEnv(100)) - Client environment:os.version=6.1 2014-09-01 18:16:00,298 INFO [main] zookeeper.ZooKeeper (Environment.java:logEnv(100)) - Client environment:user.name=Administrator 2014-09-01 18:16:00,298 INFO [main] zookeeper.ZooKeeper (Environment.java:logEnv(100)) - Client environment:user.home=C:\Users\Administrator 2014-09-01 18:16:00,298 INFO [main] zookeeper.ZooKeeper (Environment.java:logEnv(100)) - Client environment:user.dir=E:\workDir\workspace_eclipse\HBase-0.96 2014-09-01 18:16:00,299 INFO [main] zookeeper.ZooKeeper (ZooKeeper.java:<init>(438)) - Initiating client connection, connectString=hadoop2.slave01:2181,hadoop2.master:2181,hadoop2.slave02:2181 sessionTimeout=90000 watcher=hconnection-0xde1f90, quorum=hadoop2.slave01:2181,hadoop2.master:2181,hadoop2.slave02:2181, baseZNode=/hbase 2014-09-01 18:16:00,326 INFO [main] zookeeper.RecoverableZooKeeper (RecoverableZooKeeper.java:<init>(120)) - Process identifier=hconnection-0xde1f90 connecting to ZooKeeper ensemble=hadoop2.slave01:2181,hadoop2.master:2181,hadoop2.slave02:2181 2014-09-01 18:16:00,328 INFO [main-SendThread(hadoop2.slave01:2181)] zookeeper.ClientCnxn (ClientCnxn.java:logStartConnect(966)) - Opening socket connection to server hadoop2.slave01/192.168.100.51:2181. Will not attempt to authenticate using SASL (unknown error) 2014-09-01 18:16:00,329 INFO [main-SendThread(hadoop2.slave01:2181)] zookeeper.ClientCnxn (ClientCnxn.java:primeConnection(849)) - Socket connection established to hadoop2.slave01/192.168.100.51:2181, initiating session 2014-09-01 18:16:00,335 INFO [main-SendThread(hadoop2.slave01:2181)] zookeeper.ClientCnxn (ClientCnxn.java:onConnected(1207)) - Session establishment complete on server hadoop2.slave01/192.168.100.51:2181, sessionid = 0x1482f4c45e2001c, negotiated timeout = 40000 2014-09-01 18:16:00,472 INFO [main] zookeeper.ZooKeeper (ZooKeeper.java:<init>(438)) - Initiating client connection, connectString=hadoop2.slave01:2181,hadoop2.master:2181,hadoop2.slave02:2181 sessionTimeout=90000 watcher=catalogtracker-on-hconnection-0xde1f90, quorum=hadoop2.slave01:2181,hadoop2.master:2181,hadoop2.slave02:2181, baseZNode=/hbase 2014-09-01 18:16:00,473 INFO [main] zookeeper.RecoverableZooKeeper (RecoverableZooKeeper.java:<init>(120)) - Process identifier=catalogtracker-on-hconnection-0xde1f90 connecting to ZooKeeper ensemble=hadoop2.slave01:2181,hadoop2.master:2181,hadoop2.slave02:2181 2014-09-01 18:16:00,474 INFO [main-SendThread(hadoop2.slave01:2181)] zookeeper.ClientCnxn (ClientCnxn.java:logStartConnect(966)) - Opening socket connection to server hadoop2.slave01/192.168.100.51:2181. Will not attempt to authenticate using SASL (unknown error) 2014-09-01 18:16:00,474 INFO [main-SendThread(hadoop2.slave01:2181)] zookeeper.ClientCnxn (ClientCnxn.java:primeConnection(849)) - Socket connection established to hadoop2.slave01/192.168.100.51:2181, initiating session 2014-09-01 18:16:00,478 INFO [main-SendThread(hadoop2.slave01:2181)] zookeeper.ClientCnxn (ClientCnxn.java:onConnected(1207)) - Session establishment complete on server hadoop2.slave01/192.168.100.51:2181, sessionid = 0x1482f4c45e2001d, negotiated timeout = 40000 2014-09-01 18:16:00,499 INFO [main] Configuration.deprecation (Configuration.java:warnOnceIfDeprecated(840)) - hadoop.native.lib is deprecated. Instead, use io.native.lib.available 2014-09-01 18:16:00,817 INFO [main] zookeeper.ZooKeeper (ZooKeeper.java:close(684)) - Session: 0x1482f4c45e2001d closed 2014-09-01 18:16:00,817 INFO [main-EventThread] zookeeper.ClientCnxn (ClientCnxn.java:run(509)) - EventThread shut down 2014-09-01 18:16:01,288 INFO [main] zookeeper.ZooKeeper (ZooKeeper.java:<init>(438)) - Initiating client connection, connectString=hadoop2.slave01:2181,hadoop2.master:2181,hadoop2.slave02:2181 sessionTimeout=90000 watcher=catalogtracker-on-hconnection-0xde1f90, quorum=hadoop2.slave01:2181,hadoop2.master:2181,hadoop2.slave02:2181, baseZNode=/hbase 2014-09-01 18:16:01,290 INFO [main] zookeeper.RecoverableZooKeeper (RecoverableZooKeeper.java:<init>(120)) - Process identifier=catalogtracker-on-hconnection-0xde1f90 connecting to ZooKeeper ensemble=hadoop2.slave01:2181,hadoop2.master:2181,hadoop2.slave02:2181 2014-09-01 18:16:01,290 INFO [main-SendThread(hadoop2.slave01:2181)] zookeeper.ClientCnxn (ClientCnxn.java:logStartConnect(966)) - Opening socket connection to server hadoop2.slave01/192.168.100.51:2181. Will not attempt to authenticate using SASL (unknown error) 2014-09-01 18:16:01,291 INFO [main-SendThread(hadoop2.slave01:2181)] zookeeper.ClientCnxn (ClientCnxn.java:primeConnection(849)) - Socket connection established to hadoop2.slave01/192.168.100.51:2181, initiating session 2014-09-01 18:16:01,294 INFO [main-SendThread(hadoop2.slave01:2181)] zookeeper.ClientCnxn (ClientCnxn.java:onConnected(1207)) - Session establishment complete on server hadoop2.slave01/192.168.100.51:2181, sessionid = 0x1482f4c45e2001e, negotiated timeout = 40000 2014-09-01 18:16:01,304 INFO [main] zookeeper.ZooKeeper (ZooKeeper.java:close(684)) - Session: 0x1482f4c45e2001e closed 2014-09-01 18:16:01,304 INFO [main-EventThread] zookeeper.ClientCnxn (ClientCnxn.java:run(509)) - EventThread shut down

spring mvc项目,请求一直报404错误

# 1.web.xml配置 <!-- 从类路径下加载spring配置文件,classpath关键字特指从类路径下加载 --> <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath:applicationContext.xml </param-value> </context-param> <!-- 配置web容器监听器,该监听器启动时自动运行,他会根据上面的spring配置文件里面的参数启动spring容器 --> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <servlet> <servlet-name>spring</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value> classpath:applicationContext.xml </param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>spring</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> # 2.applicationContext.xml配置 <!-- 使用annotation 自动注册bean, 并保证@Required、@Autowired的属性被注入 --> <context:component-scan base-package="com.cn.zjf.dom" /> <!-- 扫描serviec包 --> <context:component-scan base-package="com.cn.zif.service"/> <!-- 扫描web包 --> <context:component-scan base-package="com.cn.zif.web"/> <bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" > <property name="order" value="0" /> </bean> <bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/> <!-- DBCP开源数据源实现方式定义了一个数据源,里面包含数据源信息 --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="com.mysql.jdbc.Driver"/> <property name="url" value="jdbc:mysql://localhost:3306/app_server"/> <property name="username" value="root"/> <property name="password" value="zjf"/> </bean> <!-- 将配置的数据源注入到jdbcTemplate,这样我就得jdbc样板就知道连接哪一个数据源 --> <!-- 此处的这个jdbc连接样板会通过@Autowired自动注入到Dao的bean中 --> <!-- spring可以将注解和xml很好的关联在一起 --> <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate" p:dataSource-ref="dataSource" /> <!--定义一个基于数据源的事务管理器,该管理器负责声明事务的管理 --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager" p:dataSource-ref="dataSource"/> <!-- 通过aop和以及tx命名空间的语法,以aop方式为service包下的所有类的所有方法进行事务增强 --> <bean id="defaulViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/> <property name="prefix" value="/webpage"/> <property name="suffix" value=".jsp"/> </bean> # 3.控制器代码 package com.cn.zjf.web; import javax.servlet.http.HttpServletRequest; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpRequest; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.servlet.ModelAndView; import com.cn.zjf.domain.Log; import com.cn.zjf.domain.User; import com.cn.zjf.service.UserService; @Controller @RequestMapping(value="/con") public class LoginController { @Autowired private UserService userService; @RequestMapping(value = "/login.do") public String loginPage(){ return "login"; } @RequestMapping(value = "/loginCheck.html") public ModelAndView loginCheck(HttpServletRequest request,LoginCommand loginCommand){ boolean flag = userService.checkUser(loginCommand.getUserName(), loginCommand.getPassword()); if(!flag){ return new ModelAndView("login","error","用户名或密码错误"); }else{ User user = userService.selectUser(loginCommand.getUserName()); String ip = request.getRemoteAddr(); userService.loginLog(user,ip); request.getSession().setAttribute("user", user); return new ModelAndView(); } } } # 4 访问路径 http://localhost:8089/chapter/con/login.do chapter为项目名称 哪位大侠帮忙看一下,是哪里配置错误吗

连接到外部smtp服务器

<div class="post-text" itemprop="text"> <p>I'm trying to connect to my cpanel smtp server from localhost. I can make connection with it by fopensocket on port 25,but after that which command should I put to the server?</p> <p>I read <a href="http://www.daniweb.com/web-development/php/threads/105510" rel="nofollow">here</a> and try to do same as it,but my server return <strong>unrecognized command</strong>.</p> <p>code:</p> <pre><code>function authgMail($from, $namefrom, $to, $nameto, $subject, $message) { $smtpServer = "mail.printf.ir"; $port = "25"; $timeout = "45"; $username = "info@printf.ir"; $password = "******"; $localhost = $_SERVER['REMOTE_ADDR']; $newLine = " "; //var just for newlines //connect to the host and port $smtpConnect = fsockopen($smtpServer, $port, $errno, $errstr, $timeout); //echo $errstr." - ".$errno; $smtpResponse = fgets($smtpConnect, 4096); if(empty($smtpConnect)) { $output = "Failed to connect: $smtpResponse"; //echo $output; return $output; } else { $logArray['connection'] = "Connected to: $smtpResponse"; } //you have to say HELO again after TLS is started fputs($smtpConnect, "HELO $localhost". $newLine); $smtpResponse = fgets($smtpConnect, 4096); $logArray['heloresponse2'] = "$smtpResponse"; //request for auth login fputs($smtpConnect,"AUTH LOGIN" . $newLine); $smtpResponse = fgets($smtpConnect, 4096); $logArray['authrequest'] = "$smtpResponse"; //send the username fputs($smtpConnect, base64_encode($username) . $newLine); $smtpResponse = fgets($smtpConnect, 4096); $logArray['authusername'] = "$smtpResponse"; //send the password fputs($smtpConnect, base64_encode($password) . $newLine); $smtpResponse = fgets($smtpConnect, 4096); $logArray['authpassword'] = "$smtpResponse"; //email from fputs($smtpConnect, "MAIL FROM: " . $newLine); $smtpResponse = fgets($smtpConnect, 4096); $logArray['mailfromresponse'] = "$smtpResponse"; //email to fputs($smtpConnect, "RCPT TO: " . $newLine); $smtpResponse = fgets($smtpConnect, 4096); $logArray['mailtoresponse'] = "$smtpResponse"; //the email fputs($smtpConnect, "DATA" . $newLine); $smtpResponse = fgets($smtpConnect, 4096); $logArray['data1response'] = "$smtpResponse"; //construct headers $headers = "MIME-Version: 1.0" . $newLine; $headers .= "Content-type: text/html; charset=iso-8859-1" . $newLine; $headers .= "To: $nameto $to" . $newLine; $headers .= "From: $namefrom " . $newLine; //observe the . after the newline, it signals the end of message fputs($smtpConnect, "To: From: $from Subject: $subject $headers $message . "); $smtpResponse = fgets($smtpConnect, 4096); $logArray['data2response'] = "$smtpResponse"; // say goodbye fputs($smtpConnect,"QUIT" . $newLine); $smtpResponse = fgets($smtpConnect, 4096); $logArray['quitresponse'] = "$smtpResponse"; $logArray['quitcode'] = substr($smtpResponse,0,3); fclose($smtpConnect); //a return value of 221 in $retVal["quitcode"] is a success $a='Mail Sent Sucessfully'; print_r($logArray); return($a); } echo (authgMail("info@printf.ir", "Moein", "moein_7line@yahoo.com", "Akbar Agha", "Test ", "Test")); </code></pre> <p>what has been echo:</p> <pre><code> Array ( [connection] =&gt; Connected to: 220-linux10.avaserver.com ESMTP Exim 4.69 #1 Sat, 10 Sep 2011 15:08:40 +0430 [heloresponse2] =&gt; 220-We do not authorize the use of this system to transport unsolicited, [authrequest] =&gt; 220 and/or bulk e-mail. [authusername] =&gt; 250 linux10.avaserver.com Hello 127.0.0.1 [79.127.22.89] [authpassword] =&gt; 503 AUTH command used when not advertised [mailfromresponse] =&gt; 500 unrecognized command [mailtoresponse] =&gt; 500 unrecognized command [data1response] =&gt; 550 Access denied - Invalid HELO name (See RFC2821 4.1.3) [data2response] =&gt; [quitresponse] =&gt; [quitcode] =&gt; ) Mail Sent Sucessfully </code></pre> </div>

Maven构建SSH项目添加依赖支持报错

我在使用Maven搭建SS2H项目的时候,使用了 <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>4.1.3.RELEASE</version> </dependency> 之后web.xml的 <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> 就会报错,是找不到,去掉了就可以但是在项目启动的时候就会报错,加了之后会有报错说Error:java: java.lang.ArrayIndexOutOfBoundsException: 60533

求上传文件中nosuchmethoderror(androidsdk与httpclientjar冲突)解决办法

android项目使用阿里云上传文件的Sample文件代码,出现了nosuchmethoderror,然后我顺着日志查到android sdk中在org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager这个类里只有一个构造方法,而代码依赖的httpclient是4.1.3版本,相同的类里有4个构造方法,我认为问题可能出在这里,查遍了资料没找到方法,求大神请教解决办法??(我试过了更换低版本httpclient.jar和直接删除都没有用) 详细错误日志如下: java.lang.NoSuchMethodError: org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager.<init> at com.aliyun.common.comm.HttpFactory.createThreadSafeClientConnManager(HttpFactory.java:104) at com.aliyun.common.comm.HttpFactory.createHttpClient(HttpFactory.java:65) at com.aliyun.common.comm.DefaultServiceClient.<init>(DefaultServiceClient.java:39) at com.aliyun.openservices.oss.OSSClient.<init>(OSSClient.java:137) at com.aliyun.openservices.oss.OSSClient.<init>(OSSClient.java:94) at com.archers.sweet.utils.OSSObjectSample$1.run(OSSObjectSample.java:77)

KindEditor4.1.11行间距怎么设置

怎么设置上下行间距![图片说明](https://img-ask.csdn.net/upload/201708/03/1501765641_283316.jpg)

富文本框编辑器实现:a、支持图片复制粘贴;b、支持word复制粘贴图文。

1、富文本框编辑器实现:a、支持图片复制粘贴;b、支持word复制粘贴图文。 2、能实现“只知道文件路径如"c://dir/xx.png",能用js上传文件到服务器去的“ 也可以说一下怎样实现。 3、不限浏览器,但不要安装插件,如何实现,最好给个demo。

WP Bootstrap Navwalker移动菜单不起作用

<div class="post-text" itemprop="text"> <p>I am using the WP bootstrap navwalker for my wordpress site. The desktop version of the menu is working properly but there's some problem with the hamburger menu. The hamburger menu is showing up but the collapse thing is not working. Here's my Navwalker Menu: </p> <pre><code> &lt;nav class="navbar navbar-expand-lg navbar-light bg-color"&gt; &lt;button class="navbar-toggler ml-auto" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"&gt; &lt;span&gt; &lt;i class="fas fa-bars"&gt;&lt;/i&gt; &lt;/span&gt; &lt;/button&gt; &lt;div class="collapse navbar-collapse" id="navbarSupportedContent"&gt; &lt;ul class="navbar-nav mx-auto"&gt; &lt;?php wp_nav_menu( array( 'theme_location' =&gt; 'primary', 'depth' =&gt; 2, // 1 = no dropdowns, 2 = with dropdowns. 'container' =&gt; 'div', 'container_class' =&gt; 'collapse navbar-collapse', 'container_id' =&gt; 'bs-example-navbar-collapse-1', 'menu_class' =&gt; 'navbar-nav mr-auto', 'fallback_cb' =&gt; 'WP_Bootstrap_Navwalker::fallback', 'walker' =&gt; new WP_Bootstrap_Navwalker(), ) ); ?&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/nav&gt; </code></pre> <p>and here's my enqueued scripts:</p> <pre><code>//Register WP NAVWALKER require_once('wp-bootstrap-navwalker.php'); //Theme Support function wpb_theme_setup(){ //NAV Menus register_nav_menus(array( 'primary' =&gt;__('Primary Menu') )); //CSS Files wp_enqueue_style('font-awesome', '//use.fontawesome.com/releases/v5.5.0/css/all.css'); wp_enqueue_style('bootstrap', '//stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css'); wp_enqueue_style('owl-carasoul', '//cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/assets/owl.carousel.css'); wp_enqueue_style( 'baguette-box', '//cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.10.0/baguetteBox.min.css'); wp_enqueue_style('main-css', get_stylesheet_uri(), NULL, microtime(), false); //Scripts wp_enqueue_script('jquery', '//cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js', NULL,'1.0', false); wp_enqueue_script('owl', '//cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.3.4/owl.carousel.min.js', NULL, '1.0', true); wp_enqueue_script('bootstrap-js', '//stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js', NULL, '4.1.3', true); wp_enqueue_script('baguette-js', '//cdnjs.cloudflare.com/ajax/libs/baguettebox.js/1.10.0/baguetteBox.min.js', NULL, '1.10.0', false); } add_action('after_setup_theme', 'wpb_theme_setup'); </code></pre> </div>

Spring无法获取ApplicationContext上下文对象怎么解决?

涉及到的类包括: 1. ITestService.java 2. TestServiceImp.java 3. autoWiringService.java 以及Spring配置文件: 4.autoWiring.xml 对应的源码为: 1. ITestService.java ``` package com.z.test.annotation; /** * Created by Z on 2016/11/16. */ public interface ITestService { public void annoTest(); } ``` 2.TestServiceImp.java ``` package com.z.test.annotation; import org.springframework.stereotype.Service; /** * Created by Z on 2016/11/16. * 如何引入注解 */ @Service("testServiceImp") public class TestServiceImp implements ITestService { public void annoTest(){ System.out.println("注解调用"); } } ``` 3.autoWiringService.java ``` package com.z.test.annotation; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; import javax.annotation.Resource; /** * Created by Z on 2016/11/16. */ public class AutoWiringService { @Resource(name ="testServiceImp") public ITestService iTestService; public void autoTest(){ iTestService.annoTest(); } public static void main(String[] args){ ApplicationContext context =new ClassPathXmlApplicationContext("autowiring.xml"); AutoWiringService autoW=(AutoWiringService)context.getBean("autoWiringService"); autoW.autoTest(); } } ``` 使用了@Service 和 @Resource注解。目录结构: ![图片说明](https://img-ask.csdn.net/upload/201611/17/1479358416_204200.png) 在AutoWiringService运行主方法进行测试时,总是有错误如下: ![图片说明](https://img-ask.csdn.net/upload/201611/17/1479358474_121304.png) 猜测是否是无法读取xml文件?还是哪里没有配置好?

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

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

删库了,我们一定要跑路吗?

在工作中,我们误删数据或者数据库,我们一定需要跑路吗?我看未必,程序员一定要学会自救,神不知鬼不觉的将数据找回。 在 mysql 数据库中,我们知道 binlog 日志记录了我们对数据库的所有操作,所以 binlog 日志就是我们自救的利器。 接下来就来开启程序员自救之路。 想要自救成功,binlog 这把利器一定要好,在自己之前,我们一定要确定我们有 binlog 这把利器,以下就是确保有 bi...

再不跳槽,应届毕业生拿的都比我多了!

跳槽几乎是每个人职业生涯的一部分,很多HR说“三年两跳”已经是一个跳槽频繁与否的阈值了,可为什么市面上有很多程序员不到一年就跳槽呢?他们不担心影响履历吗? PayScale之前发布的**《员工最短任期公司排行榜》中,两家码农大厂Amazon和Google**,以1年和1.1年的员工任期中位数分列第二、第四名。 PayScale:员工最短任期公司排行榜 意外的是,任期中位数极小的这两家公司,薪资...

我以为我学懂了数据结构,直到看了这个导图才发现,我错了

数据结构与算法思维导图

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

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

华为初面+综合面试(Java技术面)附上面试题

华为面试整体流程大致分为笔试,性格测试,面试,综合面试,回学校等结果。笔试来说,华为的难度较中等,选择题难度和网易腾讯差不多。最后的代码题,相比下来就简单很多,一共3道题目,前2题很容易就AC,题目已经记不太清楚,不过难度确实不大。最后一题最后提交的代码过了75%的样例,一直没有发现剩下的25%可能存在什么坑。 笔试部分太久远,我就不怎么回忆了。直接将面试。 面试 如果说腾讯的面试是挥金如土...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

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

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是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、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

外包程序员的幸福生活

今天给你们讲述一个外包程序员的幸福生活。男主是Z哥,不是在外包公司上班的那种,是一名自由职业者,接外包项目自己干。接下来讲的都是真人真事。 先给大家介绍一下男主,Z哥,老程序员,是我十多年前的老同事,技术大牛,当过CTO,也创过业。因为我俩都爱好喝酒、踢球,再加上住的距离不算远,所以一直也断断续续的联系着,我对Z哥的状况也有大概了解。 Z哥几年前创业失败,后来他开始干起了外包,利用自己的技术能...

现代的 “Hello, World”,可不仅仅是几行代码而已

作者 |Charles R. Martin译者 | 弯月,责编 | 夕颜头图 |付费下载自视觉中国出品 | CSDN(ID:CSDNnews)新手...

!大部分程序员只会写3年代码

如果世界上都是这种不思进取的软件公司,那别说大部分程序员只会写 3 年代码,恐怕就没有程序员这种职业。

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

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

HTTP与HTTPS的区别

面试官问HTTP与HTTPS的区别,我这样回答让他竖起大拇指!

程序员毕业去大公司好还是小公司好?

虽然大公司并不是人人都能进,但我仍建议还未毕业的同学,尽力地通过校招向大公司挤,但凡挤进去,你这一生会容易很多。 大公司哪里好?没能进大公司怎么办?答案都在这里了,记得帮我点赞哦。 目录: 技术氛围 内部晋升与跳槽 啥也没学会,公司倒闭了? 不同的人脉圈,注定会有不同的结果 没能去大厂怎么办? 一、技术氛围 纵观整个程序员技术领域,哪个在行业有所名气的大牛,不是在大厂? 而且众所...

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

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

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

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

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

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

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

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

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

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

终于懂了TCP和UDP协议区别

终于懂了TCP和UDP协议区别

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

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

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

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

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

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

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

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

立即提问
相关内容推荐