错误: 找不到或无法加载主类 org.testng.TestNG

问题:在命令行运行“java org.testng.TestNG testng.xml”总是报错“错误: 找不到或无法加载主类 org.testng.TestNG”,网上帖子翻了好多但是都不能解决问题

配置了classpath之后“java -classpath "%classpath%:C:\Users\morris.m2\repository\org\testng\testng\6.10\testng-6.10.jar" org.testng.
TestNG testng.xml”还是同样的报错

1个回答

java执行之前有先通过javac编译下TestNG.java吗?

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
JAVA,Mybatis插入报断言错误
FAILED: insertCoinPresentRecord java.lang.AssertionError at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setObject(SQLServerPreparedStatement.java:981) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setObjectNoType(SQLServerPreparedStatement.java:926) at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setObject(SQLServerPreparedStatement.java:935) at org.apache.commons.dbcp.DelegatingPreparedStatement.setObject(DelegatingPreparedStatement.java:169) at org.apache.commons.dbcp.DelegatingPreparedStatement.setObject(DelegatingPreparedStatement.java:169) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:70) at com.sun.proxy.$Proxy100.setObject(Unknown Source) at org.apache.ibatis.type.ObjectTypeHandler.setNonNullParameter(ObjectTypeHandler.java:31) at org.apache.ibatis.type.BaseTypeHandler.setParameter(BaseTypeHandler.java:50) at org.apache.ibatis.type.UnknownTypeHandler.setNonNullParameter(UnknownTypeHandler.java:45) at org.apache.ibatis.type.BaseTypeHandler.setParameter(BaseTypeHandler.java:50) at org.apache.ibatis.scripting.defaults.DefaultParameterHandler.setParameters(DefaultParameterHandler.java:81) at org.apache.ibatis.executor.statement.PreparedStatementHandler.parameterize(PreparedStatementHandler.java:80) at org.apache.ibatis.executor.statement.RoutingStatementHandler.parameterize(RoutingStatementHandler.java:61) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:62) at com.sun.proxy.$Proxy98.parameterize(Unknown Source) at org.apache.ibatis.executor.SimpleExecutor.prepareStatement(SimpleExecutor.java:74) at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:47) at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:105) at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:152) at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:141) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:358) at com.sun.proxy.$Proxy22.insert(Unknown Source) at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:240) at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:51) at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:52) at com.sun.proxy.$Proxy97.insertCoinPresentRecord(Unknown Source) at com.seasaw.member.dao.CoinPresentRecordDaoTest.insertCoinPresentRecord(CoinPresentRecordDaoTest.java:52) 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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84) at org.testng.internal.MethodInvocationHelper$1.runTestMethod(MethodInvocationHelper.java:200) at org.springframework.test.context.testng.AbstractTestNGSpringContextTests.run(AbstractTestNGSpringContextTests.java:170) 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.testng.internal.MethodInvocationHelper.invokeHookable(MethodInvocationHelper.java:212) at org.testng.internal.Invoker.invokeMethod(Invoker.java:707) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111) at org.testng.TestRunner.privateRun(TestRunner.java:767) at org.testng.TestRunner.run(TestRunner.java:617) at org.testng.SuiteRunner.runTest(SuiteRunner.java:334) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291) at org.testng.SuiteRunner.run(SuiteRunner.java:240) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224) at org.testng.TestNG.runSuitesLocally(TestNG.java:1149) at org.testng.TestNG.run(TestNG.java:1057) at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175) 插入语句单元测试的时候报了个这个错误出来,新手不是很理解啊,求助各位大神
selenium 脚本在windows下正常运行,但是在linux下的jenkins运行报错。
[2017-03-06 18:19:04] [INFO] RetryCount=0 [2017-03-06 18:19:04] [INFO] SourceDir=src/main/java/com/test/testcases [2017-03-06 18:19:04] [INFO] SourceEncoding=UTF-8 [2017-03-06 18:19:04] [INFO] 当前操作系统是:[Linux] [2017-03-06 18:19:04] [INFO] 启动测试浏览器:[chrome] [2017-03-06 18:19:04] [ERROR] 浏览器不能正常工作,请检查是不是被手动关闭或者其他原因 java.lang.IllegalStateException: The driver is not executable: /var/lib/jenkins/workspace/seltest/res/driver/chrome/linux/chromedriver at com.google.common.base.Preconditions.checkState(Preconditions.java:518) at org.openqa.selenium.remote.service.DriverService.checkExecutable(DriverService.java:127) at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:118) at org.openqa.selenium.chrome.ChromeDriverService.access$000(ChromeDriverService.java:32) at org.openqa.selenium.chrome.ChromeDriverService$Builder.findDefaultExecutable(ChromeDriverService.java:137) at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:302) at org.openqa.selenium.chrome.ChromeDriverService.createDefaultService(ChromeDriverService.java:88) at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:124) at main.java.com.test.utils.SelectBrowser.selectExplorerByName(SelectBrowser.java:60) at main.java.com.test.utils.SeleniumUtil.launchBrowser(SeleniumUtil.java:54) at main.java.com.test.base.BaseParpare.startTest(BaseParpare.java:41) 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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108) at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:523) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:224) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:146) at org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:166) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105) at org.testng.TestRunner.privateRun(TestRunner.java:744) at org.testng.TestRunner.run(TestRunner.java:602) at org.testng.SuiteRunner.runTest(SuiteRunner.java:380) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340) at org.testng.SuiteRunner.run(SuiteRunner.java:289) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301) at org.testng.TestNG.runSuitesLocally(TestNG.java:1226) at org.testng.TestNG.runSuites(TestNG.java:1144)
springAOP的xml配置错误
请各路大神帮帮我这个战五的渣渣吧T^T ![图片说明](https://img-ask.csdn.net/upload/201705/04/1493894219_356908.png) org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.aop.aspectj.AspectJPointcutAdvisor#0': Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.aop.aspectj.AspectJPointcutAdvisor]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: error at ::0 formal unbound in pointcut at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:275) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1143) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1046) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:305) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:301) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:196) at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:772) at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:835) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:537) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139) at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83) at com.part8aspect.aspectj.schema.Test.test(Test.java:14) 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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84) at org.testng.internal.Invoker.invokeMethod(Invoker.java:714) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111) at org.testng.TestRunner.privateRun(TestRunner.java:767) at org.testng.TestRunner.run(TestRunner.java:617) at org.testng.SuiteRunner.runTest(SuiteRunner.java:334) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291) at org.testng.SuiteRunner.run(SuiteRunner.java:240) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224) at org.testng.TestNG.runSuitesLocally(TestNG.java:1149) at org.testng.TestNG.run(TestNG.java:1057) at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72) at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:127) Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.aop.aspectj.AspectJPointcutAdvisor]: Constructor threw exception; nested exception is java.lang.IllegalArgumentException: error at ::0 formal unbound in pointcut at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:163) at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:122) at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:267) ... 37 more Caused by: java.lang.IllegalArgumentException: error at ::0 formal unbound in pointcut at org.aspectj.weaver.tools.PointcutParser.parsePointcutExpression(PointcutParser.java:301) at org.springframework.aop.aspectj.AspectJExpressionPointcut.buildPointcutExpression(AspectJExpressionPointcut.java:207) at org.springframework.aop.aspectj.AspectJExpressionPointcut.checkReadyToMatch(AspectJExpressionPointcut.java:193) at org.springframework.aop.aspectj.AspectJExpressionPointcut.getMethodMatcher(AspectJExpressionPointcut.java:176) at org.springframework.aop.aspectj.AbstractAspectJAdvice.buildSafePointcut(AbstractAspectJAdvice.java:187) at org.springframework.aop.aspectj.AspectJPointcutAdvisor.<init>(AspectJPointcutAdvisor.java:51) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:147) ... 39 more
Seam testNg测试问题
eclipse(3.4) + JBoss tools 生成的seam(jboss-seam-2.1.0.SP1)项目,对新建的action进行测试,action没有东西,测试内容为: public class WelcomeTest extends SeamTest { @Test public void test_welcome() throws Exception { assert true; } } 我只是想让他运行通过,我用的是jdk1.6,但1.6的问题我觉得应该解决了-Dsun.lang.ClassLoader.allowArraySyntax=true 小弟我在google上找了半天,好像没有人遇到过这样的问题,实在不知道该怎么样解决,小弟在此先谢谢了。 [Parser] Running: D:\workspaces\seam-test\temp-testng-customsuite.xml WARN 23-01 18:05:54,281 (UnifiedLoaderRepository3.java:addClassLoader:713) -Tried to add non-URLClassLoader. Ignored WARN 23-01 18:05:56,562 (TxControl.java::302) -[com.arjuna.ats.arjuna.coordinator.TxControl_1] - Name of XA node not defined. Using -3f57fe9c:8b6:49799684:0 WARN 23-01 18:05:58,078 (AspectManagerService.java:baseAop:228) -Could not find base-aspects.xml file in the resources of sun.misc.Launcher$AppClassLoader@19821f ERROR 23-01 18:05:59,218 (AbstractController.java:incrementState:755) -Error installing to Start: name=DsDataSourceTemplateInfo state=Create java.lang.IllegalStateException: Unsupported dsType: org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentGroup at org.jboss.resource.deployers.management.DsDataSourceTemplateInfo.start(DsDataSourceTemplateInfo.java:123) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:56) at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:110) at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66) at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:214) at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:45) at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:108) at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:69) at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221) at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:135) at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:46) at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327) at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309) at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784) at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:574) at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:398) at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:69) at org.jboss.deployers.vfs.deployer.kernel.BeanMetaDataDeployer.deploy(BeanMetaDataDeployer.java:42) at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:65) at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50) at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169) at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:853) at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:874) at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:794) at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327) at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309) at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784) at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622) at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411) at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:498) at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:506) at org.jboss.embedded.DeploymentScanner.start(DeploymentScanner.java:105) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.jboss.reflect.plugins.introspection.ReflectionUtils.invoke(ReflectionUtils.java:56) at org.jboss.reflect.plugins.introspection.ReflectMethodInfoImpl.invoke(ReflectMethodInfoImpl.java:110) at org.jboss.joinpoint.plugins.BasicMethodJoinPoint.dispatch(BasicMethodJoinPoint.java:66) at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:214) at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:45) at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:108) at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:69) at org.jboss.kernel.plugins.dependency.LifecycleAction.installActionInternal(LifecycleAction.java:221) at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:135) at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.installAction(KernelControllerContextAction.java:46) at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62) at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71) at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51) at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327) at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309) at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784) at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:574) at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:398) at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBean(AbstractKernelDeployer.java:309) at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deployBeans(AbstractKernelDeployer.java:279) at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.deploy(AbstractKernelDeployer.java:130) at org.jboss.kernel.plugins.deployment.xml.BeanXMLDeployer.deploy(BeanXMLDeployer.java:96) at org.jboss.embedded.Bootstrap.deployBaseBootstrapUrl(Bootstrap.java:130) at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:142) at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:183) at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:195) at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:11) at org.jboss.seam.mock.AbstractSeamTest.startJbossEmbeddedIfNecessary(AbstractSeamTest.java:1025) at org.jboss.seam.mock.AbstractSeamTest.startSeam(AbstractSeamTest.java:916) at org.jboss.seam.mock.SeamTest.startSeam(SeamTest.java:58) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580) at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:398) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:145) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:82) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:278) at org.testng.SuiteRunner.run(SuiteRunner.java:198) at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:823) at org.testng.TestNG.runSuitesLocally(TestNG.java:790) at org.testng.TestNG.run(TestNG.java:708) at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124) WARN 23-01 18:06:03,796 (SecurityMetadataStore.java:checkDefaultSuckerPassword:311) -WARNING! POTENTIAL SECURITY RISK. It has been detected that the MessageSucker component which sucks messages from one node to another has not had its password changed from the installation default. Please see the JBoss Messaging user guide for instructions on how to do this. WARN 23-01 18:06:04,062 (ConnectionFactoryJNDIMapper.java:registerConnectionFactory:155) -supportsFailover attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support failover WARN 23-01 18:06:04,062 (ConnectionFactoryJNDIMapper.java:registerConnectionFactory:161) -supportsLoadBalancing attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support load balancing FAILED CONFIGURATION: @BeforeSuite startSeam org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS): *** CONTEXTS MISSING DEPENDENCIES: Name -> Dependency{Required State:Actual State} DsDataSourceTemplate -> DsDataSourceTemplateInfo{Configured:**ERROR**} *** CONTEXTS IN ERROR: Name -> Error DsDataSourceTemplateInfo -> java.lang.IllegalStateException: Unsupported dsType: org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentGroup at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:576) at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:559) at org.jboss.embedded.Bootstrap.bootstrapURL(Bootstrap.java:149) at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:183) at org.jboss.embedded.Bootstrap.bootstrap(Bootstrap.java:195) at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:11) at org.jboss.seam.mock.AbstractSeamTest.startJbossEmbeddedIfNecessary(AbstractSeamTest.java:1025) at org.jboss.seam.mock.AbstractSeamTest.startSeam(AbstractSeamTest.java:916) at org.jboss.seam.mock.SeamTest.startSeam(SeamTest.java:58) ... Removed 15 stack frames SKIPPED CONFIGURATION: @BeforeClass setupClass SKIPPED CONFIGURATION: @BeforeMethod begin SKIPPED CONFIGURATION: @AfterMethod end SKIPPED CONFIGURATION: @AfterClass cleanupClass SKIPPED: test_welcome =============================================== org.domain.seam.test.WelcomeTest Tests run: 1, Failures: 0, Skips: 1 Configuration Failures: 1, Skips: 4 =============================================== =============================================== seam-test Total tests run: 1, Failures: 0, Skips: 1 Configuration Failures: 1, Skips: 5 =============================================== [b]问题补充:[/b] 我的数据源的设置都是eclipse生成的,而且在action中与数据库连接也没问题 <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE datasources PUBLIC "-//JBoss//DTD JBOSS JCA Config 1.5//EN" "http://www.jboss.org/j2ee/dtd/jboss-ds_1_5.dtd"> <datasources> <local-tx-datasource> <jndi-name>seamDatasource</jndi-name> <connection-url>jdbc:mysql://localhost/test</connection-url> <driver-class>com.mysql.jdbc.Driver</driver-class> <user-name>root</user-name> <password></password> </local-tx-datasource> </datasources> 这是我的seam-test-ds.xml文件 [b]问题补充:[/b] 还有我的test文件结构 [b]问题补充:[/b] 是ds的。JBoss中DS建立成功,但我测试用的都是seam自带的嵌入式微容器,貌似不用启动我的JBoss AS吧 [b]问题补充:[/b] 这是我的 src\META-INF\myseam-test-ds.xml <local-tx-datasource> <jndi-name>myseamDatasource</jndi-name> <connection-url>jdbc:mysql://localhost/test</connection-url> <driver-class>com.mysql.jdbc.Driver</driver-class> <user-name>root</user-name> <password></password> </local-tx-datasource> 这是抛出异常的地方 public void start() { /* // The type of the datasource ManagedObjectImpl mo2 = new ManagedObjectImpl(ManagedConnectionFactoryDeploymentGroup.class.getName()); DefaultFieldsImpl dsTypeField = new DefaultFieldsImpl(); setFieldName("datasource-type", dsTypeField); dsTypeField.setDescription("The type of the DataSource"); dsTypeField.setMandatory(true); dsTypeField.setValue("local-tx-datasource"); HashSet<MetaValue> values = new HashSet<MetaValue>(); values.add(SimpleValueSupport.wrap("local-tx-datasource")); values.add(SimpleValueSupport.wrap("no-tx-datasource")); values.add(SimpleValueSupport.wrap("xa-datasource")); values.add(SimpleValueSupport.wrap("no-tx-connection-factory")); values.add(SimpleValueSupport.wrap("tx-connection-factory")); dsTypeField.setLegalValues(values); dsTypeField.setMetaType(SimpleMetaType.STRING); ManagedPropertyImpl dsTypeProp = new ManagedPropertyImpl(mo2, dsTypeField); super.addProperty(dsTypeProp); if(this.dsType != null) dsTypeField.setValue(this.dsType); else this.dsType = (String)dsTypeField.getValue(); */ // DataSource if("local-tx-datasource".equals(dsType)) createLocalTxDsTemplate(); else if("xa-datasource".equals(dsType)) createXaDsTemplate(); else if("tx-connection-factory".equals(dsType)) createTxCfTemplate(); else if("no-tx-datasource".equals(dsType)) createNoTxDsTemplate(); else if("no-tx-connection-factory".equals(dsType)) createNoTxCfTemplate(); else throw new IllegalStateException("Unsupported dsType: " + dsType); } 它应该执行这个吧 if("local-tx-datasource".equals(dsType)) createLocalTxDsTemplate(); 可却抛出了这个异常~貌似这个ds配置文件没有被应用进来 [b]问题补充:[/b] 我在bootstrap\deployers\jca-deployers-beans.xml中找到的 <!-- The template for creating a datasource --> <bean name="DsDataSourceTemplate" class="org.jboss.resource.deployers.management.DsDataSourceTemplate"> <property name="info"><inject bean="DsDataSourceTemplateInfo"/></property> </bean> <bean name="DsDataSourceTemplateInfo" class="org.jboss.resource.deployers.management.DsDataSourceTemplateInfo"> <constructor> <parameter>DsDataSourceTemplate</parameter> <parameter>A template for *-ds.xml deployments</parameter> <parameter>org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentGroup</parameter> </constructor> </bean> 根据DsDataSourceTemplateInfo类的构造器可以看出,只是简单的把org.jboss.resource.metadata.mcf.ManagedConnectionFactoryDeploymentGroup这个当作字符串传递给dsType public DsDataSourceTemplateInfo(String name, String description, String datasourceType) { super(name, description); this.dsType = datasourceType; } 所以我把传进去的参数改成<parameter>local-tx-datasource</parameter> 却出现另一个问题了。。 WARN 24-01 15:51:33,468 (UnifiedLoaderRepository3.java:addClassLoader:713) -Tried to add non-URLClassLoader. Ignored WARN 24-01 15:51:34,687 (TxControl.java:<clinit>:302) -[com.arjuna.ats.arjuna.coordinator.TxControl_1] - Name of XA node not defined. Using -3f57fe9c:852:497ac886:0 WARN 24-01 15:51:35,500 (AspectManagerService.java:baseAop:228) -Could not find base-aspects.xml file in the resources of sun.misc.Launcher$AppClassLoader@19821f WARN 24-01 15:51:39,859 (SecurityMetadataStore.java:checkDefaultSuckerPassword:311) -WARNING! POTENTIAL SECURITY RISK. It has been detected that the MessageSucker component which sucks messages from one node to another has not had its password changed from the installation default. Please see the JBoss Messaging user guide for instructions on how to do this. WARN 24-01 15:51:40,015 (ConnectionFactoryJNDIMapper.java:registerConnectionFactory:155) -supportsFailover attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support failover WARN 24-01 15:51:40,015 (ConnectionFactoryJNDIMapper.java:registerConnectionFactory:161) -supportsLoadBalancing attribute is true on connection factory: jboss.messaging.connectionfactory:service=ClusteredConnectionFactory but post office is non clustered. So connection factory will *not* support load balancing ERROR 24-01 15:51:41,421 (AbstractController.java:incrementState:755) -Error installing to Real: name=vfsfile:/D:/workspaces.bak/myseam-test/bin/ state=PostClassLoader mode=Manual requiredState=Real org.jboss.deployment.DeploymentException: Error during install jboss.jca:service=ManagedConnectionFactory,name=myseamDatasource at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:52) at org.jboss.system.ServiceController.install(ServiceController.java:277) at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:98) at org.jboss.system.deployers.ServiceDeployer.deploy(ServiceDeployer.java:46) at org.jboss.deployers.spi.deployer.helpers.AbstractSimpleRealDeployer.internalDeploy(AbstractSimpleRealDeployer.java:65) at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50) at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:169) at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:853) at org.jboss.deployers.plugins.deployers.DeployersImpl.doInstallParentFirst(DeployersImpl.java:874) at org.jboss.deployers.plugins.deployers.DeployersImpl.install(DeployersImpl.java:794) at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:327) at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1309) at org.jboss.dependency.plugins.AbstractController.incrementState(AbstractController.java:734) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:862) at org.jboss.dependency.plugins.AbstractController.resolveContexts(AbstractController.java:784) at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:622) at org.jboss.dependency.plugins.AbstractController.change(AbstractController.java:411) at org.jboss.deployers.plugins.deployers.DeployersImpl.process(DeployersImpl.java:498) at org.jboss.deployers.plugins.main.MainDeployerImpl.process(MainDeployerImpl.java:506) at org.jboss.embedded.DeploymentGroup.process(DeploymentGroup.java:127) at org.jboss.embedded.Bootstrap.deployResourceBases(Bootstrap.java:289) at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:15) at org.jboss.seam.mock.AbstractSeamTest.startJbossEmbeddedIfNecessary(AbstractSeamTest.java:1025) at org.jboss.seam.mock.AbstractSeamTest.startSeam(AbstractSeamTest.java:916) at org.jboss.seam.mock.SeamTest.startSeam(SeamTest.java:58) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:580) at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:398) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:145) at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:82) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:278) at org.testng.SuiteRunner.run(SuiteRunner.java:198) at org.testng.TestNG.createAndRunSuiteRunners(TestNG.java:823) at org.testng.TestNG.runSuitesLocally(TestNG.java:790) at org.testng.TestNG.run(TestNG.java:708) at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:73) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:124) Caused by: java.lang.IllegalStateException: jboss.jca:name=myseamDatasource,service=ManagedConnectionFactory is already installed. at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:525) at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:398) at org.jboss.system.ServiceController.doInstall(ServiceController.java:641) at org.jboss.system.ServiceController.install(ServiceController.java:271) ... 38 more WARN 24-01 15:51:42,687 (JBossTimerServiceFactory.java:restoreTimerService:113) -TIMER SERVICE IS NOT INSTALLED FAILED CONFIGURATION: @BeforeSuite startSeam org.jboss.deployers.client.spi.IncompleteDeploymentException: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS): *** CONTEXTS IN ERROR: Name -> Error vfsfile:/D:/workspaces.bak/myseam-test/bin/ -> java.lang.IllegalStateException: jboss.jca:name=myseamDatasource,service=ManagedConnectionFactory is already installed. at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:576) at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:559) at org.jboss.embedded.DeploymentGroup.process(DeploymentGroup.java:128) at org.jboss.embedded.Bootstrap.deployResourceBases(Bootstrap.java:289) at org.jboss.seam.mock.EmbeddedBootstrap.startAndDeployResources(EmbeddedBootstrap.java:15) at org.jboss.seam.mock.AbstractSeamTest.startJbossEmbeddedIfNecessary(AbstractSeamTest.java:1025) at org.jboss.seam.mock.AbstractSeamTest.startSeam(AbstractSeamTest.java:916) at org.jboss.seam.mock.SeamTest.startSeam(SeamTest.java:58) ... Removed 15 stack frames SKIPPED CONFIGURATION: @BeforeClass setupClass SKIPPED CONFIGURATION: @BeforeMethod begin SKIPPED CONFIGURATION: @AfterMethod end SKIPPED CONFIGURATION: @AfterClass cleanupClass SKIPPED: test_welcome 可是我不知道这样改对不对?还有这是什么意思jboss.jca:name=myseamDatasource,service=ManagedConnectionFactory is already installed.
appium+java中,findelement一直报错Software caused connection abort: recv failed,怎么解决?
这是导的包!!!!! ![图片说明](https://img-ask.csdn.net/upload/201905/14/1557826351_104305.png) 框架写好之后能跑通,但是在test里面加findelement,不管用什么定位方法,都会报错 Software caused connection abort: recv failed ``` FAILED: test org.openqa.selenium.WebDriverException: java.net.SocketException: Software caused connection abort: recv failed Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T15:15:08.936Z' System info: host: 'XYDAN', ip: '192.168.40.163', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_201' Driver info: driver.version: AndroidDriver at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:84) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543) at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:51) at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1) at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:317) at io.appium.java_client.DefaultGenericMobileDriver.findElement(DefaultGenericMobileDriver.java:67) at io.appium.java_client.AppiumDriver.findElement(AppiumDriver.java:1) at io.appium.java_client.android.AndroidDriver.findElement(AndroidDriver.java:1) at org.openqa.selenium.remote.RemoteWebDriver.findElementById(RemoteWebDriver.java:363) at io.appium.java_client.DefaultGenericMobileDriver.findElementById(DefaultGenericMobileDriver.java:75) at io.appium.java_client.AppiumDriver.findElementById(AppiumDriver.java:1) at io.appium.java_client.android.AndroidDriver.findElementById(AndroidDriver.java:1) at Test1.Test11.test(Test11.java:64) 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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108) at org.testng.internal.Invoker.invokeMethod(Invoker.java:661) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) at org.testng.TestRunner.privateRun(TestRunner.java:744) at org.testng.TestRunner.run(TestRunner.java:602) at org.testng.SuiteRunner.runTest(SuiteRunner.java:380) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340) at org.testng.SuiteRunner.run(SuiteRunner.java:289) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301) at org.testng.TestNG.runSuitesLocally(TestNG.java:1226) at org.testng.TestNG.runSuites(TestNG.java:1144) at org.testng.TestNG.run(TestNG.java:1115) at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76) Caused by: java.net.SocketException: Software caused connection abort: recv failed at java.net.SocketInputStream.socketRead0(Native Method) at java.net.SocketInputStream.socketRead(Unknown Source) at java.net.SocketInputStream.read(Unknown Source) at java.net.SocketInputStream.read(Unknown Source) at org.apache.http.impl.io.SessionInputBufferImpl.streamRead(SessionInputBufferImpl.java:137) at org.apache.http.impl.io.SessionInputBufferImpl.fillBuffer(SessionInputBufferImpl.java:153) at org.apache.http.impl.io.SessionInputBufferImpl.readLine(SessionInputBufferImpl.java:282) at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:138) at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56) at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259) at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:163) at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:165) at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:273) at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125) at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:272) at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185) at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56) at org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:154) at org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:96) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:155) at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:69) ... 38 more =============================================== Default test Tests run: 1, Failures: 1, Skips: 0 =============================================== =============================================== Default suite Total tests run: 1, Failures: 1, Skips: 0 =============================================== ``` 求大神帮助
java soap发送到webService服务端问题
问题: 以下这个报错 求大神怎么解决 报错 com.sun.xml.internal.ws.client.ClientTransportException: HTTP 传输错误: java.net.ConnectException: Connection refused: connect at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.getOutput(HttpClientTransport.java:117) at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:208) at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:130) at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:124) at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:1121) at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:1035) at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:1004) at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:862) at com.sun.xml.internal.ws.client.Stub.process(Stub.java:448) at com.sun.xml.internal.ws.client.dispatch.DispatchImpl.doInvoke(DispatchImpl.java:250) at com.sun.xml.internal.ws.client.dispatch.DispatchImpl.invoke(DispatchImpl.java:289) at com.hzyx.his.test.SoapTest.test2(SoapTest.java:78) 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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108) at org.testng.internal.Invoker.invokeMethod(Invoker.java:661) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) at org.testng.TestRunner.privateRun(TestRunner.java:744) at org.testng.TestRunner.run(TestRunner.java:602) at org.testng.SuiteRunner.runTest(SuiteRunner.java:380) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340) at org.testng.SuiteRunner.run(SuiteRunner.java:289) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301) at org.testng.TestNG.runSuitesLocally(TestNG.java:1226) at org.testng.TestNG.runSuites(TestNG.java:1144) at org.testng.TestNG.run(TestNG.java:1115) at org.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:72) at org.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:127) 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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method) at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79) at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) at java.net.Socket.connect(Socket.java:589) at java.net.Socket.connect(Socket.java:538) at sun.net.NetworkClient.doConnect(NetworkClient.java:180) at sun.net.www.http.HttpClient.openServer(HttpClient.java:432) at sun.net.www.http.HttpClient.openServer(HttpClient.java:527) at sun.net.www.http.HttpClient.<init>(HttpClient.java:211) at sun.net.www.http.HttpClient.New(HttpClient.java:308) at sun.net.www.http.HttpClient.New(HttpClient.java:326) at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1202) at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1181) at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1032) at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:966) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream0(HttpURLConnection.java:1316) at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1291) at com.sun.xml.internal.ws.transport.http.client.HttpClientTransport.getOutput(HttpClientTransport.java:104) ... 40 more 源码: //webservice命名空间 String ns = "http://services.agent.sinobest.cn/"; //wsdl地址 String wsdlUrl = "http://localhost:8080/Service?wsdl"; URL url = new URL(wsdlUrl); //创建服务 Webservice类名:Service QName sName = new QName(ns, "Service"); Service service = Service.create(url, sName); // 创建Dispatch对象 通过SOAPMessage 方式 QName qName = new QName(ns, "ServicePort"); Dispatch<SOAPMessage> dispatch = service.createDispatch(new QName(ns, "Service"), SOAPMessage.class, Service.Mode.MESSAGE); // 创建SOAPMessage SOAPMessage msg = MessageFactory.newInstance( SOAPConstants.SOAP_1_2_PROTOCOL).createMessage(); msg.setProperty(SOAPMessage.CHARACTER_SET_ENCODING, "UTF-8"); SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope(); // 创建SOAPBody SOAPBody body = envelope.getBody(); //设置参数 QName ename = new QName(ns, "login", "ser"); SOAPBodyElement ele = body.addBodyElement(ename); ele.addChildElement("arg0").setValue("100"); //输出传递参数 msg.writeTo(System.out); // 通过Dispatch传递消息,会返回响应消息 SOAPMessage response = dispatch.invoke(msg);
用Selenium自动化测试android wap页面报错
@Test(dataProvider="Data",enabled=true) public void testBaidu(String userName,String phone) throws InterruptedException { driver.get("http://..../...."); System.out.println("---=="+driver.getTitle()); driver.findElement(By.id("username")); driver.findElement(By.id("username")).clear(); driver.findElement(By.id("username")).sendKeys(userName); driver.findElement(By.id("mobile")).click(); driver.findElement(By.id("mobile")).clear(); driver.findElement(By.id("mobile")).sendKeys(phone); driver.findElement(By.xpath(".//*[@id='free_sign']")).click(); if (userName.equals("")||userName==null) { WebElement ele=driver.findElement(By.xpath("html/body/div[4]")); System.out.println("---"+ele.getText()); Assert.assertTrue(ele.getText().contains("请输入您的姓名")); }else if (userName!=null&&phone.equals("")||phone==null) { WebElement ele=driver.findElement(By.xpath("html/body/div[4]")); System.out.println("---"+ele.getText()); Assert.assertTrue(ele.getText().contains("请输入您的手机号码")); }else if (phone.length()<11||phone.length()>11) { WebElement ele=driver.findElement(By.xpath("html/body/div[4]")); System.out.println("---"+ele.getText()); Assert.assertTrue(ele.getText().contains("对不起,您输入的手机号码有误")); }else if (!userName.equals("")&&userName!=null&&phone.length()==11) { Assert.assertTrue(driver.getCurrentUrl().contains("http://...../....")); System.out.println("--"+driver.getCurrentUrl()); } } org.openqa.selenium.WebDriverException: java.lang.Double cannot be cast to java.lang.Long Command duration or timeout: 190 milliseconds Build info: version: '2.25.0', revision: '17482', time: '2012-07-18 21:08:56' System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_51' Driver info: driver.version: RemoteWebDriver Session ID: 1474942130373 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.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:188) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:145) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:498) at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:244) at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:77) at androiddemo.AndroidWap.testBaidu(AndroidWap.java:59) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:100) at org.testng.internal.Invoker.invokeMethod(Invoker.java:646) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:811) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1129) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112) at org.testng.TestRunner.privateRun(TestRunner.java:746) at org.testng.TestRunner.run(TestRunner.java:600) at org.testng.SuiteRunner.runTest(SuiteRunner.java:366) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319) at org.testng.SuiteRunner.run(SuiteRunner.java:268) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1264) at org.testng.TestNG.runSuitesLocally(TestNG.java:1189) at org.testng.TestNG.runSuites(TestNG.java:1104) at org.testng.TestNG.run(TestNG.java:1076) at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:126) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:152) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:57)
appium测试微信公众号出现Could not find package com.android.chrome on the device的问题
1.新手,想在微信上面测试公众号,用的是appium+java,写了测试用例然后run的时候一直报错,没有找到解决方案,求大神指点,在线等!! 2.以下是我的代码: 初始化init类: ``` package appiumDemo; import java.io.File; import java.net.MalformedURLException; import java.net.URL; import java.util.concurrent.TimeUnit; import org.openqa.selenium.chrome.ChromeOptions; import org.openqa.selenium.remote.CapabilityType; import org.openqa.selenium.remote.DesiredCapabilities; import io.appium.java_client.android.AndroidDriver; public class InitAppium { public static AndroidDriver launchApp(String deviceName) throws MalformedURLException { // 设置自动化相关参数 DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability(CapabilityType.BROWSER_NAME, ""); // 使用哪种移动平台 capabilities.setCapability("platformName", "Android"); // 启动哪种设备,是真机还是模拟器 capabilities.setCapability("deviceName", deviceName); // 如果是模拟器输入Android Emulator 红米note3 db3489d // 不要再次安装apk capabilities.setCapability("noReset", true); // 不用重新签名 capabilities.setCapability("noSign", true); // 设置安卓系统版本 capabilities.setCapability("platformVersion", "7.1"); // 支持unicode键盘,输入中文设置 capabilities.setCapability("unicodeKeyboard", "True"); capabilities.setCapability("resetKeyboard", "True"); // 设置app的主包名和主类名 capabilities.setCapability("appPackage","com.tencent.mm"); capabilities.setCapability("appActivity", "com.tencent.mm.ui.LauncherUI"); ChromeOptions options = new ChromeOptions(); options.setExperimentalOption("androidProcess", "com.tencent.mm:tools"); capabilities.setCapability(ChromeOptions.CAPABILITY, options); AndroidDriver driver = new AndroidDriver(new URL("http://169.254.82.105:4723/wd/hub"), capabilities); driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS); return driver; } } ``` 测试类代码如下: ``` package appiumDemo; import java.net.MalformedURLException; import org.testng.annotations.Test; import io.appium.java_client.android.AndroidDriver; public class NewTest { private AndroidDriver driver; @SuppressWarnings("static-access") @Test public void f() { InitAppium init=new InitAppium(); try { init.launchApp("c353ce90"); } catch (MalformedURLException e) { e.printStackTrace(); } driver.findElementById("com.tencent.mm:id/azj").click(); } } ``` 3.报错信息 ``` [RemoteTestNG] failed to get TestNG version from class: java.lang.ClassNotFoundException: org.testng.internal.Version [RemoteTestNG] now trying to parse the version from pom.properties [RemoteTestNG] parsing TestNG version at jar:file:/E:/test/Tools/maven/maven-repository/org/testng/testng/6.1.1/testng-6.1.1.jar!/META-INF/maven/org.testng/testng/pom.properties [RemoteTestNG] detected TestNG version 6.1.1 [TestNG] Running: C:\Users\vanchu\AppData\Local\Temp\testng-eclipse-1879104749\testng-customsuite.xml FAILED: f org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not find package com.android.chrome on the device (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 9.90 seconds Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:32.194Z' System info: host: 'DESKTOP-GBO4D78', ip: '169.254.151.82', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_91' Driver info: driver.version: AndroidDriver at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166) at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53) at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91) at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:123) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source) at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source) at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.util.stream.ReferencePipeline.findFirst(Unknown Source) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142) at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:89) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601) at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42) at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1) at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1) at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:219) at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:142) at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:38) at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:87) at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:111) at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:72) at appiumDemo.InitAppium.launchApp(InitAppium.java:54) at appiumDemo.NewTest.f(NewTest.java:16) 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.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80) at org.testng.internal.Invoker.invokeMethod(Invoker.java:673) at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:842) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1166) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109) at org.testng.TestRunner.runWorkers(TestRunner.java:1178) at org.testng.TestRunner.privateRun(TestRunner.java:757) at org.testng.TestRunner.run(TestRunner.java:608) at org.testng.SuiteRunner.runTest(SuiteRunner.java:334) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291) at org.testng.SuiteRunner.run(SuiteRunner.java:240) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1158) at org.testng.TestNG.runSuitesLocally(TestNG.java:1083) at org.testng.TestNG.run(TestNG.java:999) at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77) =============================================== Default test Tests run: 1, Failures: 1, Skips: 0 =============================================== =============================================== Default suite Total tests run: 1, Failures: 1, Skips: 0 =============================================== [TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@6e6d5e: 1485 ms [TestNG] Time taken by [TestListenerAdapter] Passed:0 Failed:0 Skipped:0]: 296 ms [TestNG] Time taken by org.testng.reporters.XMLReporter@1f256fa: 109 ms [TestNG] Time taken by org.testng.reporters.EmailableReporter@aa5eb0: 62 ms [TestNG] Time taken by org.testng.reporters.JUnitReportReporter@1ebec15: 8 ms ```
TestNG将data provider定义在其他的class中,最终的执行结果直接Skip了
问题描述:根据TestNG官方文档说明,可以将data Provider 定义在其他的类中,只需要将data provider的方法定义为静态方法,同时在引用data provider的时候指定dataProviderClass属性值即可,我按照这个流程进行操作,最后的运行结果却不是pass,而是skip,希望各位友人帮忙解答一下。 TestForDataProvider.java代码如下 ``` package com.testngdemo; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; class StaticProvider{ @DataProvider(name = "data1") public static Object[][] createData1(){ return new Object[][]{ {"heting", new Integer(23)}, {"zhougang", new Integer(31)} }; } } public class TestForDataProvider { @Test(dataProvider = "data1", dataProviderClass = StaticProvider.class) public void test1(String name, Integer age) { System.out.println(name + "的年纪:" + age + "岁"); } } ``` testng.xml文件内容如下 ``` <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > <suite name="suite1"> <test name="test1"> <classes> <class name="com.testngdemo.TestForDataProvider"></class> </classes> </test> </suite> ``` 执行结果如下 ![图片说明](https://img-ask.csdn.net/upload/201610/09/1476004202_657905.png) 官方文档如下: ![图片说明](https://img-ask.csdn.net/upload/201610/09/1476004268_164299.jpg)
maven junit testng 问题
maven构建的环境下,测试使用的是testNG。由于想看测试的覆盖率,于是装了个djunit插件(djunit基于junit)。 现象是:testNG运行ok,但是用junit或者djunit运行报错: junit.framework.AssertionFailedError: No tests found in XXXX(package-name) 我的测试文件是这么写的: import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import XXX.TsTypeMapping; import XXX.common.test.base.AbstractTestBase; public class TestTsTypeMapping extends AbstractTestBase { @BeforeClass public static void beforeClass() throws Exception { ... } @Test public void testTsTypeMapping() { ... } } 其中,class名以TestXXX开始,没问题;测试方法testXXX也没问题; class AbstractTestBase 是extends TestCase的应该也没问题; @Test也标记了 以上4点都满足junit的标准的 ps:我另外一个project里面也是这么测试的,testclass去extends AbstractTestBase,testNg和junit,djunit都可以跑的很流畅。现在的project里的testclass和之前的project的testclass 都是extends同一个AbstractTestBase的 希望指点究竟是哪里出了问题,应该怎么修改才既可以testNg也可以junit测试。 (我怀疑是maven的pom设置,但是不知道怎么设置。)
DateSource无法注入的问题,求教
数据源配置如下: <!-- 配置数据源 --> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" p:driverClassName="com.mysql.jdbc.Driver" p:url="jdbc:mysql://localhost:3306/sampledb" p:username="root" p:password="123" /> <!-- 配置Jdbc模板 --> <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate" p:dataSource-ref="dataSource" /> 报错如下: Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests.setDataSource(javax.sql.DataSource); nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.sql.DataSource] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {} org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.smart.service.UserServiceTest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests.setDataSource(javax.sql.DataSource); nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.sql.DataSource] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {} Caused by: org.springframework.beans.factory.BeanCreationException: Could not autowire method: public void org.springframework.test.context.testng.AbstractTransactionalTestNGSpringContextTests.setDataSource(javax.sql.DataSource); nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.sql.DataSource] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {} Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [javax.sql.DataSource] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
maven执行mvn package时,找不到相应的jar,请提供相应的中央库配置
请必须按下面的格式提供中央库,我复制过去就能用 <repository> <id>maven.oracle.com</id> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> <url>https://maven.oracle.com</url> <layout>default</layout> </repository> ================= [ERROR] Failed to execute goal on project automan-base: Could not resolve depend encies for project com.ailk.automan:automan-base:jar:0.0.1-SNAPSHOT: Failed to c ollect dependencies for [org.apache.ant:ant:jar:1.8.2 (compile), org.testng:test ng:jar:6.8.5 (compile), org.testmp:testsync:jar:1.0.0 (compile), commons-beanuti ls:commons-beanutils:jar:1.8.3 (compile), org.seleniumhq.selenium:selenium-serve r:jar:2.26.0 (compile), org.dbunit:dbunit:jar:2.2 (compile), dom4j:dom4j:jar:1.6 .1 (compile), joda-time:joda-time:jar:2.1 (compile), org.slf4j:slf4j-api:jar:1.7 .5 (compile), org.slf4j:slf4j-log4j12:pom:1.4.2 (compile), log4j:log4j:jar:1.2.1 7 (compile), ailk:jxl:jar:1.0 (compile), com.oracle:oracle:jar:10.2.0.1.0 (compi le), org.testmp:datastore-client:jar:1.0.0 (compile)]: Failed to read artifact d escriptor for com.oracle:oracle:jar:10.2.0.1.0: Could not transfer artifact com. oracle:oracle:pom:10.2.0.1.0 from/to maven.oracle.com (https://maven.oracle.com) : sun.security.validator.ValidatorException: PKIX path building failed: sun.secu rity.provider.certpath.SunCertPathBuilderException: unable to find valid certifi cation path to requested target -> [Help 1]
一个Spring框架的测试问题,总是调不通,求指教。
package com.chh; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.testng.AssertJUnit; import org.testng.annotations.Test; @Test @ContextConfiguration("/beans.xml") public class NewTest { @Autowired private ServiceImpl service; @Test public void getMessage(){ String msg = service.getMessage("abc"); AssertJUnit.assertEquals("abc", msg); } } 上面是我的测试代码,beans.xml放在src目录下。 service变量采用自动装配的方式引入。但是总是报错误。错误如下。 java.lang.NullPointerException at com.chh.NewTest.getMessage(NewTest.java:15) 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) 说的是service引用时一个空指针,也就是说service对象在容器中就没有。 现在怀疑Spring容器就没有正常启动,也就是说@ContextConfiguration("/beans.xml") 就没有启动容器。 不过一直找不到关键点所在,请大神指教我错在哪了?
testng 套件取值为空,apikey 和tellphone都为null
/** * Created by duanchangliang on 16/6/27. */ import com.sun.org.apache.xalan.internal.xsltc.compiler.util.TestGenerator; import com.yunpian.sdk.common.Config; import com.yunpian.sdk.model.*; import com.yunpian.sdk.service.*; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.*; import java.util.*; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.List; import static org.testng.Assert.assertEquals; @RunWith(Parameterized.class) public class SmsTest { //private String getTellphone; public static YunpianRestClient client; // YunpianRestClient client = new YunpianRestClient(); @BeforeClass public void init() { client = new YunpianRestClient("your apikey"); } @Parameters public static Collection<Object[]> data() { return Arrays.asList(new Object[][]{ {"单条发送短信","18868212479","【测试内容】请提供",0,"发送成功","aa1c3eec10d5d52d560028833eee41b4" } }); } /*** * 第一个测试用例名称 * 第二、三个是为传参 * 第四、五个是为预期结果 * 第六个为apikey * */ @Parameter(value = 0) public String testcase; @Parameter(value = 1) public String tellphone; @Parameter(value = 2) public String smsmsg; @Parameter(value = 3) public int smscode; @Parameter(value = 4) public String backmsg; @Parameter(value = 5) public String apikey; @Test public void testSendSms() throws UnsupportedEncodingException{ YunpianRestClient client = new YunpianRestClient(apikey); SmsOperator smsOperator = client.getSmsOperator(); System.out.println("apikey值为:" + apikey); System.out.println("用户手机号为:" + tellphone); // 单条发送 ResultDO<SendSingleSmsInfo> r1 = smsOperator.singleSend(tellphone, smsmsg); System.out.println(r1); int code = r1.getData().getCode(); String msg = r1.getData().getMsg(); assertEquals(code, smscode); assertEquals(msg,backmsg); System.out.print(code); } }
testng-xslt-1.1.2美化报告中,ant build.xml时报错
transform: [xslt] Processing G:\workspace\irobot\irobot\test-output\auto\testng-results.xml to G:\workspace\irobot\irobot\test-output\auto\xsltresult.html [xslt] Loading stylesheet G:\workspace\irobot\irobot\test-output\testng-results.xsl [xslt] G:\workspace\irobot\irobot\test-output\testng-results.xsl:411: Fatal Error! Failed to create output file file:////./test-output/auto//style.css Cause: java.io.IOException: 系统找不到指定的路径。 [xslt] Failed to process G:\workspace\irobot\irobot\test-output\auto\testng-results.xml BUILD FAILED G:\workspace\irobot\irobot\build.xml:49: Fatal error during transformation using G:\workspace\irobot\irobot\test-output\testng-results.xsl: Failed to create output file file:////./test-output/auto//style.css; SystemID: file:/G:/workspace/irobot/irobot/test-output/testng-results.xsl; Line#: 411; Column#: -1 望大神们帮忙看看,谢谢!
eclipse neon 4.6.3安装插件报错
安装testGN一直报错如下 An error occurred while collecting items to be installed session context was:(profile=D__Users_Chao_eclipse_jee-neon4_eclipse, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=). Problems downloading artifact: org.eclipse.update.feature,org.testng.eclipse,6.11.0.201703011520. MD5 hash is not as expected. Expected: ffa6840be2b1d30cf18ad443d69c7216 and found 5709aaa01a32589404bddb73dd490d01. 我在网上找了许多方法都没有解决这个问题,大家有遇到过的么?
testng,excel与xml问题,或者怎么把excel转化成testng能识别的xml格式?
testng执行自动化测试,可以用xml,或用excel提供数据,执行testng时,第一步是把数据的格式都转化成xml格式,如:test[TestNG] Running:C:\Users\xu\AppData\Local\Temp\testng-eclipse--979724775\testng-customsuite.xml,请问testng组件具体是怎么将excel转化成xml的? 或者怎么把excel转化成testng能识别的xml格式?
在eclipse中在线安装TestNG插件后,没有testng选项,很多方法都试过了
在eclipse中在线安装TestNG插件后,没有testng选项,很多方法都试过了,求大神给解决啊方法,最好有详细过程,或者是安装过程中要注意什么,在线等,谢啦 ![view界面](https://img-ask.csdn.net/upload/201509/01/1441078632_788117.png) ![new界面](https://img-ask.csdn.net/upload/201509/01/1441078674_872414.png)
研究struts2源码时启动服务器报错
错误信息: com.opensymphony.xwork2.util.logging.commons.CommonsLogger error 严重: Dispatcher initialization failed Unable to load configuration. - Class: java.net.URL File: URL.java Method: <init> Line: 601 - java/net/URL.java:601:-1 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:69) at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:390) at ..... 引用: asm-3.3.1.jar commons-lang-2.6-javadoc.jar commons-lang-2.6-sources.jar commons-lang-2.6.jar velocity-1.5.jar velocity-1.6.2-dep.jar velocity-tools-1.3.jar commons-logging-api-1.1.jar commons-fileupload.jar commons-io.jar freemarker-2.3.15.jar ognl-3.0.4.jar asm-commons-3.1.jar spring.jar testng-5.8-jdk15.jar src下面除了struts2的源码外,还有 struts-default.xml struts.xml struts-default.xml是从别的项目中copy来的 struts.xml
终于明白阿里百度这样的大公司,为什么面试经常拿ThreadLocal考验求职者了
点击上面↑「爱开发」关注我们每晚10点,捕获技术思考和创业资源洞察什么是ThreadLocalThreadLocal是一个本地线程副本变量工具类,各个线程都拥有一份线程私有的数
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
此博客仅为我业余记录文章所用,发布到此,仅供网友阅读参考,如有侵权,请通知我,我会删掉。 补充 有不少读者留言说本文章没有用,因为天气预报直接打开手机就可以收到了,为何要多此一举发送到邮箱呢!!!那我在这里只能说:因为你没用,所以你没用!!! 这里主要介绍的是思路,不是天气预报!不是天气预报!!不是天气预报!!!天气预报只是用于举例。请各位不要再刚了!!! 下面是我会用到的两个场景: 每日下
面试官问我:什么是消息队列?什么场景需要他?用了会出现什么问题?
你知道的越多,你不知道的越多 点赞再看,养成习惯 GitHub上已经开源 https://github.com/JavaFamily 有一线大厂面试点脑图、个人联系方式,欢迎Star和完善 前言 消息队列在互联网技术存储方面使用如此广泛,几乎所有的后端技术面试官都要在消息队列的使用和原理方面对小伙伴们进行360°的刁难。 作为一个在互联网公司面一次拿一次Offer的面霸,打败了无数
8年经验面试官详解 Java 面试秘诀
    作者 | 胡书敏 责编 | 刘静 出品 | CSDN(ID:CSDNnews) 本人目前在一家知名外企担任架构师,而且最近八年来,在多家外企和互联网公司担任Java技术面试官,前后累计面试了有两三百位候选人。在本文里,就将结合本人的面试经验,针对Java初学者、Java初级开发和Java开发,给出若干准备简历和准备面试的建议。   Java程序员准备和投递简历的实
究竟你适不适合买Mac?
我清晰的记得,刚买的macbook pro回到家,开机后第一件事情,就是上了淘宝网,花了500元钱,找了一个上门维修电脑的师傅,上门给我装了一个windows系统。。。。。。 表砍我。。。 当时买mac的初衷,只是想要个固态硬盘的笔记本,用来运行一些复杂的扑克软件。而看了当时所有的SSD笔记本后,最终决定,还是买个好(xiong)看(da)的。 已经有好几个朋友问我mba怎么样了,所以今天尽量客观
MyBatis研习录(01)——MyBatis概述与入门
C语言自学完备手册(33篇) Android多分辨率适配框架 JavaWeb核心技术系列教程 HTML5前端开发实战系列教程 MySQL数据库实操教程(35篇图文版) 推翻自己和过往——自定义View系列教程(10篇) 走出思维困境,踏上精进之路——Android开发进阶精华录 讲给Android程序员看的前端系列教程(40集免费视频教程+源码) 版权声明 本文原创作者:谷哥的小弟 作者博客
程序员一般通过什么途径接私活?
二哥,你好,我想知道一般程序猿都如何接私活,我也想接,能告诉我一些方法吗? 上面是一个读者“烦不烦”问我的一个问题。其实不止是“烦不烦”,还有很多读者问过我类似这样的问题。 我接的私活不算多,挣到的钱也没有多少,加起来不到 20W。说实话,这个数目说出来我是有点心虚的,毕竟太少了,大家轻喷。但我想,恰好配得上“一般程序员”这个称号啊。毕竟苍蝇再小也是肉,我也算是有经验的人了。 唾弃接私活、做外
Python爬虫爬取淘宝,京东商品信息
小编是一个理科生,不善长说一些废话。简单介绍下原理然后直接上代码。 使用的工具(Python+pycharm2019.3+selenium+xpath+chromedriver)其中要使用pycharm也可以私聊我selenium是一个框架可以通过pip下载 pip install selenium -i https://pypi.tuna.tsinghua.edu.cn/simple/ 
阿里程序员写了一个新手都写不出的低级bug,被骂惨了。
你知道的越多,你不知道的越多 点赞再看,养成习惯 本文 GitHub https://github.com/JavaFamily 已收录,有一线大厂面试点思维导图,也整理了很多我的文档,欢迎Star和完善,大家面试可以参照考点复习,希望我们一起有点东西。 前前言 为啥今天有个前前言呢? 因为你们的丙丙啊,昨天有牌面了哟,直接被微信官方推荐,知乎推荐,也就仅仅是还行吧(心里乐开花)
Java工作4年来应聘要16K最后没要,细节如下。。。
前奏: 今天2B哥和大家分享一位前几天面试的一位应聘者,工作4年26岁,统招本科。 以下就是他的简历和面试情况。 基本情况: 专业技能: 1、&nbsp;熟悉Sping了解SpringMVC、SpringBoot、Mybatis等框架、了解SpringCloud微服务 2、&nbsp;熟悉常用项目管理工具:SVN、GIT、MAVEN、Jenkins 3、&nbsp;熟悉Nginx、tomca
Python爬虫精简步骤1 获取数据
爬虫的工作分为四步: 1.获取数据。爬虫程序会根据我们提供的网址,向服务器发起请求,然后返回数据。 2.解析数据。爬虫程序会把服务器返回的数据解析成我们能读懂的格式。 3.提取数据。爬虫程序再从中提取出我们需要的数据。 4.储存数据。爬虫程序把这些有用的数据保存起来,便于你日后的使用和分析。 这一篇的内容就是:获取数据。 首先,我们将会利用一个强大的库——requests来获取数据。 在电脑上安装
Python绘图,圣诞树,花,爱心 | Turtle篇
1.画圣诞树 import turtle screen = turtle.Screen() screen.setup(800,600) circle = turtle.Turtle() circle.shape('circle') circle.color('red') circle.speed('fastest') circle.up() square = turtle.Turtle()
作为一个程序员,CPU的这些硬核知识你必须会!
CPU对每个程序员来说,是个既熟悉又陌生的东西? 如果你只知道CPU是中央处理器的话,那可能对你并没有什么用,那么作为程序员的我们,必须要搞懂的就是CPU这家伙是如何运行的,尤其要搞懂它里面的寄存器是怎么一回事,因为这将让你从底层明白程序的运行机制。 随我一起,来好好认识下CPU这货吧 把CPU掰开来看 对于CPU来说,我们首先就要搞明白它是怎么回事,也就是它的内部构造,当然,CPU那么牛的一个东
破14亿,Python分析我国存在哪些人口危机!
2020年1月17日,国家统计局发布了2019年国民经济报告,报告中指出我国人口突破14亿。 猪哥的朋友圈被14亿人口刷屏,但是很多人并没有看到我国复杂的人口问题:老龄化、男女比例失衡、生育率下降、人口红利下降等。 今天我们就来分析一下我们国家的人口数据吧! 更多有趣分析教程,扫描下方二维码关注vx公号「裸睡的猪」 即可查看! 一、背景 1.人口突破14亿 2020年1月17日,国家统计局发布
web前端javascript+jquery知识点总结
Javascript javascript 在前端网页中占有非常重要的地位,可以用于验证表单,制作特效等功能,它是一种描述语言,也是一种基于对象(Object)和事件驱动并具有安全性的脚本语言 ,语法同java类似,是一种解释性语言,边执行边解释。 JavaScript的组成: ECMAScipt 用于描述: 语法,变量和数据类型,运算符,逻辑控制语句,关键字保留字,对象。 浏览器对象模型(Br
Python实战:抓肺炎疫情实时数据,画2019-nCoV疫情地图
文章目录1. 前言2. 数据下载3. 数据处理4. 数据可视化 1. 前言 今天,群里白垩老师问如何用python画武汉肺炎疫情地图。白垩老师是研究海洋生态与地球生物的学者,国家重点实验室成员,于不惑之年学习python,实为我等学习楷模。先前我并没有关注武汉肺炎的具体数据,也没有画过类似的数据分布图。于是就拿了两个小时,专门研究了一下,遂成此文。 2月6日追记:本文发布后,腾讯的数据源多次变更u
听说想当黑客的都玩过这个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的这些硬核知识你必须会! 作为一个程序员,内存的这些硬核知识你必须懂! 这些知识可以说是我们之前都不太重视的基础知识,可能大家在上大学的时候都学习过了,但是嘞,当时由于老师讲解的没那么有趣,又加上这些知识本身就比较枯燥,所以嘞,大家当初几乎等于没学。 再说啦,学习这些,也看不出来有什么用啊!
渗透测试-灰鸽子远控木马
木马概述 灰鸽子( Huigezi),原本该软件适用于公司和家庭管理,其功能十分强大,不但能监视摄像头、键盘记录、监控桌面、文件操作等。还提供了黑客专用功能,如:伪装系统图标、随意更换启动项名称和表述、随意更换端口、运行后自删除、毫无提示安装等,并采用反弹链接这种缺陷设计,使得使用者拥有最高权限,一经破解即无法控制。最终导致被黑客恶意使用。原作者的灰鸽子被定义为是一款集多种控制方式于一体的木马程序
Python:爬取疫情每日数据
前言 有部分同学留言说为什么412,这是因为我代码里全国的cookies需要你自己打开浏览器更新好后替换,而且这个cookies大概只能持续20秒左右! 另外全国卫健委的数据格式一直在变,也有可能会导致爬取失败! 我现在已根据2月14日最新通报稿的格式修正了! 目前每天各大平台,如腾讯、今日头条都会更新疫情每日数据,他们的数据源都是一样的,主要都是通过各地的卫健委官网通报。 为什么已经有大量平台做
这个世界上人真的分三六九等,你信吗?
偶然间,在知乎上看到一个问题 一时间,勾起了我深深的回忆。 以前在厂里打过两次工,做过家教,干过辅导班,做过中介。零下几度的晚上,贴过广告,满脸、满手地长冻疮。   再回首那段岁月,虽然苦,但让我学会了坚持和忍耐。让我明白了,在这个世界上,无论环境多么的恶劣,只要心存希望,星星之火,亦可燎原。   下文是原回答,希望能对你能有所启发。   如果我说,这个世界上人真的分三六九等,
B 站上有哪些很好的学习资源?
哇说起B站,在小九眼里就是宝藏般的存在,放年假宅在家时一天刷6、7个小时不在话下,更别提今年的跨年晚会,我简直是跪着看完的!! 最早大家聚在在B站是为了追番,再后来我在上面刷欧美新歌和漂亮小姐姐的舞蹈视频,最近两年我和周围的朋友们已经把B站当作学习教室了,而且学习成本还免费,真是个励志的好平台ヽ(.◕ฺˇд ˇ◕ฺ;)ノ 下面我们就来盘点一下B站上优质的学习资源: 综合类 Oeasy: 综合
雷火神山直播超两亿,Web播放器事件监听是怎么实现的?
Web播放器解决了在手机浏览器和PC浏览器上播放音视频数据的问题,让视音频内容可以不依赖用户安装App,就能进行播放以及在社交平台进行传播。在视频业务大数据平台中,播放数据的统计分析非常重要,所以Web播放器在使用过程中,需要对其内部的数据进行收集并上报至服务端,此时,就需要对发生在其内部的一些播放行为进行事件监听。 那么Web播放器事件监听是怎么实现的呢? 01 监听事件明细表 名
3万字总结,Mysql优化之精髓
本文知识点较多,篇幅较长,请耐心学习 MySQL已经成为时下关系型数据库产品的中坚力量,备受互联网大厂的青睐,出门面试想进BAT,想拿高工资,不会点MySQL优化知识,拿offer的成功率会大大下降。 为什么要优化 系统的吞吐量瓶颈往往出现在数据库的访问速度上 随着应用程序的运行,数据库的中的数据会越来越多,处理时间会相应变慢 数据是存放在磁盘上的,读写速度无法和内存相比 如何优化 设计
Python新型冠状病毒疫情数据自动爬取+统计+发送报告+数据屏幕(三)发送篇
今天介绍的项目是使用 Itchat 发送统计报告 项目功能设计: 定时爬取疫情数据存入Mysql 进行数据分析制作疫情报告 使用itchat给亲人朋友发送分析报告(本文) 基于Django做数据屏幕 使用Tableau做数据分析 来看看最终效果 目前已经完成,预计2月12日前更新 使用 itchat 发送数据统计报告 itchat 是一个基于 web微信的一个框架,但微信官方并不允
作为程序员的我,大学四年一直自学,全靠这些实用工具和学习网站!
我本人因为高中沉迷于爱情,导致学业荒废,后来高考,毫无疑问进入了一所普普通通的大学,实在惭愧...... 我又是那么好强,现在学历不行,没办法改变的事情了,所以,进入大学开始,我就下定决心,一定要让自己掌握更多的技能,尤其选择了计算机这个行业,一定要多学习技术。 在进入大学学习不久后,我就认清了一个现实:我这个大学的整体教学质量和学习风气,真的一言难尽,懂的人自然知道怎么回事? 怎么办?我该如何更好的提升
粒子群算法求解物流配送路线问题(python)
粒子群算法求解物流配送路线问题(python) 1.查找论文文献 找一篇物流配送路径优化+粒子群算法求解的论文 参考文献:基于混沌粒子群算法的物流配送路径优化 2.了解粒子群算法的原理 讲解通俗易懂,有数学实例的博文:https://blog.csdn.net/daaikuaichuan/article/details/81382794 3.确定编码方式和解码策略 3.1编码方式 物流配送路线的
教你如何编写第一个简单的爬虫
很多人知道爬虫,也很想利用爬虫去爬取自己想要的数据,那么爬虫到底怎么用呢?今天就教大家编写一个简单的爬虫。 下面以爬取笔者的个人博客网站为例获取第一篇文章的标题名称,教大家学会一个简单的爬虫。 第一步:获取页面 #!/usr/bin/python # coding: utf-8 import requests #引入包requests link = "http://www.santostang.
前端JS初级面试题二 (。•ˇ‸ˇ•。)老铁们!快来瞧瞧自己都会了么
1. 传统事件绑定和符合W3C标准的事件绑定有什么区别? 传统事件绑定 &lt;div onclick=""&gt;123&lt;/div&gt; div1.onclick = function(){}; &lt;button onmouseover=""&gt;&lt;/button&gt; 注意: 如果给同一个元素绑定了两次或多次相同类型的事件,那么后面的绑定会覆盖前面的绑定 (不支持DOM事...
相关热词 c#如何定义数组列表 c#倒序读取txt文件 java代码生成c# c# tcp发送数据 c#解决时间格式带星期 c#类似hashmap c#设置istbox的值 c#获取多线程返回值 c# 包含数字 枚举 c# timespan
立即提问