jar包依赖 出现java.lang.NoClassDefFoundError异常

场景一:A.jar和B.jar两个文件(非原生),其中B.jar是依赖A.jar生成。B.jar生成后将其导入android工程内(不进行A.jar导入),操作B.jar中的私有接口正常运行,但操作A.jar实现接口时会报NoClassDefFoundError异常;A.jar同B.jar一并导入工程异常消失。

场景二:B.jar依赖apache HttpClient.jar包生成时,仅将B.jar导入工程时,调用HttpClient.jar内接口不会出现NoClassDefFoundError异常。

不知场景一、二的区别是什么?

2个回答

场景一中因为B依赖A,当导入B不导入A时,操作A的实现接口肯定是报错的,找不到类;

场景二中未出现异常的原因可能是项目中已经导入的jar包包含HttpClient.jar的内容(比如android.jar就包含HttpClient相关的内容),所以未出现异常

leotey
leotey android 6.0之前android.jar对org.apache.http相关接口进行支持,对场景二我使用的是android6.0进行编译,并部署在android6.0的手机上,调用接口运行正常。这又是为何??
3 年多之前 回复

场景一中因为B依赖A,当导入B不导入A时,操作A的实现接口肯定是报错的,找不到类,
场景二因为在android.support里面就支持了HttpClient,使用HttpClient也是android官方推荐的,已经包含了,所以不需要导jar。

leotey
leotey android 6.0之前android.jar对org.apache.http相关接口进行支持,对场景二我使用的是android6.0进行编译,并部署在android6.0的手机上,调用接口运行正常。这又是为何??
3 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Java创建文件出现 java.lang.NoClassDefFoundError:save/DI()wrong name: DI

package save; import java.io.*; public class DI { public static void main(String[] args) { File file = new File("news.txt"); System.out.println("在当前目录下创建文件"+file.getName()); if (!file.exists()) { try{ file.createNewFile(); System.out.println("创建成功"); } catch( IOException exp) {} } } }

报错java.lang.NoClassDefFoundError: org/apache/http/HttpEntity

maven已依赖: ``` <dependency> <groupId>org.apache.httpcomponents</groupId> <artifactId>httpclient</artifactId> <version>4.3.4</version> </dependency> ```

vscode 将java文件放到一个包时就会出现“找不到或无法加载主类java.lang.NoClassDefFoundError”的错误

![图片说明](https://img-ask.csdn.net/upload/202003/31/1585653163_254475.png) 当我加上第一句时就会出现占不到或无法加载主类的错误,左边的main1.class没有变颜色,但是就是在那个文件夹下 ![图片说明](https://img-ask.csdn.net/upload/202003/31/1585653266_939556.png) 把第一句去掉后就正常了

spring cloud zuul 使用注解@EnableZuulProxy项目启动报错,报java.lang.IllegalStateException!

自己搞的一个spring cloud 项目,在网关这里遇到了一个问题,在使用注解@EnableZuulProxy时项目不能启动且报错了,但是使用@EnableZuulServer注解启动一切正常。 报错信息如下: java.lang.IllegalStateException: Error processing condition on org.springframework.cloud.netflix.zuul.ZuulServerAutoConfiguration$ZuulCounterFactoryConfiguration.counterFactory at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:64) ~[spring-boot-autoconfigure-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.context.annotation.ConditionEvaluator.shouldSkip(ConditionEvaluator.java:108) ~[spring-context-5.1.7.RELEASE.jar:5.1.7.RELEASE] at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForBeanMethod(ConfigurationClassBeanDefinitionReader.java:181) ~[spring-context-5.1.7.RELEASE.jar:5.1.7.RELEASE] at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitionsForConfigurationClass(ConfigurationClassBeanDefinitionReader.java:141) ~[spring-context-5.1.7.RELEASE.jar:5.1.7.RELEASE] at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.loadBeanDefinitions(ConfigurationClassBeanDefinitionReader.java:117) ~[spring-context-5.1.7.RELEASE.jar:5.1.7.RELEASE] at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:327) ~[spring-context-5.1.7.RELEASE.jar:5.1.7.RELEASE] at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:232) ~[spring-context-5.1.7.RELEASE.jar:5.1.7.RELEASE] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanDefinitionRegistryPostProcessors(PostProcessorRegistrationDelegate.java:275) ~[spring-context-5.1.7.RELEASE.jar:5.1.7.RELEASE] at org.springframework.context.support.PostProcessorRegistrationDelegate.invokeBeanFactoryPostProcessors(PostProcessorRegistrationDelegate.java:95) ~[spring-context-5.1.7.RELEASE.jar:5.1.7.RELEASE] at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:705) ~[spring-context-5.1.7.RELEASE.jar:5.1.7.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:531) ~[spring-context-5.1.7.RELEASE.jar:5.1.7.RELEASE] at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:142) ~[spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:775) [spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:316) [spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1260) [spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1248) [spring-boot-2.1.5.RELEASE.jar:2.1.5.RELEASE] at com.example.zhang.cloud.ZhangGetewayApplication.main(ZhangGetewayApplication.java:17) [classes/:na] Caused by: java.lang.IllegalStateException: Failed to introspect Class [org.springframework.cloud.netflix.zuul.ZuulServerAutoConfiguration$ZuulMetricsConfiguration] from ClassLoader [sun.misc.Launcher$AppClassLoader@764c12b6] at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:507) ~[spring-core-5.1.7.RELEASE.jar:5.1.7.RELEASE] at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:404) ~[spring-core-5.1.7.RELEASE.jar:5.1.7.RELEASE] at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:389) ~[spring-core-5.1.7.RELEASE.jar:5.1.7.RELEASE] at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:447) ~[spring-core-5.1.7.RELEASE.jar:5.1.7.RELEASE] at java.util.concurrent.ConcurrentHashMap.computeIfAbsent(Unknown Source) ~[na:1.8.0_101] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:738) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:679) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:647) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1518) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1023) ~[spring-beans-5.1.7.RELEASE.jar:5.1.7.RELEASE] at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.addBeanTypeForNonAliasDefinition(BeanTypeRegistry.java:195) ~[spring-boot-autoconfigure-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.addBeanTypeForNonAliasDefinition(BeanTypeRegistry.java:159) ~[spring-boot-autoconfigure-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.addBeanType(BeanTypeRegistry.java:152) ~[spring-boot-autoconfigure-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.updateTypesIfNecessary(BeanTypeRegistry.java:140) ~[spring-boot-autoconfigure-2.1.5.RELEASE.jar:2.1.5.RELEASE] at java.util.Iterator.forEachRemaining(Unknown Source) ~[na:1.8.0_101] at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.updateTypesIfNecessary(BeanTypeRegistry.java:135) ~[spring-boot-autoconfigure-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.boot.autoconfigure.condition.BeanTypeRegistry.getNamesForType(BeanTypeRegistry.java:97) ~[spring-boot-autoconfigure-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.boot.autoconfigure.condition.OnBeanCondition.collectBeanNamesForType(OnBeanCondition.java:298) ~[spring-boot-autoconfigure-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:289) ~[spring-boot-autoconfigure-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getBeanNamesForType(OnBeanCondition.java:278) ~[spring-boot-autoconfigure-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchingBeans(OnBeanCondition.java:189) ~[spring-boot-autoconfigure-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.boot.autoconfigure.condition.OnBeanCondition.getMatchOutcome(OnBeanCondition.java:125) ~[spring-boot-autoconfigure-2.1.5.RELEASE.jar:2.1.5.RELEASE] at org.springframework.boot.autoconfigure.condition.SpringBootCondition.matches(SpringBootCondition.java:47) ~[spring-boot-autoconfigure-2.1.5.RELEASE.jar:2.1.5.RELEASE] ... 17 common frames omitted Caused by: java.lang.NoClassDefFoundError: com/netflix/zuul/monitoring/CounterFactory at java.lang.Class.getDeclaredMethods0(Native Method) ~[na:1.8.0_101] at java.lang.Class.privateGetDeclaredMethods(Unknown Source) ~[na:1.8.0_101] at java.lang.Class.getDeclaredMethods(Unknown Source) ~[na:1.8.0_101] at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:489) ~[spring-core-5.1.7.RELEASE.jar:5.1.7.RELEASE] ... 39 common frames omitted Caused by: java.lang.ClassNotFoundException: com.netflix.zuul.monitoring.CounterFactory at java.net.URLClassLoader.findClass(Unknown Source) ~[na:1.8.0_101] at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_101] at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) ~[na:1.8.0_101] at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.8.0_101] ... 43 common frames omitted springboot版本:2.1.5.RELEASE springcloud版本:Finchley.SR1 依赖: <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-netflix-zuul</artifactId> </dependency> 哪位大神能解答一下,谢谢啦

activeMQ 这个是要添加个什么包啊

Exception in thread "main" java.lang.NoClassDefFoundError: javax/management/j2ee/statistics/Stats at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(Unknown Source) at java.security.SecureClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.defineClass(Unknown Source) at java.net.URLClassLoader.access$100(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at com.chargerlink.client.MessageReceiver.run(MessageReceiver.java:42) at com.chargerlink.client.MessageReceiver.main(MessageReceiver.java:83) Caused by: java.lang.ClassNotFoundException: javax.management.j2ee.statistics.Stats at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 14 more

安卓module打包成aar文件,运行后报错java.lang.NoSuchMethodError:

报错信息: java.lang.NoSuchMethodError: No static method setOnApplyWindowInsetsListener(Landroid/view/View;Landroid/support/v4/view/OnApplyWindowInsetsListener;)V in class Landroid/support/v4/view/ViewCompatLollipop; or its super classes (declaration of 'android.support.v4.view.ViewCompatLollipop' appears in /data/app/com.b1993423839.zsa-1/base.apk:classes46.dex) 下面是我的v4和v7包都放在module的libs中引用,版本都是一致的,最后打包的时候也是将引用的aar文件放入主项目的libs中引用,最后将module的aar引入到主项目中,为啥运行的时候会出现找不到v4的方法呢? //安卓高级组件implementation(name: 'recyclerview-v7-25.2.0', ext: 'aar') implementation(name: 'constraint-layout-1.0.2', ext: 'aar') implementation files('libs/constraint-layout-solver-1.0.2.jar') implementation(name: 'design-25.2.0', ext: 'aar') //安卓兼容包 implementation(name: 'animated-vector-drawable-25.2.0', ext: 'aar') implementation(name: 'appcompat-v7-25.2.0', ext: 'aar') implementation(name: 'support-compat-25.2.0', ext: 'aar') implementation(name: 'support-core-ui-25.2.0', ext: 'aar') implementation(name: 'support-core-utils-25.2.0', ext: 'aar') implementation(name: 'support-fragment-25.2.0', ext: 'aar') implementation(name: 'support-media-compat-25.2.0', ext: 'aar') implementation(name: 'support-v4-25.2.0', ext: 'aar') implementation(name: 'support-vector-drawable-25.2.0', ext: 'aar') implementation(name: 'transition-25.2.0', ext: 'aar') implementation files('libs/support-annotations-25.2.0.jar') ![图片说明](https://img-ask.csdn.net/upload/201804/16/1523852888_948038.jpg)

折磨两天了,求大神指点。jeesite 项目导入后报错

信息: Initializing Spring root WebApplicationContext 2017-01-05 10:35:06,786 WARN [org.apache.ibatis.io.ResolverUtil] - Could not examine class 'com/thinkgem/jeesite/common/web/CKFinderConfig.class' due to a java.lang.NoClassDefFoundError with message: com/ckfinder/connector/configuration/Configuration 2017-01-05 10:35:06,789 WARN [org.apache.ibatis.io.ResolverUtil] - Could not examine class 'com/thinkgem/jeesite/common/web/CKFinderConnectorServlet.class' due to a java.lang.NoClassDefFoundError with message: com/ckfinder/connector/ConnectorServlet 2017-01-05 10:35:06,877 WARN [org.apache.ibatis.io.ResolverUtil] - Could not examine class 'com/thinkgem/jeesite/common/web/CKFinderConfig.class' due to a java.lang.NoClassDefFoundError with message: com/ckfinder/connector/configuration/Configuration 2017-01-05 10:35:06,880 WARN [org.apache.ibatis.io.ResolverUtil] - Could not examine class 'com/thinkgem/jeesite/common/web/CKFinderConnectorServlet.class' due to a java.lang.NoClassDefFoundError with message: com/ckfinder/connector/ConnectorServlet 一月 05, 2017 10:35:07 上午 org.apache.catalina.core.StandardContext filterStart 严重: Exception starting filter FileUploadFilter java.lang.ClassNotFoundException: com.ckfinder.connector.FileUploadFilter at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1892) at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735) at org.apache.catalina.core.DefaultInstanceManager.loadClass(DefaultInstanceManager.java:504) at org.apache.catalina.core.DefaultInstanceManager.loadClassMaybePrivileged(DefaultInstanceManager.java:486) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:113) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4958) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5652) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:679) at org.apache.catalina.startup.HostConfig$DeployDescriptor.run(HostConfig.java:1966) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:745) 一月 05, 2017 10:35:07 上午 org.apache.catalina.core.StandardContext startInternal 严重: One or more Filters failed to start. Full details will be found in the appropriate container log file 一月 05, 2017 10:35:07 上午 org.apache.catalina.core.StandardContext startInternal 严重: Context [/rbms] startup failed due to previous errors jar包也存在 CKFinderConfig这个类也有啊? 运行时就报错。

本地运行spark,JNI error, NoClassDefFoundError

异常信息如下:运行spark 的wordcount demo,引用 的jar都依赖好好的, 部署spark 的时候遇见过类似错误,通过环境变量指定hadoop的jni就好了,现在在本机ide不知道该怎么办了 Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/spark/api/java/function/FlatMapFunction at java.lang.Class.getDeclaredMethods0(Native Method) at java.lang.Class.privateGetDeclaredMethods(Class.java:2701) Disconnected from the target VM, address: '127.0.0.1:58564', transport: 'socket' at java.lang.Class.privateGetMethodRecursive(Class.java:3048) at java.lang.Class.getMethod0(Class.java:3018) at java.lang.Class.getMethod(Class.java:1784) at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544) at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526) Caused by: java.lang.ClassNotFoundException: org.apache.spark.api.java.function.FlatMapFunction at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 7 more

springboot整合dubbo服务启动报错

SpringBoot1.5.1,Dubbo 2..8.4,JDK 1.8.0_171 zookeeper确定是启动的。 provider配置如下: ``` <!--定义了提供方应用信息,用于计算依赖关系;在 dubbo-admin 或 dubbo-monitor 会显示这个名字,方便辨识--> <dubbo:application name="demotest-provider" owner="programmer" organization="dubbox"/> <!--使用 zookeeper 注册中心暴露服务,注意要先开启 zookeeper--> <dubbo:registry address="zookeeper://localhost:2181"/> <!-- 用dubbo协议在20880端口暴露服务 --> <dubbo:protocol name="dubbo" port="20880" /> <!--使用 dubbo 协议实现定义好的接口--> <dubbo:service interface="cn.kaison.xblog.system.api.service.SystemService" ref="systemService" protocol="dubbo"></dubbo:service> <!--具体实现该接口的 bean--> <bean id="demoService" class="cn.kaison.xblog.system.provider.serviceImpl.SystemServiceImpl"></bean> ``` 项目结构: ![图片说明](https://img-ask.csdn.net/upload/201804/20/1524156832_387407.png) 启动后报错如下: 2018-04-20 00:43:04.775 WARN 18261 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cn.kaison.xblog.system.api.service.SystemService': Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError 2018-04-20 00:43:04.779 WARN 18261 --- [ main] o.s.boot.SpringApplication : Error handling failed (Error creating bean with name 'cn.kaison.xblog.system.api.service.SystemService': Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class com.alibaba.dubbo.config.spring.ServiceBean) 2018-04-20 00:43:04.789 ERROR 18261 --- [ main] o.s.boot.SpringApplication : Application startup failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cn.kaison.xblog.system.api.service.SystemService': Instantiation of bean failed; nested exception is java.lang.ExceptionInInitializerError at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1155) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1099) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:513) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:866) ~[spring-context-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:542) ~[spring-context-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122) ~[spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE] at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:737) ~[spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE] at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:370) ~[spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) ~[spring-boot-1.5.1.RELEASE.jar:1.5.1.RELEASE] at cn.kaison.xblog.system.provider.SysProviderApplication.main(SysProviderApplication.java:30) [classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_144] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_144] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_144] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_144] at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147) [idea_rt.jar:na] Caused by: java.lang.ExceptionInInitializerError: null at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:1.8.0_144] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:1.8.0_144] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:1.8.0_144] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) ~[na:1.8.0_144] at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:142) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:89) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1147) ~[spring-beans-4.3.6.RELEASE.jar:4.3.6.RELEASE] ... 20 common frames omitted Caused by: java.lang.IllegalStateException: fail to create adaptive instance: java.lang.IllegalStateException: Can not create adaptive extenstion interface com.alibaba.dubbo.rpc.Protocol, cause: Failed to load extension class(interface: interface com.alibaba.dubbo.common.compiler.Compiler, class line: com.alibaba.dubbo.common.compiler.support.JavassistCompiler) in jar:file:/Users/xiaohuchen/Documents/_my_soft/mavenrepo/com/alibaba/dubbo/2.8.4/dubbo-2.8.4.jar!/META-INF/dubbo/internal/com.alibaba.dubbo.common.compiler.Compiler, cause: javassist/ClassPath at com.alibaba.dubbo.common.extension.ExtensionLoader.getAdaptiveExtension(ExtensionLoader.java:459) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.config.ServiceConfig.<clinit>(ServiceConfig.java:62) ~[dubbo-2.8.4.jar:2.8.4] ... 27 common frames omitted Caused by: java.lang.IllegalStateException: Can not create adaptive extenstion interface com.alibaba.dubbo.rpc.Protocol, cause: Failed to load extension class(interface: interface com.alibaba.dubbo.common.compiler.Compiler, class line: com.alibaba.dubbo.common.compiler.support.JavassistCompiler) in jar:file:/Users/xiaohuchen/Documents/_my_soft/mavenrepo/com/alibaba/dubbo/2.8.4/dubbo-2.8.4.jar!/META-INF/dubbo/internal/com.alibaba.dubbo.common.compiler.Compiler, cause: javassist/ClassPath at com.alibaba.dubbo.common.extension.ExtensionLoader.createAdaptiveExtension(ExtensionLoader.java:723) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.common.extension.ExtensionLoader.getAdaptiveExtension(ExtensionLoader.java:455) ~[dubbo-2.8.4.jar:2.8.4] ... 28 common frames omitted Caused by: java.lang.IllegalStateException: Failed to load extension class(interface: interface com.alibaba.dubbo.common.compiler.Compiler, class line: com.alibaba.dubbo.common.compiler.support.JavassistCompiler) in jar:file:/Users/xiaohuchen/Documents/_my_soft/mavenrepo/com/alibaba/dubbo/2.8.4/dubbo-2.8.4.jar!/META-INF/dubbo/internal/com.alibaba.dubbo.common.compiler.Compiler, cause: javassist/ClassPath at com.alibaba.dubbo.common.extension.ExtensionLoader.loadFile(ExtensionLoader.java:685) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.common.extension.ExtensionLoader.loadExtensionClasses(ExtensionLoader.java:591) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.common.extension.ExtensionLoader.getExtensionClasses(ExtensionLoader.java:567) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.common.extension.ExtensionLoader.getAdaptiveExtensionClass(ExtensionLoader.java:728) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.common.extension.ExtensionLoader.createAdaptiveExtension(ExtensionLoader.java:721) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.common.extension.ExtensionLoader.getAdaptiveExtension(ExtensionLoader.java:455) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.common.extension.ExtensionLoader.createAdaptiveExtensionClass(ExtensionLoader.java:738) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.common.extension.ExtensionLoader.getAdaptiveExtensionClass(ExtensionLoader.java:732) ~[dubbo-2.8.4.jar:2.8.4] at com.alibaba.dubbo.common.extension.ExtensionLoader.createAdaptiveExtension(ExtensionLoader.java:721) ~[dubbo-2.8.4.jar:2.8.4] ... 29 common frames omitted Caused by: java.lang.NoClassDefFoundError: javassist/ClassPath at java.lang.Class.forName0(Native Method) ~[na:1.8.0_144] at java.lang.Class.forName(Class.java:348) ~[na:1.8.0_144] at com.alibaba.dubbo.common.extension.ExtensionLoader.loadFile(ExtensionLoader.java:627) ~[dubbo-2.8.4.jar:2.8.4] ... 37 common frames omitted Caused by: java.lang.ClassNotFoundException: javassist.ClassPath at java.net.URLClassLoader.findClass(URLClassLoader.java:381) ~[na:1.8.0_144] at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[na:1.8.0_144] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:335) ~[na:1.8.0_144] at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[na:1.8.0_144] ... 40 common frames omitted

关于java的jar包我有个疑问

我在maven里面依赖了commons-pool2-2.0.jar,commons-pool-1.6.jar两个包, 这两个也下载到.m2的库里面了,在程序的libraries下也可以看到。但是程序运行的时候就会报找不到包中包含的方法的错误。 java.lang.NoClassDefFoundError: org/apache/commons/pool2/impl/GenericObjectPoolConfig 然后我在eclipse的installed jres添加了jar。然后就好使了。 我想知道这些jar包是如何被调用的呢。程序在运行的时候jvm是如何找这些jar的呢。有什么地方可以配置吗。

如何自动下载jar包中的其他依赖

把原始项目使用idea打成了jar包(散包,copy to the...),上传到了Nexus,另一个项目用pom下载jar包,可以使用这个jar包。 但是,运行的时候找不到这个jar包依赖的其他jar包,比如原始项目依赖的base64就找不到,运行期异常:java.lang.NoClassDefFoundError: org/apache/commons/codec/binary/Base64。 求教如何自动下载jar包中的其他依赖。

JAVA的sun包问题?望解决 不甚感激

package 声音; import java.applet.*; import java.io.*; import sun.audio.*; import java.awt.*; public class view{ public static void main(String args[]){ try { FileInputStream fileau=new FileInputStream("sloop.au"); AudioStream as=new AudioStream(fileau); AudioPlayer.player.start(as); } catch (Exception e) { System.out.println(e); } } } 以上是源码 AudioStream 提示的问题是 Access restriction: The type 'AudioStream' is not API (restriction on required library 'D:\java_jre\lib\rt.jar') 有大牛能解决吗

Android报错闪退NoClassDefFoundError: Failed resolution of: Landroid/arch/core/internal/FastSafeIterableMap怎么解决

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;前天在build.gradle文件里面升级了一下依赖,结果再没有成功打开过app,不停地报错。之前在stackoverflow问了一下,说是clean -> rebuild -> restart IDE,一点用都没有。求牛人们解答一下,否则就废了。。。 LOG: ``` 04-26 09:49:45.993 13807 13807 D AndroidRuntime: Shutting down VM 04-26 09:49:45.995 13807 13807 E AndroidRuntime: FATAL EXCEPTION: main 04-26 09:49:45.995 13807 13807 E AndroidRuntime: Process: com.runze.chatkiller, PID: 13807 04-26 09:49:45.995 13807 13807 E AndroidRuntime: java.lang.NoClassDefFoundError: Failed resolution of: Landroid/arch/core/internal/FastSafeIterableMap; 04-26 09:49:45.995 13807 13807 E AndroidRuntime: at android.arch.lifecycle.LifecycleRegistry.<init>(LifecycleRegistry.java:54) 04-26 09:49:45.995 13807 13807 E AndroidRuntime: at android.support.v4.app.SupportActivity.<init>(SupportActivity.java:47) 04-26 09:49:45.995 13807 13807 E AndroidRuntime: at android.support.v4.app.BaseFragmentActivityApi14.<init>(BaseFragmentActivityApi14.java:28) 04-26 09:49:45.995 13807 13807 E AndroidRuntime: at android.support.v4.app.BaseFragmentActivityApi16.<init>(BaseFragmentActivityApi16.java:34) 04-26 09:49:45.995 13807 13807 E AndroidRuntime: at android.support.v4.app.FragmentActivity.<init>(FragmentActivity.java:67) 04-26 09:49:45.995 13807 13807 E AndroidRuntime: at android.support.v7.app.AppCompatActivity.<init>(AppCompatActivity.java:61) 04-26 09:49:45.995 13807 13807 E AndroidRuntime: at com.runze.chatkiller.MainActivity.<init>(MainActivity.java:36) 04-26 09:49:45.995 13807 13807 E AndroidRuntime: at java.lang.Class.newInstance(Native Method) 04-26 09:49:45.995 13807 13807 E AndroidRuntime: at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:69) 04-26 09:49:45.995 13807 13807 E AndroidRuntime: at android.app.Instrumentation.newActivity(Instrumentation.java:1216) 04-26 09:49:45.995 13807 13807 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2864) 04-26 09:49:45.995 13807 13807 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3081) 04-26 09:49:45.995 13807 13807 E AndroidRuntime: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78) 04-26 09:49:45.995 13807 13807 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) 04-26 09:49:45.995 13807 13807 E AndroidRuntime: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) 04-26 09:49:45.995 13807 13807 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831) 04-26 09:49:45.995 13807 13807 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:106) 04-26 09:49:45.995 13807 13807 E AndroidRuntime: at android.os.Looper.loop(Looper.java:201) 04-26 09:49:45.995 13807 13807 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6810) 04-26 09:49:45.995 13807 13807 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method) 04-26 09:49:45.995 13807 13807 E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547) 04-26 09:49:45.995 13807 13807 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873) 04-26 09:49:45.995 13807 13807 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "android.arch.core.internal.FastSafeIterableMap" on path: DexPathList[[zip file "/system/framework/org.apache.http.legacy.boot.jar", zip file "/data/app/com.runze.chatkiller-X68L9eryR5FLHqiy61E0Lg==/base.apk"],nativeLibraryDirectories=[/data/app/com.runze.chatkiller-X68L9eryR5FLHqiy61E0Lg==/lib/arm64, /system/lib64]] 04-26 09:49:45.995 13807 13807 E AndroidRuntime: at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134) 04-26 09:49:45.995 13807 13807 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:379) 04-26 09:49:45.995 13807 13807 E AndroidRuntime: at java.lang.ClassLoader.loadClass(ClassLoader.java:312) 04-26 09:49:45.995 13807 13807 E AndroidRuntime: ... 22 more ``` build.gradle ``` apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion "21.1.0" defaultConfig { applicationId "com.runze.chatkiller" minSdkVersion 14 targetSdkVersion 21 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:cardview-v7:28.0.0' implementation 'com.android.support:support-v4:25.3.1' implementation 'com.android.support:appcompat-v7:27.0.1' implementation 'com.android.support:recyclerview-v7:27.0.1' implementation 'com.android.support:design:27.0.1' } ```

allatori混淆代码时内部类应该怎么处理?

最近在使用allatori混淆web项目时经常发现一些带有内部类的混淆之后, 具体运行的时候就会出现: ``` java.lang.NoClassDefFoundError: com/*/*/*/controller/MainClass$g ``` 所以遇到这种类我一般都是在配置文件中直接忽略该类的混淆: ``` <ignore-classes> <class template="class com.*.*.controller.ScheduleController" /> </ignore-classes> ``` 但是总感觉这种方法并不好,这样这个类就会直接暴露出来,不知道有其他什么方法吗,既可以混淆这种带内部类的又能保证程序正常运行。

maven项目编译时jar包冲突相关问题

从开源代码上拷下来一个源码学习,执行mvn clean install时报错: [WARNING] Error injecting: aQute.bnd.maven.plugin.BndMavenPlugin java.lang.NoClassDefFoundError: org/codehaus/plexus/util/Scanner at java.lang.Class.getDeclaredConstructors0(Native Method) at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671) at java.lang.Class.getDeclaredConstructors(Class.java:2020) at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:245) at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:99) at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:658) at com.google.inject.internal.InjectorImpl.createJustInTimeBinding(InjectorImpl.java:882) at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive(InjectorImpl.java:805) at com.google.inject.internal.InjectorImpl.getJustInTimeBinding(InjectorImpl.java:282) at com.google.inject.internal.InjectorImpl.getBindingOrThrow(InjectorImpl.java:214) at com.google.inject.internal.InjectorImpl.getProviderOrThrow(InjectorImpl.java:1006) at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1038) at com.google.inject.internal.InjectorImpl.getProvider(InjectorImpl.java:1001) at com.google.inject.internal.InjectorImpl.getInstance(InjectorImpl.java:1051) at org.eclipse.sisu.space.AbstractDeferredClass.get(AbstractDeferredClass.java:48) at com.google.inject.internal.ProviderInternalFactory.provision(ProviderInternalFactory.java:81) at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision(InternalFactoryToInitializableAdapter.java:53) at com.google.inject.internal.ProviderInternalFactory$1.call(ProviderInternalFactory.java:65) at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision(ProvisionListenerStackCallback.java:115) ........ Caused by: java.lang.ClassNotFoundException: org.codehaus.plexus.util.Scanner ........ [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 4.616 s [INFO] Finished at: 2017-11-20T15:08:13+08:00 [INFO] Final Memory: 17M/201M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal biz.aQute.bnd:bnd-maven-plugin:3.1.0:bnd-process (default) on project gson: Execution default of goal biz.aQute.bnd:bnd-maven-plugin:3.1.0:bnd-process failed: A required class was missing while executing biz.aQute.bnd:bnd-maven-plugin:3.1.0:bnd-process: org/codehaus/plexus/util/Scanner [ERROR] ----------------------------------------------------- [ERROR] realm = plugin>biz.aQute.bnd:bnd-maven-plugin:3.1.0 [ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy [ERROR] urls[0] = file:/Users/dasouche/.m2/repository/biz/aQute/bnd/bnd-maven-plugin/3.1.0/bnd-maven-plugin-3.1.0.jar [ERROR] urls[1] = file:/Users/dasouche/.m2/repository/org/sonatype/plexus/plexus-build-api/0.0.7/plexus-build-api-0.0.7.jar [ERROR] urls[2] = file:/Users/dasouche/.m2/repository/biz/aQute/bnd/biz.aQute.bndlib/3.1.0/biz.aQute.bndlib-3.1.0.jar [ERROR] urls[3] = file:/Users/dasouche/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar [ERROR] Number of foreign imports: 1 [ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]] [ERROR] [ERROR] ----------------------------------------------------- [ERROR] : org.codehaus.plexus.util.Scanner [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. [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 在项目的pom.xml文件中添加jar包依赖明确版本号: <dependency> <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-utils</artifactId> <version>3.0.5</version> </dependency> 依然报上面的错误。 请问各位大神这个是什么问题,怎么解决?

maven项目中找不到javax/servlet/http/HttpServletResponse

严重: Begin event threw error java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletResponse ![我是有这个jar包的](https://img-ask.csdn.net/upload/201909/04/1567578455_391200.png) ![图片说明](https://img-ask.csdn.net/upload/201909/04/1567578477_536832.png) maven项目中,明明有这个jar包,却说我没有。

导入javax.xml.bind.jar包后运行android项目出错

导入javax.xml.bind.jar包后运行android项目出现Conversion to Dalvik format failed with error 1,什么原因,怎么解决

excell存盘错误找不到TreeBidiMap

NoClassDefFoundError: org/apache/commons/collections4/bidimap/TreeBidiMap 目前我报错的版本: hamcrest-core-1.3 junit-4.12 ooxml-schemas-1.1.jar(网上说下载解决依赖,引入项目还是报错,项目确实没有这个类) poi-3.17.jar jdk1.8.0_131(jdk应该没关系) problem中的报错: The project was not built since its build path is incomplete. Cannot find the class file for org.apache.tools.ant.taskdefs.Typedef. Fix the build path then try building this project junit中的报错: java.lang.NoClassDefFoundError: org/apache/commons/collections4/bidimap/TreeBidiMap at org.apache.poi.hpsf.Section.<init>(Section.java:178) at org.apache.poi.hpsf.MutableSection.<init>(MutableSection.java:41) at org.apache.poi.hpsf.PropertySet.init(PropertySet.java:494) at org.apache.poi.hpsf.PropertySet.<init>(PropertySet.java:196) at org.apache.poi.hpsf.MutablePropertySet.<init>(MutablePropertySet.java:44) at org.apache.poi.hpsf.SpecialPropertySet.<init>(SpecialPropertySet.java:47) at org.apache.poi.hpsf.DocumentSummaryInformation.<init>(DocumentSummaryInformation.java:99) at org.apache.poi.hpsf.PropertySetFactory.create(PropertySetFactory.java:116) at org.apache.poi.POIDocument.getPropertySet(POIDocument.java:236) ``` package TestCase; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.util.Date; import java.util.List; import org.apache.poi.hssf.usermodel.HSSFCell; import org.apache.poi.hssf.usermodel.HSSFName; import org.apache.poi.hssf.usermodel.HSSFRow; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.junit.After; import org.junit.Before; import org.junit.Ignore; import org.junit.Test; import org.openqa.selenium.WebDriver; /** * MainRemark TODO * Modual TODO * @author *** * TestCaseTestExcellMaker.java * 上午11:13:36 * */ public class TestExcellMaker { @Before public void setUp() throws Exception { System.out.println("make excell file testcase"); } @After public void tearDown() throws Exception { } WebDriver driver; @Test public void test() throws IOException { // ------ // 创建HSSFWorkbook对象 try { HSSFWorkbook wb = new HSSFWorkbook(new FileInputStream("***.xls")); HSSFSheet sheet = wb.getSheet("Sheet1");//得到表一 HSSFRow row = sheet.getRow(7); //得到表一 行7 下标为0 HSSFCell cell = row.getCell(2); //得到表一 列7 下标为0 System.out.println(cell.getStringCellValue());//输出C8的值 cell.setCellValue(""); //清空 System.out.println(cell.getStringCellValue()); cell.setCellValue("SeleN"+(new Date()).getTime()+""); //程序设置成功 System.out.println(cell.getStringCellValue()); //HPBCSele5958 // 输出Excel文件 FileOutputStream output = new FileOutputStream("***.xls"); wb.write(output); output.close(); // wb.close(); } catch (Exception e) { e.printStackTrace(); } } @Ignore @Test public void printXlsCoulums() throws FileNotFoundException, IOException{ HSSFWorkbook wb = new HSSFWorkbook(new FileInputStream("***.xls")); List<HSSFName> allNames = wb.getAllNames(); HSSFSheet sheet = wb.getSheet("Sheet1"); for(int rowPositon=0;rowPositon<sheet.getPhysicalNumberOfRows();rowPositon++){ int cellTotal=sheet.getRow(rowPositon).getPhysicalNumberOfCells(); for(int cell=0;cell<cellTotal;cell++){ HSSFCell target = sheet.getRow(rowPositon).getCell(cell); if(target != null){ System.out.println("Row:"+rowPositon+" / cell:"+cell+" "+target); } } } } } ```

SpringBoot打包jar包或者war被其他web项目使用

1. 需要打包jar/war包; 2. 打包里面有依赖包; 3. 打包之后能被其他项目使用; 4. 目前需要在ssm项目使用打包的包; 5. 最好有个详细的文档,回答者不要去粘贴没用的地址或者博客,很多我都看过了,没用; 6. 目前对这个项目打包被其他项目引用的思想还不够清楚,我这有一个项目是引用的war包和jar包的,但是都是ssm项目,也不知道被引用的项目怎么打包的,所以想学习一个这个技术,貌似很实用。 请答题的看准问题再回答,那些回答什么maven打包的?你们确定都好使?你们自己不尝试一下是否成功就误人子弟?你们回答的人来电实际的行不?我这不是论坛,只是一个问题而已,我不想看到“知乎”的样子。所问非所答,真的是有失技术人员的水平

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

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

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

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

和黑客斗争的 6 天!

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

点沙成金:英特尔芯片制造全过程揭密

“亚马逊丛林里的蝴蝶扇动几下翅膀就可能引起两周后美国德州的一次飓风……” 这句人人皆知的话最初用来描述非线性系统中微小参数的变化所引起的系统极大变化。 而在更长的时间尺度内,我们所生活的这个世界就是这样一个异常复杂的非线性系统…… 水泥、穹顶、透视——关于时间与技艺的蝴蝶效应 公元前3000年,古埃及人将尼罗河中挖出的泥浆与纳特龙盐湖中的矿物盐混合,再掺入煅烧石灰石制成的石灰,由此得来了人...

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

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

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

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

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

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

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

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

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

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

外包程序员的幸福生活

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

C++11:一些微小的变化(新的数据类型、template表达式内的空格、nullptr、std::nullptr_t)

本文介绍一些C++的两个新特性,它们虽然微小,但对你的编程十分重要 一、Template表达式内的空格 C++11标准之前建议在“在两个template表达式的闭符之间放一个空格”的要求已经过时了 例如: vector&lt;list&lt;int&gt; &gt;; //C++11之前 vector&lt;list&lt;int&gt;&gt;; //C++11 二、nullptr ...

优雅的替换if-else语句

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

深入剖析Springboot启动原理的底层源码,再也不怕面试官问了!

大家现在应该都对Springboot很熟悉,但是你对他的启动原理了解吗?

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

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

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

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

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

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

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

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

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

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

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

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

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

【阿里P6面经】二本,curd两年,疯狂复习,拿下阿里offer

二本的读者,在老东家不断学习,最后逆袭

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

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

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

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

《经典算法案例》01-08:如何使用质数设计扫雷(Minesweeper)游戏

我们都玩过Windows操作系统中的经典游戏扫雷(Minesweeper),如果把质数当作一颗雷,那么,表格中红色的数字哪些是雷(质数)?您能找出多少个呢?文中用列表的方式罗列了10000以内的自然数、质数(素数),6的倍数等,方便大家观察质数的分布规律及特性,以便对算法求解有指导意义。另外,判断质数是初学算法,理解算法重要性的一个非常好的案例。

《Oracle Java SE编程自学与面试指南》最佳学习路线图(2020最新版)

正确选择比瞎努力更重要!

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

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

微软为一人收购一公司?破解索尼程序、写黑客小说,看他彪悍的程序人生!...

作者 | 伍杏玲出品 | CSDN(ID:CSDNnews)格子衬衫、常掉发、双肩包、修电脑、加班多……这些似乎成了大众给程序员的固定标签。近几年流行的“跨界风”开始刷新人们对程序员的...

终于,月薪过5万了!

来看几个问题想不想月薪超过5万?想不想进入公司架构组?想不想成为项目组的负责人?想不想成为spring的高手,超越99%的对手?那么本文内容是你必须要掌握的。本文主要详解bean的生命...

我说我懂多线程,面试官立马给我发了offer

不小心拿了几个offer,有点烦

自从喜欢上了B站这12个UP主,我越来越觉得自己是个废柴了!

不怕告诉你,我自从喜欢上了这12个UP主,哔哩哔哩成为了我手机上最耗电的软件,几乎每天都会看,可是吧,看的越多,我就越觉得自己是个废柴,唉,老天不公啊,不信你看看…… 间接性踌躇满志,持续性混吃等死,都是因为你们……但是,自己的学习力在慢慢变强,这是不容忽视的,推荐给你们! 都说B站是个宝,可是有人不会挖啊,没事,今天咱挖好的送你一箩筐,首先啊,我在B站上最喜欢看这个家伙的视频了,为啥 ,咱撇...

立即提问
相关内容推荐