@Query 事务问题,Executing an update/delete query

新搭建了一个 Spring MVC+Spring Data JPA+Hibernate的一个工程
在DAO的方法之上加了注解@Query、@Modifying,但是在运行过程中一直抛出
javax.persistence.TransactionRequiredException: Executing an update/delete query 的异常,实在无力了,希望有大大来帮助
2015-04-29 23:44:12,534[INFO ]com.mchange.v2.log.MLog:MLog clients using slf4j logging.
2015-04-29 23:44:12,747[INFO ]com.mchange.v2.c3p0.C3P0Registry:Initializing c3p0-0.9.5 [built 02-January-2015 13:25:04 -0500; debug? true; trace: 10]
2015-04-29 23:44:13,142[INFO ]org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean:Building JPA container EntityManagerFactory for persistence unit 'elev'
2015-04-29 23:44:14,041[INFO ]com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource:Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acquireIncrement -> 3, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, contextClassLoaderSource -> caller, dataSourceName -> 1hgeby9991mfjmq1wjzcl2|66c88fce, debugUnreturnedConnectionStackTraces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, extensions -> {}, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, forceUseNamedDriverClass -> false, identityToken -> 1hgeby9991mfjmq1wjzcl2|66c88fce, idleConnectionTestPeriod -> 0, initialPoolSize -> 20, jdbcUrl -> jdbc:mysql://localhost:3306/elev, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 45, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 10, numHelperThreads -> 3, preferredTestQuery -> null, privilegeSpawnedThreads -> false, properties -> {user=******, password=******}, propertyCycle -> 0, statementCacheNumDeferredCloseThreads -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, userOverrides -> {}, usesTraditionalReflectiveProxies -> false ]
2015-04-29 23:44:15,422[DEBUG]org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler:Creating new EntityManager for shared EntityManager invocation
2015-04-29 23:44:15,496[DEBUG]org.springframework.orm.jpa.EntityManagerFactoryUtils:Closing JPA EntityManager
2015-04-29 23:44:15,521[DEBUG]org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler:Creating new EntityManager for shared EntityManager invocation
2015-04-29 23:44:15,521[DEBUG]org.springframework.orm.jpa.EntityManagerFactoryUtils:Closing JPA EntityManager
2015-04-29 23:44:15,763[DEBUG]org.springframework.transaction.annotation.AnnotationTransactionAttributeSource:Adding transactional method 'BusinessUserServiceImpl.editUser' with attribute: PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED; 'transactionManager'
2015-04-29 23:44:15,982[DEBUG]org.springframework.transaction.annotation.AnnotationTransactionAttributeSource:Adding transactional method 'BusinessUserServiceImpl.editUser' with attribute: PROPAGATION_REQUIRED,ISOLATION_READ_COMMITTED; 'transactionManager'

从日志上看,好像事务已经加上了。。。
以下是工程部分代码:
applicationContext-main.xml

 <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd">
    <context:annotation-config/>
    <context:component-scan base-package="com.feinno">
        <context:exclude-filter type="annotation" expression="org.springframework.stereotype.Controller"/>
    </context:component-scan>
    <import resource="applicationContext-profile.xml"/>
    <import resource="applicationContext-jpa.xml"/>
    <import resource="applicationContext-mvc.xml"/>

</beans>

applicationContext-mvc.xml

 <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc"
    xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/mvc
        http://www.springframework.org/schema/mvc/spring-mvc.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd">
    <context:component-scan base-package="com.feinno">
        <context:include-filter type="annotation"
            expression="org.springframework.stereotype.Controller" />
    </context:component-scan>
    <mvc:annotation-driven>
        <mvc:message-converters register-defaults="true">
            <bean
                class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
                <property name="prettyPrint" value="true" />
                <property name="supportedMediaTypes">
                    <list>
                        <value>application/json</value>
                        <value>text/html</value>
                    </list>
                </property>
            </bean>
        </mvc:message-converters>
    </mvc:annotation-driven>
</beans>

applicationContext-profile.xml

 <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans.xsd
        http://www.springframework.org/schema/context
        http://www.springframework.org/schema/context/spring-context.xsd">
    <beans profile="dev">
        <context:property-placeholder
            ignore-resource-not-found="true" location="classpath:/config/dev.properties" />
        <bean id="configProperties"
            class="org.springframework.beans.factory.config.PropertiesFactoryBean">
            <property name="locations">
                <list>
                    <value>classpath:/config/dev.properties</value>
                </list>
            </property>
        </bean>
    </beans>
    <beans profile="test">
        <context:property-placeholder
            ignore-resource-not-found="true" location="classpath:/config/test.properties" />
        <bean id="configProperties"
            class="org.springframework.beans.factory.config.PropertiesFactoryBean">
            <property name="locations">
                <list>
                    <value>classpath:/config/test.properties</value>
                </list>
            </property>
        </bean>
    </beans>
    <beans profile="pro">
        <context:property-placeholder
            ignore-resource-not-found="true" location="classpath:/config/prod.properties" />
        <bean id="configProperties"
            class="org.springframework.beans.factory.config.PropertiesFactoryBean">
            <property name="locations">
                <list>
                    <value>classpath:/config/prod.properties</value>
                </list>
            </property>
        </bean>
    </beans>
    <beans>
        <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
            destroy-method="close">
            <property name="driverClass" value="${jdbc.driver}" />
            <property name="jdbcUrl" value="${jdbc.url}" />
            <property name="user" value="${jdbc.user}" />
            <property name="password" value="${jdbc.password}" />
            <property name="minPoolSize" value="10" />
            <property name="maxPoolSize" value="45" />
            <property name="initialPoolSize" value="20" />
        </bean>
    </beans>
</beans>

applicationContext-jpa.xml

 <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    xmlns:jpa="http://www.springframework.org/schema/data/jpa" xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:aop="http://www.springframework.org/schema/aop"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd">
    <jpa:repositories base-package="com.feinno.elev.interfaces" transaction-manager-ref="transactionManager" entity-manager-factory-ref="entityManagerFactory" />
    <bean id="entityManagerFactory"
        class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
        <property name="dataSource" ref="dataSource" />
        <property name="persistenceUnitName" value="elev" />
        <property name="jpaVendorAdapter">
            <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
                <property name="generateDdl" value="false" />
                <property name="showSql" value="false" />
                <property name="databasePlatform" value="org.hibernate.dialect.MySQL5Dialect" />
                <property name="database" value="MYSQL" />

            </bean>
        </property>
        <property name="jpaProperties">
            <props>
                <prop key="hibernate.format_sql">true</prop>
            </props>
        </property>
        <property name="packagesToScan">
            <list>
                <value>com.feinno.elev.interfaces.model</value>
            </list>
        </property>
    </bean>
    <bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
        <property name="dataSource" ref="dataSource" />
        <property name="entityManagerFactory" ref="entityManagerFactory" />
        <property name="jpaDialect">
            <bean class="org.springframework.orm.jpa.vendor.HibernateJpaDialect"></bean>
        </property>
    </bean>
    <tx:annotation-driven proxy-target-class="true" transaction-manager="transactionManager" />
</beans>

Dao

 package com.feinno.elev.interfaces.business.dao;


import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import com.feinno.elev.interfaces.model.BusinessUser;

@Repository
public interface BusinessUserDao extends JpaRepository<BusinessUser, String> {
    @Modifying
    @Query("update BusinessUser set password='123456' where userName=?1")
    public void edit(String userName);

    @Modifying
    @Query(value="delete from sys_accesspro where accessuser = ?1",nativeQuery=true)
    public void delete(String userName);
}

Service

 package com.feinno.elev.interfaces.business.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.feinno.elev.interfaces.business.dao.BusinessUserDao;
import com.feinno.elev.interfaces.business.service.BusinessUserService;
import com.feinno.elev.interfaces.model.BusinessUser;
import com.feinno.elev.util.CommonUtil;
@Service
public class BusinessUserServiceImpl implements BusinessUserService{

    @Autowired
    BusinessUserDao businessUserDao;

    @Override
    public BusinessUser validUser(String userName,String password,String serviceId,String key){
        BusinessUser businessUser = businessUserDao.findOne(userName);
        if(CommonUtil.isNotEmpty(businessUser)){
            if(!businessUser.getPassword().equals(password)||!businessUser.getServiceId().equals(serviceId)||!businessUser.getKey().equals(key)){
                return null;
            }
        }
        return businessUser;
    }
    @Transactional(isolation=Isolation.READ_COMMITTED,readOnly=false,propagation=Propagation.REQUIRED,value="transactionManager")
    @Override
    public void editUser(String userName) {
        BusinessUser bu = new BusinessUser();
        bu.setUserName(userName);
        businessUserDao.edit(userName);
    }

    @Override
    public void deleteUser(String userName) {

    }   
}

web.xml

 <?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" metadata-complete="false" version="3.0">
  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
  <listener>
    <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
  </listener>
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
            classpath:spring/applicationContext-main.xml
        </param-value>
  </context-param>
  <context-param>
    <param-name>spring.profiles.active</param-name>
    <param-value>dev</param-value>
  </context-param>
  <filter>
    <filter-name>ParseRequestFilter</filter-name>
    <filter-class>com.feinno.elev.interfaces.filter.ParseRequestFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>ParseRequestFilter</filter-name>
    <url-pattern>/dispatcher</url-pattern>
  </filter-mapping>
  <filter>
    <filter-name>CharacterEncodingFilter</filter-name>
    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
    <init-param>
      <param-name>encoding</param-name>
      <param-value>UTF-8</param-value>
    </init-param>
    <init-param>
      <param-name>forceEncoding</param-name>
      <param-value>true</param-value>
    </init-param>
  </filter>
  <filter-mapping>
    <filter-name>CharacterEncodingFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
  <servlet>
    <servlet-name>DispatcherServlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>classpath:spring/applicationContext-mvc.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>DispatcherServlet</servlet-name>
    <url-pattern>/*</url-pattern>
  </servlet-mapping>
</web-app>

5个回答

加上这三个注解@Transactional@Modifying@Query

沉了!!!!!能顶上去不????

Junit能测试通过吗?

怎么解决的,我遇到了同样的问题.我是俩个数据库 A完全正常.B系统的save delete 都正常 update就报错 已经加上@Transactional

@Transactional
    @Modifying
@Query(value="delete from sys_accesspro where accessuser = ?1",nativeQuery=true)
public void delete(String userName)throws Exception;
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
spring data JPA: Executing an update/delete query
service中 @Transactional public class UserRolesService { public void verify() { repository.verifyUser(); } } Repository使用的是SpringData CrudRepository @Modifying @Query("UPDATE user SET (verified = 1 WHERE verified=0)") public void verifyUser(); 在Junit中测试正常,但是在另外一个方法中用 @Autowired 注入该service时,再调用该方法,就报javax.persistence.TransactionRequiredException: Executing an update/delete query。实在想不明白是怎么回事,大神,求助。
CAS5.2.3 启动Oauth认证,客户端访问获取accessToken失败
``` 2018-04-04 18:14:30,265 ERROR [org.apereo.cas.support.oauth.web.endpoints.OAuth20AccessTokenEndpointController] - <Executing an update/delete query> javax.persistence.TransactionRequiredException: Executing an update/delete query at org.hibernate.query.internal.AbstractProducedQuery.executeUpdate(AbstractProducedQuery.java:1496) ~[hibernate-core-5.2.13.Final.jar:5.2.13.Final] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_144] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_144] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_144] at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_144] at org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(SharedEntityManagerCreator.java:372) ~[spring-orm-4.3.14.RELEASE.jar:4.3.14.RELEASE] at com.sun.proxy.$Proxy210.executeUpdate(Unknown Source) ~[?:?] at org.apereo.cas.ticket.registry.JpaTicketRegistry.deleteSingleTicket(JpaTicketRegistry.java:149) ~[cas-server-support-jpa-ticket-registry-5.2.3.jar:5.2.3] at org.apereo.cas.ticket.registry.AbstractTicketRegistry.deleteTicket(AbstractTicketRegistry.java:126) ~[cas-server-core-tickets-5.2.3.jar:5.2.3] at org.apereo.cas.support.oauth.web.endpoints.OAuth20AccessTokenEndpointController.handleRequest(OAuth20AccessTokenEndpointController.java:114) ~[cas-server-support-oauth-5.2.3.jar:5.2.3] ... 98 more 2018-04-04 18:14:30,701 ERROR [org.apereo.cas.ticket.DefaultTicketCatalog] - <Ticket definition for [null] cannot be found in the ticket catalog which only contains the following ticket types: [[TGT, ST, RT, AT, PT, OC, PGT]]> 2018-04-04 18:14:30,702 ERROR [org.apereo.cas.ticket.registry.JpaTicketRegistry] - <Error getting ticket [null] from registry.> java.lang.NullPointerException: null at org.apereo.cas.ticket.registry.JpaTicketRegistry.getRawTicket(JpaTicketRegistry.java:88) ~[cas-server-support-jpa-ticket-registry-5.2.3.jar:5.2.3] at org.apereo.cas.ticket.registry.JpaTicketRegistry.getTicket(JpaTicketRegistry.java:75) ~[cas-server-support-jpa-ticket-registry-5.2.3.jar:5.2.3] ... 2018-04-04 18:14:30,703 ERROR [org.apereo.cas.support.oauth.web.endpoints.OAuth20UserProfileControllerController] - <Expired/Missing access token: [null]> ```
安装oracle11g grid 执行root.sh时一直卡在Adding Clusterware entries to inittab
安装oracle11g(11204)grid standalone,在执行root.sh的时候卡在Adding Clusterware entries to inittab一直不动,/tmp/.oracle下面没有文件,查看/oracle/11204/grid_1/home/cfgtoollogs/crsconfig/roothas.log ...... 2019-08-21 10:41:28: Executing /oracle/11204/grid_1/home/bin/crsctl create scr grid 2019-08-21 10:41:28: Executing cmd: /oracle/11204/grid_1/home/bin/crsctl create scr grid 2019-08-21 10:41:28: Registering ohasd 2019-08-21 10:41:28: Executing cmd: /bin/rpm -q sles-release 2019-08-21 10:41:28: Command output: > package sles-release is not installed >End Command output 2019-08-21 10:41:28: init file = /oracle/11204/grid_1/home/crs/init/init.ohasd 2019-08-21 10:41:28: Copying file /oracle/11204/grid_1/home/crs/init/init.ohasd to /etc/init.d directory 2019-08-21 10:41:28: Setting init.ohasd permission in /etc/init.d directory 2019-08-21 10:41:28: init file = /oracle/11204/grid_1/home/crs/init/ohasd 2019-08-21 10:41:28: Copying file /oracle/11204/grid_1/home/crs/init/ohasd to /etc/init.d directory 2019-08-21 10:41:28: Setting ohasd permission in /etc/init.d directory 2019-08-21 10:41:28: Executing cmd: /bin/rpm -q sles-release 2019-08-21 10:41:28: Command output: > package sles-release is not installed >End Command output 2019-08-21 10:41:28: Removing "/etc/rc.d/rc3.d/S96ohasd" 2019-08-21 10:41:28: Removing file /etc/rc.d/rc3.d/S96ohasd 2019-08-21 10:41:28: Successfully removed file: /etc/rc.d/rc3.d/S96ohasd 2019-08-21 10:41:28: Creating a link "/etc/rc.d/rc3.d/S96ohasd" pointing to /etc/init.d/ohasd 2019-08-21 10:41:28: Removing "/etc/rc.d/rc5.d/S96ohasd" 2019-08-21 10:41:28: Removing file /etc/rc.d/rc5.d/S96ohasd 2019-08-21 10:41:28: Successfully removed file: /etc/rc.d/rc5.d/S96ohasd 2019-08-21 10:41:28: Creating a link "/etc/rc.d/rc5.d/S96ohasd" pointing to /etc/init.d/ohasd 2019-08-21 10:41:28: Removing "/etc/rc.d/rc0.d/K15ohasd" 2019-08-21 10:41:28: Removing file /etc/rc.d/rc0.d/K15ohasd 2019-08-21 10:41:28: Successfully removed file: /etc/rc.d/rc0.d/K15ohasd 2019-08-21 10:41:28: Creating a link "/etc/rc.d/rc0.d/K15ohasd" pointing to /etc/init.d/ohasd 2019-08-21 10:41:28: Removing "/etc/rc.d/rc1.d/K15ohasd" 2019-08-21 10:41:28: Removing file /etc/rc.d/rc1.d/K15ohasd 2019-08-21 10:41:28: Successfully removed file: /etc/rc.d/rc1.d/K15ohasd 2019-08-21 10:41:28: Creating a link "/etc/rc.d/rc1.d/K15ohasd" pointing to /etc/init.d/ohasd 2019-08-21 10:41:28: Removing "/etc/rc.d/rc2.d/K15ohasd" 2019-08-21 10:41:28: Removing file /etc/rc.d/rc2.d/K15ohasd 2019-08-21 10:41:28: Successfully removed file: /etc/rc.d/rc2.d/K15ohasd 2019-08-21 10:41:28: Creating a link "/etc/rc.d/rc2.d/K15ohasd" pointing to /etc/init.d/ohasd 2019-08-21 10:41:28: Removing "/etc/rc.d/rc4.d/K15ohasd" 2019-08-21 10:41:28: Removing file /etc/rc.d/rc4.d/K15ohasd 2019-08-21 10:41:28: Successfully removed file: /etc/rc.d/rc4.d/K15ohasd 2019-08-21 10:41:28: Creating a link "/etc/rc.d/rc4.d/K15ohasd" pointing to /etc/init.d/ohasd 2019-08-21 10:41:28: Removing "/etc/rc.d/rc6.d/K15ohasd" 2019-08-21 10:41:28: Removing file /etc/rc.d/rc6.d/K15ohasd 2019-08-21 10:41:28: Successfully removed file: /etc/rc.d/rc6.d/K15ohasd 2019-08-21 10:41:28: Creating a link "/etc/rc.d/rc6.d/K15ohasd" pointing to /etc/init.d/ohasd 2019-08-21 10:41:28: The file ohasd has been successfully linked to the RC directories 2019-08-21 10:41:28: Executing cmd: /bin/rpm -q sles-release 2019-08-21 10:41:28: Command output: > package sles-release is not installed >End Command output SS S_OHASD -state SUCCESS ' 2019-08-21 10:41:28: Removing file /tmp/filea21cdK 2019-08-21 10:41:28: Successfully removed file: /tmp/filea21cdK 2019-08-21 10:41:28: /bin/su successfully executed 2019-08-21 10:41:28: Succeeded in writing the checkpoint:'ROOTCRS_OHASD' with status:SUCCESS 2019-08-21 10:41:28: CkptFile: /oracle/11204/grid_1/base/Clusterware/ckptGridHA_edippsdr.xml 2019-08-21 10:41:28: Sync the checkpoint file '/oracle/11204/grid_1/base/Clusterware/ckptGridHA_edippsdr.xml' 2019-08-21 10:41:28: Sync '/oracle/11204/grid_1/base/Clusterware/ckptGridHA_edippsdr.xml' to the physical disk 2019-08-21 10:41:28: Starting ohasd 2019-08-21 10:41:28: Executing cmd: /bin/rpm -qf /sbin/init 2019-08-21 10:41:28: Command output: > SysVinit-2.86-15.el5 >End Command output 2019-08-21 10:41:28: itab entries=cssd|evmd|crsd|ohasd 2019-08-21 10:41:28: Executing /sbin/init q 2019-08-21 10:41:28: Executing cmd: /sbin/init q 2019-08-21 10:41:33: Created backup /etc/inittab.no_crs 2019-08-21 10:41:33: Appending to /etc/inittab.tmp: 2019-08-21 10:41:33: h1:35:respawn:/etc/init.d/init.ohasd run >/dev/null 2>&1 </dev/null 2019-08-21 10:41:33: Done updating /etc/inittab.tmp 2019-08-21 10:41:33: Saved /etc/inittab.crs 2019-08-21 10:41:33: Installed new /etc/inittab 2019-08-21 10:41:33: Executing /sbin/init q 2019-08-21 10:41:33: Executing cmd: /sbin/init q 2019-08-21 10:41:33: Executing cmd: /oracle/11204/grid_1/home/bin/crsctl start has 2019-08-21 10:41:34: Command output: > CRS-4640: Oracle High Availability Services is already active > CRS-4000: Command Start failed, or completed with errors. >End Command output 2019-08-21 10:41:34: Executing /etc/init.d/ohasd install 2019-08-21 10:41:34: Executing cmd: /etc/init.d/ohasd install 2019-08-21 10:41:34: ohasd is already active 2019-08-21 10:41:34: Started service 'ohasd' 2019-08-21 10:41:34: Checking ohasd 2019-08-21 10:41:34: Executing cmd: /oracle/11204/grid_1/home/bin/crsctl check has 因为本台服务器曾经是oracle10gRac的其中一个节点,改了一些参数,不知道是不是什么参数没设置好还是咋回事执行了超多次都卡在这....求大佬帮忙看看
spring mvc+hibernate jpa使用sqlserver 2000数据库修改数据报错!
用原生sql查询没有问题,修改的时候报错 javax.persistence.TransactionRequiredException: Executing an update/delete query at org.hibernate.ejb.AbstractQueryImpl.executeUpdate(AbstractQueryImpl.java:96) at com.tyz.project.cook.dao.impl.MenuTaskDaoImpl.updTest(MenuTaskDaoImpl.java:49) at com.tyz.project.cook.service.impl.MenuTaskServiceImpl.syncDak(MenuTaskServiceImpl.java:201) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy50.syncDak(Unknown Source) at com.tyz.project.timetask.WebTask.TaskDakJob(WebTask.java:37) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:64) at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:53) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.runAndReset(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.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)
oracle dg复制备库约到如下错误
连接主备库 rman target sys/oracle@fc91 auxiliary sys/oracle@fc94 执行脚本: run{ allocate channel c1 type disk; allocate channel c2 type disk; allocate channel c3 type disk; allocate AUXILIARY channel c4 type disk; allocate AUXILIARY channel c5 type disk; allocate AUXILIARY channel c6 type disk; DUPLICATE TARGET DATABASE FOR STANDBY FROM ACTIVE DATABASE DORECOVER NOFILENAMECHECK; release channel c1; release channel c2; release channel c3; release channel c4; release channel c5; release channel c6; } Recovery Manager: Release 19.0.0.0.0 - Production on Tue Jan 21 16:23:00 2020 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved. connected to target database: FC91 (DBID=2505363336) connected to auxiliary database: FC91 (DBID=2505363336, not open) RMAN> 现在日志如下: using target database control file instead of recovery catalog allocated channel: c1 channel c1: SID=729 device type=DISK allocated channel: c2 channel c2: SID=1094 device type=DISK allocated channel: c3 channel c3: SID=609 device type=DISK allocated channel: c4 channel c4: SID=1212 device type=DISK allocated channel: c5 channel c5: SID=1333 device type=DISK allocated channel: c6 channel c6: SID=1454 device type=DISK Starting Duplicate Db at 21-JAN-20 contents of Memory Script: { backup as copy reuse passwordfile auxiliary format '/opt/oracle/product/19c/dbhome_1/dbs/orapwFC94' ; } executing Memory Script Starting backup at 21-JAN-20 Finished backup at 21-JAN-20 contents of Memory Script: { restore clone from service 'fc91' standby controlfile; } executing Memory Script Starting restore at 21-JAN-20 channel c4: starting datafile backup set restore channel c4: using network backup set from service fc91 channel c4: restoring control file channel c4: restore complete, elapsed time: 00:00:01 output file name=/opt/oracle/oradata/FC94/control01.ctl output file name=/opt/oracle/oradata/FC94/control02.ctl Finished restore at 21-JAN-20 contents of Memory Script: { sql clone 'alter database mount standby database'; } executing Memory Script sql statement: alter database mount standby database contents of Memory Script: { set newname for tempfile 1 to "/opt/oracle/oradata/FC94/temp01.dbf"; set newname for tempfile 2 to "/opt/oracle/oradata/FC94/pdbseed/temp012020-01-21_11-02-57-925-AM.dbf"; set newname for tempfile 3 to "/opt/oracle/oradata/FC94/ORCLPDB1/temp01.dbf"; switch clone tempfile all; set newname for datafile 1 to "/opt/oracle/oradata/FC94/system01.dbf"; set newname for datafile 3 to "/opt/oracle/oradata/FC94/sysaux01.dbf"; set newname for datafile 4 to "/opt/oracle/oradata/FC94/undotbs01.dbf"; set newname for datafile 5 to "/opt/oracle/oradata/FC94/pdbseed/system01.dbf"; set newname for datafile 6 to "/opt/oracle/oradata/FC94/pdbseed/sysaux01.dbf"; set newname for datafile 7 to "/opt/oracle/oradata/FC94/users01.dbf"; set newname for datafile 8 to "/opt/oracle/oradata/FC94/pdbseed/undotbs01.dbf"; set newname for datafile 9 to "/opt/oracle/oradata/FC94/ORCLPDB1/system01.dbf"; set newname for datafile 10 to "/opt/oracle/oradata/FC94/ORCLPDB1/sysaux01.dbf"; set newname for datafile 11 to "/opt/oracle/oradata/FC94/ORCLPDB1/undotbs01.dbf"; set newname for datafile 12 to "/opt/oracle/oradata/FC94/ORCLPDB1/users01.dbf"; restore from nonsparse from service 'fc91' clone database ; sql 'alter system archive log current'; } executing Memory Script executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME renamed tempfile 1 to /opt/oracle/oradata/FC94/temp01.dbf in control file renamed tempfile 2 to /opt/oracle/oradata/FC94/pdbseed/temp012020-01-21_11-02-57-925-AM.dbf in control file renamed tempfile 3 to /opt/oracle/oradata/FC94/ORCLPDB1/temp01.dbf in control file executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME executing command: SET NEWNAME Starting restore at 21-JAN-20 channel c4: starting datafile backup set restore channel c4: using network backup set from service fc91 channel c4: specifying datafile(s) to restore from backup set channel c4: restoring datafile 00001 to /opt/oracle/oradata/FC94/system01.dbf released channel: c1 released channel: c2 released channel: c3 released channel: c4 released channel: c5 released channel: c6 RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: failure of Duplicate Db command at 01/21/2020 16:12:58 RMAN-05501: aborting duplication of target database RMAN-03015: error occurred in stored script Memory Script ORA-19845: error in backupDataFile while communicating with remote database server ORA-17628: Oracle error 19602 returned by remote Oracle server ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode ORA-19660: some files in the backup set could not be verified ORA-19661: datafile 1 could not be verified ORA-19845: error in backupDataFile while communicating with remote database server ORA-17628: Oracle error 19602 returned by remote Oracle server ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode
编译内核是时make install除错
Error! Bad return status for module build on kernel: 3.19.3 (x86_64) Consult /var/lib/dkms/vboxhost/4.3.26/build/make.log for more information. run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.19.3 /boot/vmlinuz-3.19.3 update-initramfs: Generating /boot/initrd.img-3.19.3 W: Possible missing firmware /lib/firmware/rtl_nic/rtl8107e-2.fw for module r8169 W: Possible missing firmware /lib/firmware/rtl_nic/rtl8107e-1.fw for module r8169
这个 Bug 搞了一个星期了没弄好,崩溃中,哪位大佬能帮忙看看??
控制台信息:![图片说明](https://img-ask.csdn.net/upload/202001/18/1579336366_42087.jpg) ``` org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'koison'@'localhost' (using password: YES)) ### The error may exist in file [/Users/koison/IdeaProjects/selfOA/target/oasys/WEB-INF/classes/mapper/UserDao.xml] ### The error may involve com.gcc.dao.UserDao.findByUsername ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'koison'@'localhost' (using password: YES)) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982) org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:872) javax.servlet.http.HttpServlet.service(HttpServlet.java:660) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) javax.servlet.http.HttpServlet.service(HttpServlet.java:741) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:197) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ```
malloc与realloc问题(C数据结构)
如下代码所示,关于malloc与realloc出现5处错误: ``` #include <stdio.h> #include <stdlib.h> #define STACK_INIT_SIZE 100; #define STACKINCREMENT 10; typedef struct{ int *base; int *top; int stacksize; }SqStack; void InitStack(SqStack S){ S.base=(int *)malloc(STACK_INIT_SIZE*sizeof(int)); S.top=S.base; S.stacksize=STACK_INIT_SIZE; }//___________________InitStack_______________________ void Push(SqStack S,int e){ if(S.top==S.base){ S.base=(int *)realloc(S.base,(S.stacksize+STACKINCREMENT)*sizeof(int)); S.top=S.base+S.stacksize; S.stacksize+=STACKINCREMENT; } *S.top=e; S.top++; } void main(){ SqStack S; InitStack(S); Push (S,5); } ``` SqStack.c D:\VC6\pvc6\COMMON\MSDEV98\BIN\SqStack.c(13) : error C2143: syntax error : missing ')' before ';' D:\VC6\pvc6\COMMON\MSDEV98\BIN\SqStack.c(13) : error C2059: syntax error : ')' D:\VC6\pvc6\COMMON\MSDEV98\BIN\SqStack.c(13) : error C2100: illegal indirection D:\VC6\pvc6\COMMON\MSDEV98\BIN\SqStack.c(20) : error C2143: syntax error : missing ')' before ';' D:\VC6\pvc6\COMMON\MSDEV98\BIN\SqStack.c(20) : error C2143: syntax error : missing ';' before ')' Error executing cl.exe. SqStack.obj - 5 error(s), 0 warning(s) 求大佬解答~~
Top Spinning
Problem Description Spinning tops are one of the most popular and the most traditional toys. Not only spinning them, but also making one’s own is a popular enjoyment. One of the easiest way to make a top is to cut out a certain shape from a cardboard and pierce an axis stick through its center of mass. Professionally made tops usually have three dimensional shapes, but in this problem we consider only two dimensional ones. Usually, tops have rotationally symmetric shapes, such as a circle, a rectangle (with 2-fold rotational symmetry) or a regular triangle (with 3-fold symmetry). Although such symmetries are useful in determining their centers of mass, they are not definitely required; an asymmetric top also spins quite well if its axis is properly pierced at the center of mass. When a shape of a top is given as a path to cut it out from a cardboard of uniform thickness, your task is to find its center of mass to make it spin well. Also, you have to determine whether the center of mass is on the part of the cardboard cut out. If not, you cannot pierce the axis stick, of course. Java Spicific : Submitted Java programs may not use classes implementing the interface “java.awt.Shape”. You may use them for your debugging purposes. Input The input consists of multiple datasets, each of which describes a counterclockwise path on a cardboard to cut out a top. A path is indicated by a sequence of command lines, each of which specifies a line segment or an arc. In the description of commands below, the current position is the position to start the next cut, if any. After executing the cut specified by a command, the current position is moved to the end position of the cut made. The commands given are one of those listed below. The command name starts from the first column of a line and the command and its arguments are separated by a space. All the command arguments are integers. start x y Specifies the start position of a path. This command itself does not specify any cutting; it only sets the current position to be (x; y). line x y Specifies a linear cut along a straight line from the current position to the position (x; y), which is not identical to the current position. arc x y r Specifies a round cut along a circular arc. The arc starts from the current position and ends at (x; y), which is not identical to the current position. The arc has a radius of |r|. When r is negative, the center of the circle is to the left side of the direction of this round cut; when it is positive, it is to the right side (Figure 7). The absolute value of r is greater than the half distance of the two ends of the arc. Among two arcs connecting the start and the end positions with the specified radius, the arc specified is one with its central angle less than 180 degrees. close Closes a path by making a linear cut to the initial start position and terminates a dataset. If the current position is already at the start position, this command simply indicates the end of a dataset. The figure below gives an example of a command sequence and its corresponding path. Note that, in this case, the given radius -r is negative and thus the center of the arc is to the left of the arc. The arc command should be interpreted as shown in this figure and, not the other way around on the same circle. A dataset starts with a start command and ends with a close command. The end of the input is specified by a line with a command end.There are at most 100 commands in a dataset and at most 100 datasets are in the input. Absolute values of all the coordinates and radii are less than or equal to 100.You may assume that the path does not cross nor touch itself. You may also assume that paths will never expand beyond edges of the cardboard, or, in other words, the cardboard is virtually infinitely large. Output For each of the dataset, output a line containing x- and y-coordinates of the center of mass of the top cut out by the path specified, and then a character ‘+’ or ‘-’ indicating whether this center is on the top or not, respectively. Two coordinates should be in decimal fractions. There should be a space between two coordinates and between the y-coordinate and the character ‘+’ or ‘-’. No other characters should be output. The coordinates may have errors less than 10&#8722;3. You may assume that the center of mass is at least 10&#8722;3 distant from the path. Sample Input start 0 0 arc 2 2 -2 line 2 5 arc 0 3 -2 close start -1 1 line 2 1 line 2 2 line -2 2 arc -3 1 -1 line -3 -2 arc -2 -3 -1 line 2 -3 line 2 -2 line -1 -2 line -1 -1 arc -1 0 2 close start 0 0 line 3 0 line 5 -1 arc 4 -2 -1 line 6 -2 line 6 1 line 7 3 arc 8 2 -1 line 8 4 line 5 4 line 3 5 arc 4 6 -1 line 2 6 line 2 3 line 1 1 arc 0 2 -1 close end Sample Output 1.00000 2.50000 + -1.01522 -0.50000 - 4.00000 2.00000 + HINT
pip install ipython 时出现什么编码解码的问题导致无法安装
``` (django_st) pyvip@VIP:~/django_st$ pip install ipython Looking in indexes: https://pypi.douban.com/simple Collecting ipython Downloading https://pypi.doubanio.com/packages/05/d7/77b7a1988c99227f52402f93fb0f7e88c97239960516f53907ebbc44149c/ipython-7.11.0-py3-none-any.whl (777kB) |████████████████████████████████| 778kB 1.4MB/s ERROR: Could not install packages due to an EnvironmentError: ('Received response with content-encoding: gzip, but failed to decode it.', error('Error -3 while decompressing data: incorrect header check',)) (django_st) pyvip@VIP:~/django_st$ python manage.py shell Python 3.6.9 (default, Nov 7 2019, 10:44:02) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> exit() (django_st) pyvip@VIP:~/django_st$ sudo pip install ipython [sudo] pyvip 的密码: The directory '/home/pyvip/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. The directory '/home/pyvip/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. Requirement already satisfied: ipython in /usr/local/lib/python3.6/dist-packages Requirement already satisfied: decorator in /usr/local/lib/python3.6/dist-packages (from ipython) Requirement already satisfied: pickleshare in /usr/local/lib/python3.6/dist-packages (from ipython) Requirement already satisfied: traitlets>=4.2 in /usr/local/lib/python3.6/dist-packages (from ipython) Requirement already satisfied: prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 in /usr/local/lib/python3.6/dist-packages (from ipython) Requirement already satisfied: pexpect; sys_platform != "win32" in /usr/lib/python3/dist-packages (from ipython) Requirement already satisfied: backcall in /usr/local/lib/python3.6/dist-packages (from ipython) Requirement already satisfied: pygments in /usr/local/lib/python3.6/dist-packages (from ipython) Requirement already satisfied: jedi>=0.10 in /usr/local/lib/python3.6/dist-packages (from ipython) Requirement already satisfied: setuptools>=18.5 in /usr/lib/python3/dist-packages (from ipython) Requirement already satisfied: six in /usr/lib/python3/dist-packages (from traitlets>=4.2->ipython) Requirement already satisfied: ipython-genutils in /usr/local/lib/python3.6/dist-packages (from traitlets>=4.2->ipython) Requirement already satisfied: wcwidth in /usr/local/lib/python3.6/dist-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython) Requirement already satisfied: parso>=0.5.2 in /usr/local/lib/python3.6/dist-packages (from jedi>=0.10->ipython) (django_st) pyvip@VIP:~/django_st$ ipython --version 7.11.0 (django_st) pyvip@VIP:~/django_st$ python manage.py shell Python 3.6.9 (default, Nov 7 2019, 10:44:02) [GCC 8.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> exit() ```
electron,分支页面无法实现require功能
此问题悬赏金(10元),帮助我解决问题即可获得,联系方式:1109039558(QQ) 我写了一个electron文件,文件中包含index.html(主)和test.html 单独运行test页面,功能没有任何问题 但是从index页面进入test页面,test页面无法正常运行. 原因可能如下,我在test导入bcli.js库,这个js是我自己写的,里面有一些函数,如check123 opening123等等 > ``` <script> require("./js/electron/bcli.js"); </script> ``` 我上网上查了好多资料,都没有任何用,包括下面这个 ``` webPreferences: { nodeIntegration: true } ``` 我现在很无奈,求各位大佬帮帮我,错误问题如下,其中check123,我定义在了bcli.js中. ``` Uncaught ReferenceError: check123 is not defined ``` 刚才一位朋友提出的建议,我试了,代码如下:上面两行代码没有注释时,结果可以运行,可是我将上面两行代码改成下面两行,结果运行不了. ``` // const $ = require('jquery'); // jQuery // const shell = require('shelljs'); // cli executor import {$} from require('jquery'); import {shell} from require('shelljs'); ``` 可能是我理解有问题,上面的问题,我想在描述一下,我普通的function可以运行,可是当我在支页面运行我写的代码,就运行不了,我把我写的代码附上去: ``` // libraries const os = require('os'); // operating system const path = require('path'); // path joiner const $ = require('jquery'); // jQuery const shell = require('shelljs'); // cli executor // global varialbes, DO NOT CHANGE let executing = false; let imgNotFound = false; let imgID = "#shrimp"; var fs=require("fs") const {dialog}=require('electron').remote opendialog=function(){ if (executing) return; let imgPathes = []; dialog.showOpenDialog({ title:"选择文件:", filters: [ { name: 'Images', extensions: ['jpg', 'png', 'bmp'] }, ] },result => { if (executing) return; // do nothing if we are already executing the files // otherwise try to get pdf pathes user has dropped to us let imgPathes = []; imgPathes.push(result); fs.writeFile("/home/tju/桌面/abcd28/path1.txt",result,(err,data)=>{ if(err) throw err; }) let len = imgPathes.length; var i=0; if (len >= 1) { // if we got 1 or more pdf pathes, start executing console.log(imgPathes[i]); execute(imgPathes[i]); i=i+1; } else { console.error("Need exact 1 image"); } }) } function rmImg(imgPath) { let str1=`cp -r `+ imgPath + ` `+` /home/tju/桌面/xuejie/train/SRGAN_CL/input/new.jpg`; fs.writeFile("./path.txt",str1,(err,data)=>{ if(err) throw err; }) let str=str1 +` && cd /home/tju/桌面/xuejie/train/SRGAN_CL && python test2.py --path1=/home/tju/桌面/xuejie/train/SRGAN_CL/input/new.jpg`; fs.writeFile("/home/tju/桌面/cmd.txt",str,(err,data)=>{ if(err) throw err; }) let cmd = str; shell.exec(cmd, {silent:false}, (code, stdout, stderr)=>{ if(code === 0){ console.log({code: code, stdout: stdout, stderr: stderr}); }else{ console.error({code: code, stdout: stdout, stderr: stderr}); } }); }; $('#refresh').click(()=>{ // $('#input1').load(location.href+'#input1'); setTimeout(() => { javascript:location.reload(); }, 10000); }); async function execute(imgPath) { executing = true; // tell ui we are doing executing! try { let result = await rmImg(imgPath); console.log(result); } catch (err) { // will catch >>first<< error in the try block console.error(error); } executing = false; // tell ui the shrink is done } check123=function(){ var textarea=this.document.querySelector('#textarea'); fs.readFile('/home/tju/桌面/abcd28/path1.txt','utf-8',function(err,data){ if(err){ console.error(err); } else{ textarea.innerHTML= data; } }); var textarea1=this.document.querySelector('#textarea1'); fs.readFile('/home/tju/桌面/xuejie/train/SRGAN_CL/sta_2019_16_1080/shuchu.csv','utf-8',function(err,data){ if(err){ console.error(err); } else{ textarea1.innerHTML= data; } }); } console.log("script loaded"); ```
这是一个关于C++的简单代码问题
``` #include<iostream> using namespace std; struct typedef LNode { int data; LNode *Next; }*List; int main() { return 0; } ``` 这是我写的代码,我就是想写个链表结点结构体 报错如下: --------------------Configuration: 123 - Win32 Debug-------------------- Compiling... 123.cpp F:\C语言程序\123.cpp(4) : error C2239: unexpected token '{' following declaration of 'LNode' F:\C语言程序\123.cpp(8) : error C2501: 'List' : missing storage-class or type specifiers Error executing cl.exe. 123.exe - 2 error(s), 0 warning(s) 求解
Top Spinning 旋转的问题
Problem Description Spinning tops are one of the most popular and the most traditional toys. Not only spinning them, but also making one’s own is a popular enjoyment. One of the easiest way to make a top is to cut out a certain shape from a cardboard and pierce an axis stick through its center of mass. Professionally made tops usually have three dimensional shapes, but in this problem we consider only two dimensional ones. Usually, tops have rotationally symmetric shapes, such as a circle, a rectangle (with 2-fold rotational symmetry) or a regular triangle (with 3-fold symmetry). Although such symmetries are useful in determining their centers of mass, they are not definitely required; an asymmetric top also spins quite well if its axis is properly pierced at the center of mass. When a shape of a top is given as a path to cut it out from a cardboard of uniform thickness, your task is to find its center of mass to make it spin well. Also, you have to determine whether the center of mass is on the part of the cardboard cut out. If not, you cannot pierce the axis stick, of course. Java Spicific : Submitted Java programs may not use classes implementing the interface “java.awt.Shape”. You may use them for your debugging purposes. Input The input consists of multiple datasets, each of which describes a counterclockwise path on a cardboard to cut out a top. A path is indicated by a sequence of command lines, each of which specifies a line segment or an arc. In the description of commands below, the current position is the position to start the next cut, if any. After executing the cut specified by a command, the current position is moved to the end position of the cut made. The commands given are one of those listed below. The command name starts from the first column of a line and the command and its arguments are separated by a space. All the command arguments are integers. start x y Specifies the start position of a path. This command itself does not specify any cutting; it only sets the current position to be (x; y). line x y Specifies a linear cut along a straight line from the current position to the position (x; y), which is not identical to the current position. arc x y r Specifies a round cut along a circular arc. The arc starts from the current position and ends at (x; y), which is not identical to the current position. The arc has a radius of |r|. When r is negative, the center of the circle is to the left side of the direction of this round cut; when it is positive, it is to the right side (Figure 7). The absolute value of r is greater than the half distance of the two ends of the arc. Among two arcs connecting the start and the end positions with the specified radius, the arc specified is one with its central angle less than 180 degrees. close Closes a path by making a linear cut to the initial start position and terminates a dataset. If the current position is already at the start position, this command simply indicates the end of a dataset. The figure below gives an example of a command sequence and its corresponding path. Note that, in this case, the given radius -r is negative and thus the center of the arc is to the left of the arc. The arc command should be interpreted as shown in this figure and, not the other way around on the same circle. A dataset starts with a start command and ends with a close command. The end of the input is specified by a line with a command end.There are at most 100 commands in a dataset and at most 100 datasets are in the input. Absolute values of all the coordinates and radii are less than or equal to 100.You may assume that the path does not cross nor touch itself. You may also assume that paths will never expand beyond edges of the cardboard, or, in other words, the cardboard is virtually infinitely large. Output For each of the dataset, output a line containing x- and y-coordinates of the center of mass of the top cut out by the path specified, and then a character ‘+’ or ‘-’ indicating whether this center is on the top or not, respectively. Two coordinates should be in decimal fractions. There should be a space between two coordinates and between the y-coordinate and the character ‘+’ or ‘-’. No other characters should be output. The coordinates may have errors less than 10&#8722;3. You may assume that the center of mass is at least 10&#8722;3 distant from the path. Sample Input start 0 0 arc 2 2 -2 line 2 5 arc 0 3 -2 close start -1 1 line 2 1 line 2 2 line -2 2 arc -3 1 -1 line -3 -2 arc -2 -3 -1 line 2 -3 line 2 -2 line -1 -2 line -1 -1 arc -1 0 2 close start 0 0 line 3 0 line 5 -1 arc 4 -2 -1 line 6 -2 line 6 1 line 7 3 arc 8 2 -1 line 8 4 line 5 4 line 3 5 arc 4 6 -1 line 2 6 line 2 3 line 1 1 arc 0 2 -1 close end Sample Output 1.00000 2.50000 + -1.01522 -0.50000 - 4.00000 2.00000 + HINT
idea爆出org.hibernate.tool.schema.spi.CommandAcceptanceException不知道怎么解决
``` org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "create table hibernate_sequence (next_val bigint) engine=InnoDB" via JDBC Statement at org.hibernate.tool.schema.internal.exec.GenerationTargetToDatabase.accept(GenerationTargetToDatabase.java:67) at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.applySqlString(AbstractSchemaMigrator.java:559) at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.applySqlStrings(AbstractSchemaMigrator.java:504) at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.createTable(AbstractSchemaMigrator.java:277) at org.hibernate.tool.schema.internal.GroupedSchemaMigratorImpl.performTablesMigration(GroupedSchemaMigratorImpl.java:71) at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.performMigration(AbstractSchemaMigrator.java:207) at org.hibernate.tool.schema.internal.AbstractSchemaMigrator.doMigration(AbstractSchemaMigrator.java:114) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.performDatabaseAction(SchemaManagementToolCoordinator.java:184) at org.hibernate.tool.schema.spi.SchemaManagementToolCoordinator.process(SchemaManagementToolCoordinator.java:73) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:320) at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:462) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1237) at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58) at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365) at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:391) at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:378) at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1855) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1 792) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:595) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1108) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:868) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141) at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) at com.liuzeyu.BlogApplication.main(BlogApplication.java:12) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49) Caused by: java.sql.SQLSyntaxErrorException: Table 'blog.hibernate_sequence' doesn't exist 我是数据库挂了之后重新安装的MySQL 安装后连接正常,但是一启动spring boot就抛出这个异常 网上很多地方说修改hibernate.cfg.xml文件 但idea找不到这个文件,我的项目是SpringBoot+JPA+Thymeleaf ```
eclipse启动AVD时出现如下错误
05-01 03:13:10.170: E/logwrapper(40): executing /system/bin/e2fsck failed: No such file or directory 05-01 03:13:10.240: E/logwrapper(46): executing /system/bin/e2fsck failed: No such file or directory 05-01 03:13:13.930: E/SurfaceFlinger(56): hwcomposer module not found 05-01 03:13:15.610: E/SurfaceFlinger(56): ro.sf.lcd_density must be defined as a build property 05-01 03:13:17.080: E/AudioFlinger(59): no wake lock to update! 05-01 03:13:17.150: E/AudioFlinger(59): int android::load_audio_interface(const char*, audio_hw_device_t**) couldn't load audio hw module audio.r_submix (No such file or directory) 05-01 03:13:22.630: E/memtrack(57): Couldn't load memtrack module (No such file or directory) 05-01 03:13:22.630: E/android.os.Debug(57): failed to load memtrack module: -2 05-01 03:13:34.870: E/EmojiFactory_jni(57): Failed to load libemoji.so: dlopen failed: library "libemoji.so" not found 05-01 03:13:38.300: E/logwrapper(290): executing /system/bin/ip failed: No such file or directory 05-01 03:13:38.360: E/logwrapper(291): executing /system/bin/ip failed: No such file or directory 05-01 03:13:38.390: E/logwrapper(292): executing /system/bin/ip failed: No such file or directory 05-01 03:13:38.450: E/logwrapper(293): executing /system/bin/ip failed: No such file or directory 05-01 03:13:38.500: E/logwrapper(294): executing /system/bin/ip failed: No such file or directory 05-01 03:13:38.530: E/logwrapper(295): executing /system/bin/ip failed: No such file or directory 05-01 03:13:38.590: E/logwrapper(296): executing /system/bin/ip failed: No such file or directory 05-01 03:14:02.940: E/PowerManagerService-JNI(369): Couldn't load power module (No such file or directory) 05-01 03:14:04.160: E/SurfaceFlinger(56): ro.sf.lcd_density must be defined as a build property 05-01 03:14:13.320: E/ConsumerIrService(369): Can't open consumer IR HW Module, error: -2 05-01 03:14:13.350: E/libsuspend(369): Error opening /sys/power/autosleep: No such file or directory 05-01 03:14:13.910: E/EventHub(369): could not get driver version for /dev/input/mouse0, Not a typewriter 05-01 03:14:13.990: E/EventHub(369): could not get driver version for /dev/input/mice, Not a typewriter 05-01 03:14:16.660: E/MobileDataStateTracker(369): default: Ignoring feature request because could not acquire PhoneService 05-01 03:14:16.660: E/MobileDataStateTracker(369): default: Could not enable APN type "default" 05-01 03:14:19.200: A/SystemServer(369): BOOT FAILURE making Package Manager Service ready 05-01 03:14:19.200: A/SystemServer(369): java.lang.SecurityException: Unable to find app for caller android.app.ActivityThread$ApplicationThread@b4ebfb48 (pid=369) when registering receiver android.app.LoadedApk$ReceiverDispatcher$InnerReceiver@b4ec0380 05-01 03:14:19.200: A/SystemServer(369): at com.android.server.am.ActivityManagerService.registerReceiver(ActivityManagerService.java:13021) 05-01 03:14:19.200: A/SystemServer(369): at android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1450) 05-01 03:14:19.200: A/SystemServer(369): at android.app.ContextImpl.registerReceiverAsUser(ContextImpl.java:1425) 05-01 03:14:19.200: A/SystemServer(369): at com.android.internal.content.PackageMonitor.register(PackageMonitor.java:84) 05-01 03:14:19.200: A/SystemServer(369): at com.android.server.pm.UserManagerService.systemReady(UserManagerService.java:237) 05-01 03:14:19.200: A/SystemServer(369): at com.android.server.pm.PackageManagerService.systemReady(PackageManagerService.java:10476) 05-01 03:14:19.200: A/SystemServer(369): at com.android.server.ServerThread.initAndLoop(SystemServer.java:893) 05-01 03:14:19.200: A/SystemServer(369): at com.android.server.SystemServer.main(SystemServer.java:1179) 05-01 03:14:19.200: A/SystemServer(369): at java.lang.reflect.Method.invokeNative(Native Method) 05-01 03:14:19.200: A/SystemServer(369): at java.lang.reflect.Method.invoke(Method.java:515) 05-01 03:14:19.200: A/SystemServer(369): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785) 05-01 03:14:19.200: A/SystemServer(369): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601) 05-01 03:14:19.200: A/SystemServer(369): at dalvik.system.NativeStart.main(Native Method) 05-01 03:14:24.310: E/SoundPool(420): error loading /system/media/audio/ui/Lock.ogg 05-01 03:14:24.330: E/SoundPool(420): error loading /system/media/audio/ui/Unlock.ogg 05-01 03:14:24.750: E/NetdConnector(369): NDC Command {1 bandwidth enable} took too long (4593ms) 05-01 03:14:25.800: E/NetdConnector(369): NDC Command {2 firewall disable} took too long (916ms) 05-01 03:14:26.100: E/VoldConnector(369): NDC Command {3 volume mount /storage/sdcard} took too long (5993ms) 05-01 03:14:26.930: E/VoldConnector(369): NDC Command {4 asec list} took too long (3558ms) 05-01 03:14:27.410: E/NetdConnector(369): NDC Command {4 bandwidth setglobalalert 2097152} took too long (591ms) 05-01 03:14:28.280: E/NetdConnector(369): NDC Command {5 firewall disable} took too long (592ms) 05-01 03:14:30.000: E/BluetoothAdapter(420): Bluetooth binder is null 05-01 03:14:30.010: E/BluetoothAdapter(420): Bluetooth binder is null 05-01 03:14:30.220: E/BluetoothAdapter(420): Bluetooth binder is null 05-01 03:14:30.880: E/LocationManagerService(369): no geocoder provider found 05-01 03:14:30.890: E/FlpHardwareProvider(369): Error hw_get_module 'flp': -2 05-01 03:14:30.910: E/FlpHardwareProvider(369): Error hw_get_module 'flp': -2 05-01 03:14:30.910: E/LocationManagerService(369): No FusedProvider found. 05-01 03:14:30.980: E/LocationManagerService(369): no geofence provider found 05-01 03:14:32.050: E/BluetoothAdapter(420): Bluetooth binder is null 05-01 03:14:38.120: E/BluetoothAdapter(420): Bluetooth binder is null 05-01 03:14:42.860: E/BluetoothAdapter(517): Bluetooth binder is null
关于 Vim 编辑器
Problem Description Vim is a text editor which developed from vi. Due to its powerful function in code complete, compile, and error jump, it’s widely used by programmers. The same as Emacs, it’s the most popular text editor among users of UNIX. As such an excellent text editor, Vim has various of orders. Now, we’re asking you to write a program that simulates Vim’s replace order. The format of Vim’s replace order is ([] means optional, {} means necessary) : :[range]s/{pattern}/{string}/[flag] In the order above, ‘:’ means the start of a replace order, [range] indicates the range of the order, that is, the order works in which lines. ‘s’ is short for substitute. {pattern} and {string} represent the string to match and replace to, respectively. ‘/’ is used to mark the beginning and ending of {pattern} and {string}. {flag} is used to open or close some options. {range} is often two integers separated by a comma, indicating the start line and end line’s line number. For example, “4,8” means from line 4 to line 8 (including line 4, line 8). Line number starts from 1. You can also use a ‘%’ to represent all lines. (Additional, Vim provides many more flexible formats. Such as, bypassing a number means the line cursor stays, ‘′meansthelastlineofthetext.So,“,” means from the line cursor stays to the last line. ) {pattern} and {string} both support regular expression (if you haven’t ever heard of it, go to Google for help). If {pattern} is empty, the {pattern} of the last replace order will be used. Obviously, ‘/’ can’t be included in {pattern} and {string}. So, an additional escape character ‘\’ is used. For example, if you want to replace “<br>” to “<br/>”, you cannot write: :%s/<br>/<br />/g Instead, you should write: :%s/<br>/<br \/>/g If there’re too many ‘/’s in the expression, (for instance, "file:///usr/share/man/man1/vim.1.gz"), it will become troublesome. So, people think of a solution, that is, use another character as the separator (the first character after ‘s’ is always treated as the separator). For example, when using ‘+’ as the separator, the order above can be written this way: :%s+<br>+<br />+g There’re many kinds of [flag]. ‘g’ means replace every time it matches. Without a ‘g’, it will only replace the first matching string. For example: #include <stdio.h> Execute the order bellow: :%s/i//g Result is: #nclude <stdo.h> While executing this order bellow: :%s/i// Result is: #nclude <stdio.h> Other flags including: ‘c’ indicates a confirm is required before every replacement, ‘i’ indicates case insensitive. Here comes a problem, what if you want to replace “a” to “aa”? Somebody may doubt that it will go to an endless loop, but in fact, it won’t. Because there is a rule that, in a replacement, the replaced characters can’t be replaced again. So, if you want to replace “a” to “aa”, it’s in fact that every successive “a” string is doubled in length. To simplify the problem, we make some appointments: 1. [range] must appear, in the form of “%” or “a,b” (a, b are both integers, and a<=b) 2. {pattern} and {string} are both consist of characters, numbers, spaces and “_” (not including any separator below, so an escape character is not needed) 3. You can choose one of these characters as the separator: /~!@#$%^&*()-+= 4. [flag] is always a “g” A big example: Original text: If the Tao is greet, then the operating system is greet. If the operating system is greeter, then the compiler is greet. If the compiler is greeter, then the applications is greet. The user is pleased and there is harmony in the world. Replace order: :[1,4]s/greet/great/g Or: :%s+greet+great+g Either will replace the original text to: If the Tao is great, then the operating system is great. If the operating system is greater, then the compiler is great. If the compiler is greater, then the applications is great. The user is pleased and there is harmony in the world. Please write a program to simulate this simplified vim replace order. Input The input will consist of one case. The first line will be a positive integer L (L <= 100), specifying the number of lines to be processed. Then L lines of text are given. Each line has no more than 100 characters. After that, several pieces (<= 50) of replace orders are given (one per line). It is ensured that any line of text will never have more than 100 characters during the replacement. Output After the execution of every replace order, output the line number and content of the lines that have been replaced, order by line number from small to big. In each line, first output the line number, which has a width of 4 characters, right-aligned, then 2 spaces, then the text after replacement. If any order replaced nothing, output "Pattern not found". Output a blank line between any two replace order’s result. Sample Input 4 If the Tao is greet, then the operating system is greet. If the operating system is greeter, then the compiler is greet. If the compiler is greeter, then the applications is greet. The user is pleased and there is harmony in the world. :1,3s/greet/great/g :%s//great/g Sample Output 1 If the Tao is great, then the operating system is great. 2 If the operating system is greater, then the compiler is great. 3 If the compiler is greater, then the applications is great. Pattern not found
FreeRadiant 思路的方式
Problem Description Desolators are the elite troops of the WHU army in the alternate world of ICPC. When the Desolator plant a powerful Radiation Cannon in the ground, the cannon emits a radiation field over a circular area with radius R, poisoning everything within the circle (including boundary).The desolator must remain immobile while using this attack; if he wishes to move he has to uproot the cannon, disabling the radiation field. To protect desolator himself from the harm of radiation, the Desolator wears an armored Radiation suit. This suit is protected against the radiation emitted by the cannon. There are N enemies need to be destroyed. Each enemy can be destroyed if their total attacked times reach a certain value. Fortunately we know that value for each enemy. Our honored desolator FreeRadiant is executing this mission. He can use his cannon freely: e.g. plant it somewhere, wait for some time, uproot it and plant it somewhere else again and so on. The Desolator is so fast that planting, uprooting and moving the cannon takes no time, only the poisoning time matters. He just wants to know the total time needed in which he has to plant the cannon into the ground. Input The first line consists of an integer of T, indicating the test cases in the file. Each case begins with two integers, N and R, indicating the number of enemies and the radius of the circle. The next N lines, each line consists of two integers Xi, Yi, Pi, indicating the coordinate and the time needed to destroy each enemy. Output Output one float number rounded to 2 fractional digits, indicating the minimum time for the cannon needs to be planted in the ground. Constrains T <= 20 0 < N <= 100 0 < R <= 10000 0 <= Xi, Yi, Pi <= 10000 Sample Input 2 4 1 1 1 3 1 -1 3 -1 1 3 -1 -1 3 5 1 100 100 10000 1 1 3 1 -1 3 -1 1 3 -1 -1 3 Sample Output 6.00 10006.00
Jenkins打包项目报错,JDK1.8
``` [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 6.400 s [INFO] Finished at: 2019-12-31T17:08:37+08:00 [INFO] Final Memory: 32M/117M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project cmdbunion_eureka: Execution default-compile of goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile failed: A required class was missing while executing org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile: org/codehaus/plexus/compiler/util/scan/InclusionScanException [ERROR] ----------------------------------------------------- [ERROR] realm = plugin>org.apache.maven.plugins:maven-compiler-plugin:3.8.1 [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy [ERROR] urls[0] = file:/DATA/repo/repository/org/apache/maven/plugins/maven-compiler-plugin/3.8.1/maven-compiler-plugin-3.8.1.jar [ERROR] urls[1] = file:/DATA/repo/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar [JENKINS] Archiving /DATA/var/lib/jenkins/workspace/cmdbunion_parent/cmdbunion_eureka/pom.xml to com.travelsky/cmdbunion_eureka/0.0.1-SNAPSHOT/cmdbunion_eureka-0.0.1-SNAPSHOT.pom [ERROR] Number of foreign imports: 1 [ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]] [ERROR] [ERROR] -----------------------------------------------------: org.codehaus.plexus.compiler.util.scan.InclusionScanException [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [JENKINS] Archiving /DATA/var/lib/jenkins/workspace/cmdbunion_parent/cmdbunion_titsm/pom.xml to com.travelsky/cmdbunion_titsm/0.0.1-SNAPSHOT/cmdbunion_titsm-0.0.1-SNAPSHOT.pom [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException [ERROR] [ERROR] After correcting the problems, you can resume the build with the command [ERROR] mvn <goals> -rf :cmdbunion_eureka ``` ![图片说明](https://img-ask.csdn.net/upload/201912/31/1577783774_342114.png) ![图片说明](https://img-ask.csdn.net/upload/201912/31/1577783814_821416.png)
Logo 2 程序的设计
Problem Description Logo is a programming language built around a turtle. Commands in the language cause the turtle to move. The turtle has a pen attached to it. As the turtle moves, it draw lines on the page. The turtle can be programmed to draw interesting pictures. We are interested in making the turtle draw a picture, then return to the point that it started from. For example, we could give the turtle the following program: fd 100 lt 120 fd 100 lt 120 fd 100 The command fd causes the turtle to move forward by the specified number of units. The command lt causes the turtle to turn left by the specified number of degrees. Thus the above commands cause the turtle to draw an equilateral triangle with sides 100 units long. Notice that after executing the commands, the turtle ends up in the same place as it started. The turtle understands two additional commands. The command bk causes the turtle to move backward by the specified number of units. The command rt causes the turtle to turn right by the specified number of degrees. The distances and angles in all commands are always non-negative integers. Unfortunately, we have been messy in writing the program down, and cannot read our own writing. One of the numbers in the program is missing. Assuming the turtle ends up at the place that it started at the end of its journey, can you find the missing number? Input The first line of each test chunk contains an integer specifying the number of test cases in this chunk to follow. Each test case starts with a line containing one integer, the number of commands to follow. The commands follow, one on each line. Each test case will contain no more than 1000 commands. The argument of each command is either an integer or a question mark (?). There will be exactly one question mark in each test case. Please process to the end of the data file. Output For each test case, output line containing a single integer n such that when the question mark in the program is replaced by n, the turtle ends up at the same point that it started from once the program completes. If the question mark is the argument of an lt or rt command, the angle in the output must be between 0 and 359 degrees, inclusive. The correct answer will always be an integer, and we guarantee that for every test case, there will be only one correct answer. Sample Input 1 5 fd 100 lt 120 fd ? lt 120 fd 100 1 5 fd 100 lt 120 fd ? lt 120 fd 100 Sample Output 100 100
终于明白阿里百度这样的大公司,为什么面试经常拿ThreadLocal考验求职者了
点击上面↑「爱开发」关注我们每晚10点,捕获技术思考和创业资源洞察什么是ThreadLocalThreadLocal是一个本地线程副本变量工具类,各个线程都拥有一份线程私...
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
Linux(服务器编程):15---两种高效的事件处理模式(reactor模式、proactor模式)
前言 同步I/O模型通常用于实现Reactor模式 异步I/O模型则用于实现Proactor模式 最后我们会使用同步I/O方式模拟出Proactor模式 一、Reactor模式 Reactor模式特点 它要求主线程(I/O处理单元)只负责监听文件描述符上是否有事件发生,有的话就立即将时间通知工作线程(逻辑单元)。除此之外,主线程不做任何其他实质性的工作 读写数据,接受新的连接,以及处...
阿里面试官问我:如何设计秒杀系统?我的回答让他比起大拇指
你知道的越多,你不知道的越多 点赞再看,养成习惯 GitHub上已经开源 https://github.com/JavaFamily 有一线大厂面试点脑图和个人联系方式,欢迎Star和指教 前言 Redis在互联网技术存储方面使用如此广泛,几乎所有的后端技术面试官都要在Redis的使用和原理方面对小伙伴们进行360°的刁难。 作为一个在互联网公司面一次拿一次Offer的面霸,打败了...
五年程序员记流水账式的自白。
不知觉已中码龄已突破五年,一路走来从起初铁憨憨到现在的十九线程序员,一路成长,虽然不能成为高工,但是也能挡下一面,从15年很火的android开始入坑,走过java、.Net、QT,目前仍处于android和.net交替开发中。 毕业到现在一共就职过两家公司,目前是第二家,公司算是半个创业公司,所以基本上都会身兼多职。比如不光要写代码,还要写软著、软著评测、线上线下客户对接需求收集...
C语言魔塔游戏
很早就很想写这个,今天终于写完了。 游戏截图: 编译环境: VS2017 游戏需要一些图片,如果有想要的或者对游戏有什么看法的可以加我的QQ 2985486630 讨论,如果暂时没有回应,可以在博客下方留言,到时候我会看到。 下面我来介绍一下游戏的主要功能和实现方式 首先是玩家的定义,使用结构体,这个名字是可以自己改变的 struct gamerole { char n...
一文详尽系列之模型评估指标
点击上方“Datawhale”,选择“星标”公众号第一时间获取价值内容在机器学习领域通常会根据实际的业务场景拟定相应的不同的业务指标,针对不同机器学习问题如回归、分类、排...
究竟你适不适合买Mac?
我清晰的记得,刚买的macbook pro回到家,开机后第一件事情,就是上了淘宝网,花了500元钱,找了一个上门维修电脑的师傅,上门给我装了一个windows系统。。。。。。 表砍我。。。 当时买mac的初衷,只是想要个固态硬盘的笔记本,用来运行一些复杂的扑克软件。而看了当时所有的SSD笔记本后,最终决定,还是买个好(xiong)看(da)的。 已经有好几个朋友问我mba怎么样了,所以今天尽量客观...
程序员一般通过什么途径接私活?
二哥,你好,我想知道一般程序猿都如何接私活,我也想接,能告诉我一些方法吗? 上面是一个读者“烦不烦”问我的一个问题。其实不止是“烦不烦”,还有很多读者问过我类似这样的问题。 我接的私活不算多,挣到的钱也没有多少,加起来不到 20W。说实话,这个数目说出来我是有点心虚的,毕竟太少了,大家轻喷。但我想,恰好配得上“一般程序员”这个称号啊。毕竟苍蝇再小也是肉,我也算是有经验的人了。 唾弃接私活、做外...
压测学习总结(1)——高并发性能指标:QPS、TPS、RT、吞吐量详解
一、QPS,每秒查询 QPS:Queries Per Second意思是“每秒查询率”,是一台服务器每秒能够相应的查询次数,是对一个特定的查询服务器在规定时间内所处理流量多少的衡量标准。互联网中,作为域名系统服务器的机器的性能经常用每秒查询率来衡量。 二、TPS,每秒事务 TPS:是TransactionsPerSecond的缩写,也就是事务数/秒。它是软件测试结果的测量单位。一个事务是指一...
Python爬虫爬取淘宝,京东商品信息
小编是一个理科生,不善长说一些废话。简单介绍下原理然后直接上代码。 使用的工具(Python+pycharm2019.3+selenium+xpath+chromedriver)其中要使用pycharm也可以私聊我selenium是一个框架可以通过pip下载 pip installselenium -ihttps://pypi.tuna.tsinghua.edu.cn/simple/ ...
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
这种新手都不会范的错,居然被一个工作好几年的小伙子写出来,差点被当场开除了。
Java工作4年来应聘要16K最后没要,细节如下。。。
前奏: 今天2B哥和大家分享一位前几天面试的一位应聘者,工作4年26岁,统招本科。 以下就是他的简历和面试情况。 基本情况: 专业技能: 1、&nbsp;熟悉Sping了解SpringMVC、SpringBoot、Mybatis等框架、了解SpringCloud微服务 2、&nbsp;熟悉常用项目管理工具:SVN、GIT、MAVEN、Jenkins 3、&nbsp;熟悉Nginx、tomca...
2020年,冯唐49岁:我给20、30岁IT职场年轻人的建议
点击“技术领导力”关注∆每天早上8:30推送 作者|Mr.K 编辑| Emma 来源|技术领导力(ID:jishulingdaoli) 前天的推文《冯唐:职场人35岁以后,方法论比经验重要》,收到了不少读者的反馈,觉得挺受启发。其实,冯唐写了不少关于职场方面的文章,都挺不错的。可惜大家只记住了“春风十里不如你”、“如何避免成为油腻腻的中年人”等不那么正经的文章。 本文整理了冯...
程序员该看的几部电影
1、骇客帝国(1999) 概念:在线/离线,递归,循环,矩阵等 剧情简介: 不久的将来,网络黑客尼奥对这个看似正常的现实世界产生了怀疑。 他结识了黑客崔妮蒂,并见到了黑客组织的首领墨菲斯。 墨菲斯告诉他,现实世界其实是由一个名叫“母体”的计算机人工智能系统控制,人们就像他们饲养的动物,没有自由和思想,而尼奥就是能够拯救人类的救世主。 可是,救赎之路从来都不会一帆风顺,到底哪里才是真实的世界?如何...
Python绘图,圣诞树,花,爱心 | Turtle篇
每周每日,分享Python实战代码,入门资料,进阶资料,基础语法,爬虫,数据分析,web网站,机器学习,深度学习等等。 公众号回复【进群】沟通交流吧,QQ扫码进群学习吧 微信群 QQ群 1.画圣诞树 import turtle screen = turtle.Screen() screen.setup(800,600) circle = turtle.Turtle()...
作为一个程序员,CPU的这些硬核知识你必须会!
CPU对每个程序员来说,是个既熟悉又陌生的东西? 如果你只知道CPU是中央处理器的话,那可能对你并没有什么用,那么作为程序员的我们,必须要搞懂的就是CPU这家伙是如何运行的,尤其要搞懂它里面的寄存器是怎么一回事,因为这将让你从底层明白程序的运行机制。 随我一起,来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说,我们首先就要搞明白它是怎么回事,也就是它的内部构造,当然,CPU那么牛的一个东...
还记得那个提速8倍的IDEA插件吗?VS Code版本也发布啦!!
去年,阿里云发布了本地 IDE 插件 Cloud Toolkit,仅 IntelliJ IDEA 一个平台,就有 15 万以上的开发者进行了下载,体验了一键部署带来的开发便利。时隔一年的今天,阿里云正式发布了 Visual Studio Code 版本,全面覆盖前端开发者,帮助前端实现一键打包部署,让开发提速 8 倍。 VSCode 版本的插件,目前能做到什么? 安装插件之后,开发者可以立即体验...
破14亿,Python分析我国存在哪些人口危机!
一、背景 二、爬取数据 三、数据分析 1、总人口 2、男女人口比例 3、人口城镇化 4、人口增长率 5、人口老化(抚养比) 6、各省人口 7、世界人口 四、遇到的问题 遇到的问题 1、数据分页,需要获取从1949-2018年数据,观察到有近20年参数:LAST20,由此推测获取近70年的参数可设置为:LAST70 2、2019年数据没有放上去,可以手动添加上去 3、将数据进行 行列转换 4、列名...
2019年除夕夜的有感而发
天气:小雨(加小雪) 温度:3摄氏度 空气:严重污染(399) 风向:北风 风力:微风 现在是除夕夜晚上十点钟,再有两个小时就要新的一年了; 首先要说的是我没患病,至少现在是没有患病;但是心情确像患了病一样沉重; 现在这个时刻应该大部分家庭都在看春晚吧,或许一家人团团圆圆的坐在一起,或许因为某些特殊原因而不能团圆;但不管是身在何处,身处什么境地,我都想对每一个人说一句:新年快乐! 不知道csdn这...
听说想当黑客的都玩过这个Monyer游戏(1~14攻略)
第零关 进入传送门开始第0关(游戏链接) 请点击链接进入第1关: 连接在左边→ ←连接在右边 看不到啊。。。。(只能看到一堆大佬做完的留名,也能看到菜鸡的我,在后面~~) 直接fn+f12吧 &lt;span&gt;连接在左边→&lt;/span&gt; &lt;a href="first.php"&gt;&lt;/a&gt; &lt;span&gt;←连接在右边&lt;/span&gt; o...
在家远程办公效率低?那你一定要收好这个「在家办公」神器!
相信大家都已经收到国务院延长春节假期的消息,接下来,在家远程办公可能将会持续一段时间。 但是问题来了。远程办公不是人在电脑前就当坐班了,相反,对于沟通效率,文件协作,以及信息安全都有着极高的要求。有着非常多的挑战,比如: 1在异地互相不见面的会议上,如何提高沟通效率? 2文件之间的来往反馈如何做到及时性?如何保证信息安全? 3如何规划安排每天工作,以及如何进行成果验收? ...... ...
作为一个程序员,内存和磁盘的这些事情,你不得不知道啊!!!
截止目前,我已经分享了如下几篇文章: 一个程序在计算机中是如何运行的?超级干货!!! 作为一个程序员,CPU的这些硬核知识你必须会! 作为一个程序员,内存的这些硬核知识你必须懂! 这些知识可以说是我们之前都不太重视的基础知识,可能大家在上大学的时候都学习过了,但是嘞,当时由于老师讲解的没那么有趣,又加上这些知识本身就比较枯燥,所以嘞,大家当初几乎等于没学。 再说啦,学习这些,也看不出来有什么用啊!...
2020年的1月,我辞掉了我的第一份工作
其实,这篇文章,我应该早点写的,毕竟现在已经2月份了。不过一些其它原因,或者是我的惰性、还有一些迷茫的念头,让自己迟迟没有试着写一点东西,记录下,或者说是总结下自己前3年的工作上的经历、学习的过程。 我自己知道的,在写自己的博客方面,我的文笔很一般,非技术类的文章不想去写;另外我又是一个还比较热衷于技术的人,而平常复杂一点的东西,如果想写文章写的清楚点,是需要足够...
别低估自己的直觉,也别高估自己的智商
所有群全部吵翻天,朋友圈全部沦陷,公众号疯狂转发。这两周没怎么发原创,只发新闻,可能有人注意到了。我不是懒,是文章写了却没发,因为大家的关注力始终在这次的疫情上面,发了也没人看。当然,我...
这个世界上人真的分三六九等,你信吗?
偶然间,在知乎上看到一个问题 一时间,勾起了我深深的回忆。 以前在厂里打过两次工,做过家教,干过辅导班,做过中介。零下几度的晚上,贴过广告,满脸、满手地长冻疮。 再回首那段岁月,虽然苦,但让我学会了坚持和忍耐。让我明白了,在这个世界上,无论环境多么的恶劣,只要心存希望,星星之火,亦可燎原。 下文是原回答,希望能对你能有所启发。 如果我说,这个世界上人真的分三六九等,...
节后首个工作日,企业们集体开晨会让钉钉挂了
By 超神经场景描述:昨天 2 月 3 日,是大部分城市号召远程工作的第一天,全国有接近 2 亿人在家开始远程办公,钉钉上也有超过 1000 万家企业活跃起来。关键词:十一出行 人脸...
Java基础知识点梳理
虽然已经在实际工作中经常与java打交道,但是一直没系统地对java这门语言进行梳理和总结,掌握的知识也比较零散。恰好利用这段时间重新认识下java,并对一些常见的语法和知识点做个总结与回顾,一方面为了加深印象,方便后面查阅,一方面为了掌握好Android打下基础。
2020年全新Java学习路线图,含配套视频,学完即为中级Java程序员!!
新的一年来临,突如其来的疫情打破了平静的生活! 在家的你是否很无聊,如果无聊就来学习吧! 世上只有一种投资只赚不赔,那就是学习!!! 传智播客于2020年升级了Java学习线路图,硬核升级,免费放送! 学完你就是中级程序员,能更快一步找到工作! 一、Java基础 JavaSE基础是Java中级程序员的起点,是帮助你从小白到懂得编程的必经之路。 在Java基础板块中有6个子模块的学...
B 站上有哪些很好的学习资源?
哇说起B站,在小九眼里就是宝藏般的存在,放年假宅在家时一天刷6、7个小时不在话下,更别提今年的跨年晚会,我简直是跪着看完的!! 最早大家聚在在B站是为了追番,再后来我在上面刷欧美新歌和漂亮小姐姐的舞蹈视频,最近两年我和周围的朋友们已经把B站当作学习教室了,而且学习成本还免费,真是个励志的好平台ヽ(.◕ฺˇд ˇ◕ฺ;)ノ 下面我们就来盘点一下B站上优质的学习资源: 综合类 Oeasy: 综合...
相关热词 c# 压缩图片好麻烦 c#计算数组中的平均值 c#获取路由参数 c#日期精确到分钟 c#自定义异常必须继承 c#查表并返回值 c# 动态 表达式树 c# 监控方法耗时 c# listbox c#chart显示滚动条
立即提问