eclipse package行报错

鼠标提示:The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from required .class files
jdk为1.8图片说明图片说明

2个回答

没考虑你这问题,但是package未遵循命名规则。建议更正。

您好,这种问题属于Jar包冲突
1.检查配置文件和是否存在多余Jar包。
2.换jdk版本
两种方式任选一种即可

记得把C币给我,O(∩_∩)O谢谢

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
JAVA入门学习,安装环境,最新的JDK-13,最新的eclipse,启动eclipse报错
JAVA入门学习,安装环境,最新的JDK-13,最新的eclipse,启动eclipse报错。 ``` !SESSION 2019-09-18 20:17:01.382 ----------------------------------------------- eclipse.buildId=4.6.3.M20170301-0400 java.version=13-ea java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=zh_CN Framework arguments: -product org.eclipse.epp.package.jee.product Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product !ENTRY org.eclipse.osgi 4 0 2019-09-18 20:17:03.164 !MESSAGE Application error !STACK 1 org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:386) at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:294) at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162) at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultHeadlessContext(E4Application.java:490) at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultContext(E4Application.java:504) at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:203) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:632) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:610) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:138) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:567) at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:673) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:610) at org.eclipse.equinox.launcher.Main.run(Main.java:1519) Caused by: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:151) at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:375) ... 22 more Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct cannot be found by org.eclipse.e4.core.di_1.6.1.v20160712-0927 at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:410) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:372) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:364) at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:161) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521) ... 24 more ``` 已尝试在eclipse.ini文件加入 --add-modules=ALL-SYSTEM 保存后启动仍然报错 64位win7系统,下载的没错。 卸载了JDK13,重新安装了低版本的JDK8,问题已解决。
eclipse相同代码一个报错一个不报错怎么回事?
**JDK:jdk1.8.0_192** **Eclipse:Eclipse JAVA Photon** **这份代码不会报错:** ![图片说明](https://img-ask.csdn.net/upload/201901/14/1547433088_554432.png) **但是这份代码报错:** ![图片说明](https://img-ask.csdn.net/upload/201901/14/1547433182_996302.png) **报错如图:** ![图片说明](https://img-ask.csdn.net/upload/201901/14/1547433850_621791.png) ![图片说明](https://img-ask.csdn.net/upload/201901/14/1547433861_812150.png) **明明代码是一样的吧? 但报错代码加上个:j=i+1;就不报错了:** ![图片说明](https://img-ask.csdn.net/upload/201901/14/1547433118_871032.png) **我贴下报错的代码:** ``` package com.Two; class Demo01 { public int[] twoSum(int[] nums, int target) { for(int i=0;i<nums.length;i++){ for(int j=i+1;j<nums.length;j++);{ if(nums[j] == target - nums[i]){ return new int[] {i,j}; } } } throw new IllegalArgumentException("No two sum solution"); } } ``` **这是不报错的代码:** ``` package com.Two; class Test{ public int[] twoSum(int[] nums, int target) { for (int i = 0; i < nums.length; i++) { for (int j = i + 1; j < nums.length; j++) { if (nums[j] == target - nums[i]) { return new int[] { i, j }; } } } throw new IllegalArgumentException("No two sum solution"); } } ``` **是什么原因呢?你们用这代码会报错吗?**
eclipse安装完插件报错,无法启动
!SESSION 2016-03-11 21:31:18.581 ----------------------------------------------- eclipse.buildId=4.5.2.M20160212-1500 java.version=1.8.0_66 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=zh_CN Framework arguments: -product org.eclipse.epp.package.jee.product Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product !ENTRY org.eclipse.rap.ui 4 0 2016-03-11 21:31:20.038 !MESSAGE FrameworkEvent ERROR !STACK 0 org.osgi.framework.BundleException: Could not resolve module: org.eclipse.rap.ui [2001] Another singleton bundle selected: osgi.identity; osgi.identity="org.eclipse.rap.ui"; type="osgi.bundle"; version:Version="3.0.1.20150709-1405"; singleton:="true" at org.eclipse.osgi.container.Module.start(Module.java:434) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) !ENTRY org.eclipse.rap.ui.forms 4 0 2016-03-11 21:31:20.047 !MESSAGE FrameworkEvent ERROR !STACK 0 org.osgi.framework.BundleException: Could not resolve module: org.eclipse.rap.ui.forms [2002] Another singleton bundle selected: osgi.identity; osgi.identity="org.eclipse.rap.ui.forms"; type="osgi.bundle"; version:Version="3.0.1.20150709-1405"; singleton:="true" at org.eclipse.osgi.container.Module.start(Module.java:434) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) !ENTRY org.eclipse.rap.ui.workbench 4 0 2016-03-11 21:31:20.055 !MESSAGE FrameworkEvent ERROR !STACK 0 org.osgi.framework.BundleException: Could not resolve module: org.eclipse.rap.ui.workbench [2003] Another singleton bundle selected: osgi.identity; osgi.identity="org.eclipse.rap.ui.workbench"; type="osgi.bundle"; version:Version="3.0.1.20150709-1405"; singleton:="true" at org.eclipse.osgi.container.Module.start(Module.java:434) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1561) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476) at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1) at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340) !ENTRY org.eclipse.osgi 4 0 2016-03-11 21:31:21.572 !MESSAGE 应用程序错误 !STACK 1 java.lang.LinkageError: loader constraint violation: when resolving method "org.eclipse.e4.ui.bindings.internal.BindingTable.addBinding(Lorg/eclipse/jface/bindings/Binding;)V" the class loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) of the current class, org/eclipse/e4/ui/workbench/swt/util/BindingProcessingAddon, and the class loader (instance of org/eclipse/osgi/internal/loader/EquinoxClassLoader) for the method's defining class, org/eclipse/e4/ui/bindings/internal/BindingTable, have different Class objects for the type org/eclipse/jface/bindings/Binding used in the signature at org.eclipse.e4.ui.workbench.swt.util.BindingProcessingAddon.defineBinding(BindingProcessingAddon.java:192) at org.eclipse.e4.ui.workbench.swt.util.BindingProcessingAddon.defineBindingTable(BindingProcessingAddon.java:176) at org.eclipse.e4.ui.workbench.swt.util.BindingProcessingAddon.defineBindingTables(BindingProcessingAddon.java:154) at org.eclipse.e4.ui.workbench.swt.util.BindingProcessingAddon.init(BindingProcessingAddon.java:102) 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.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56) at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:898) at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:121) at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:345) at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:278) at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:186) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:107) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:73) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:50) at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:283) at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:628) at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:337) at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:606) at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:139) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235) 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.eclipse.equinox.launcher.Main.invokeFramework(Main.java:669) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:608) at org.eclipse.equinox.launcher.Main.run(Main.java:1515)
myeclipse导入eclipse项目报错,依赖报错,
这个项目在别人eclipse那里部署成功,所以不是代码问题 报错信息: Error creating bean with name 'attachmentController': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [com.jeefw.service.sys.AttachmentService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@javax.annotation.Resource(shareable=true, mappedName=, description=, name=, type=class java.lang.Object, lookup=, authenticationType=CONTAINER)} 配置文件内容: ``` <context:annotation-config /> <context:component-scan base-package="com.jeefw.controller.sys,com.jeefw.dao.sys,com.jeefw.model.sys,com.jeefw.service.sys" /> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> <property name="driverClass" value="com.mysql.jdbc.Driver" /> <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/jeefw?useUnicode=true&amp;characterEncoding=utf-8" /> <property name="user" value="root" /> <property name="password" value="123456" /> <!-- SQL Server数据库配置 --> <!-- <property name="driverClass" value="com.microsoft.sqlserver.jdbc.SQLServerDriver" /> <property name="jdbcUrl" value="jdbc:sqlserver://localhost:1433;DatabaseName=jeefw" /> <property name="user" value="sa" /> <property name="password" value="123456" /> --> <!-- Oracle数据库配置 --> <!-- <property name="driverClass" value="oracle.jdbc.driver.OracleDriver" /> <property name="jdbcUrl" value="jdbc:oracle:thin:@127.0.0.1:1521:orcl" /> <property name="user" value="SYSTEM" /> <property name="password" value="SkyNet888999" /> --> <property name="acquireIncrement" value="3" /> <property name="idleConnectionTestPeriod" value="120" /> <property name="initialPoolSize" value="3" /> <property name="minPoolSize" value="3" /> <property name="maxPoolSize" value="15" /> <property name="numHelperThreads" value="3" /> <property name="preferredTestQuery" value="select 1" /> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean"> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</prop> <!-- SQL Server的Dialect方言配置 --> <!-- <prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop> --> <!-- Oracle的Dialect方言配置 --> <!-- <prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop> --> <prop key="hibernate.show_sql">true</prop> <prop key="hibernate.use_outer_join">true</prop> <prop key="hibernate.jdbc.fetch_size">30</prop> <prop key="hibernate.jdbc.batch_size">30</prop> <prop key="hibernate.jdbc.batch_versioned_data">true</prop> <prop key="hibernate.cache.use_second_level_cache">true</prop> <prop key="hibernate.cache.use_query_cache">true</prop> <prop key="hibernate.cache.provider_class">net.sf.ehcache.hibernate.EhCacheProvider</prop> <prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory</prop> <prop key="hibernate.current_session_context_class">org.springframework.orm.hibernate4.SpringSessionContext</prop> <prop key="hibernate.hbm2ddl.auto">update</prop> <prop key="javax.persistence.validation.mode">none</prop> <!-- 此注释里代码只跟全文检索有关,如需全文检索功能,放开注释,然后找到本文件的第87行和web.xml的第15行放开注释,重启应用服务器即可。可配置,不影响框架使用。苹果Mac电脑需要修改hibernate.search.default.indexBase参数。 --> <!-- <prop key="hibernate.search.default.directory_provider">filesystem</prop> <prop key="hibernate.search.default.indexBase">D:/JeefwLuceneIndexes</prop> <prop key="hibernate.search.default.refresh">1800</prop> <prop key="hibernate.search.default.indexwriter.max_merge_docs">100</prop> <prop key="hibernate.search.default.indexwriter.ram_buffer_size">64</prop> <prop key="hibernate.search.default.optimizer.operation_limit.max">1000</prop> <prop key="hibernate.search.default.optimizer.transaction_limit.max">100</prop> --> </props> </property> <property name="dataSource" ref="dataSource" /> <property name="packagesToScan"> <list> <value>com.jeefw.model</value> </list> </property> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate4.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> </bean> <tx:annotation-driven transaction-manager="transactionManager" /> <!-- 此注释里代码的作用是应用服务器每次启动都生成索引。在SystemInitListener里执行。可配置,不影响框架使用。 --> <!-- <bean id="informationService" class="com.jeefw.service.sys.impl.InformationServiceImpl" /> --> <bean id="indexingInformationJob" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean"> <property name="targetObject" ref="informationServiceImpl" /> <property name="targetMethod" value="indexingInformation" /> </bean> <!-- 每天凌晨2点执行定时任务,生成索引。 --> <bean id="indexingInformationJobTrigger" class="org.springframework.scheduling.quartz.CronTriggerFactoryBean"> <property name="jobDetail" ref="indexingInformationJob" /> <property name="cronExpression" value="0 0 2 * * ?" /> </bean> <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean" lazy-init="false"> <property name="triggers"> <list> <ref bean="indexingInformationJobTrigger" /> </list> </property> </bean> <bean id="updateUserPwdLogicBean" class="com.app.logic.UpdateUserPwdLogicServer" /> <!-- 配置业务逻辑池 --> <bean id="logicExecuteWorkerEnginBean" class="com.app.logic.LogicExecuteWorkerEngine"> <property name="requestBeanTrans"> <map> <entry key="1302"> <value>com.app.bean.UpdateUserPwdRequestBean</value> </entry> </map> </property> <property name="logicPool"> <map> <entry key="1302"> <ref bean="updateUserPwdLogicBean" /> </entry> </map> </property> </bean> <!-- 配置接口传输操作协议对象 --> <bean id="transmissionBean" class="com.app.logic.Transmission"> </bean> ``` 数据源配置的密码我填的是错的密码,它不报数据库的错,却报这个错 换过tomcat的版本,也没用 我部署这个项目是通过在myeclipse里面新建一个web项目,然后把要用的文件夹一个一个copy过来的,配置文件和jar包也是,整个项目的配置我只改动了数据源的密码
在eclipse中 Scanner在控制台没有输入提示,不报错?
初学者。在eclipse中 Scanner在控制台没有输入提示,也不报错。找不到原因。 代码如下: package Pack1; import java.util.Scanner; public class Text1 { public static void main(String[] args) { // TODO Auto-generated method stub System.out.println("你好"); Scanner scan= new Scanner(System.in); } } 请各位老师指点。谢谢 ![图片说明](https://img-ask.csdn.net/upload/201905/01/1556673313_466724.jpg)
eclipse启动报错,有谁同样遇到过,怎么解决求指点
!SESSION 2016-07-11 14:12:15.570 ----------------------------------------------- eclipse.buildId=4.3.0.I20130605-2000 java.version=1.6.0_45 java.vendor=Sun Microsystems Inc. BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=zh_CN Framework arguments: -product org.eclipse.epp.package.jee.product Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product !ENTRY org.eclipse.osgi 4 0 2016-07-11 14:12:19.195 !MESSAGE An error occurred while automatically activating bundle org.eclipse.core.resources (82). !STACK 0 org.osgi.framework.BundleException: Exception in org.eclipse.core.resources.ResourcesPlugin.start() of bundle org.eclipse.core.resources. at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:734) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300) at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:478) at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:263) at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:109) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:469) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216) at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:395) at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:35) at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:461) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107) at java.lang.ClassLoader.loadClass(Unknown Source) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:125) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181) 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.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591) at org.eclipse.equinox.launcher.Main.run(Main.java:1450) at org.eclipse.equinox.launcher.Main.main(Main.java:1426) Caused by: org.eclipse.core.internal.resources.ResourceException: Incompatible file format. Workspace was saved with an incompatible version: 1229866053. at org.eclipse.core.internal.resources.WorkspaceTreeReader.getReader(WorkspaceTreeReader.java:58) at org.eclipse.core.internal.resources.WorkspaceTreeReader.getReader(WorkspaceTreeReader.java:66) at org.eclipse.core.internal.resources.SaveManager.restoreTree(SaveManager.java:1000) at org.eclipse.core.internal.resources.SaveManager.restore(SaveManager.java:687) at org.eclipse.core.internal.resources.SaveManager.startup(SaveManager.java:1530) at org.eclipse.core.internal.resources.Workspace.startup(Workspace.java:2503) at org.eclipse.core.internal.resources.Workspace.open(Workspace.java:2252) at org.eclipse.core.resources.ResourcesPlugin.start(ResourcesPlugin.java:439) at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702) ... 29 more Root exception: org.eclipse.core.internal.resources.ResourceException: Incompatible file format. Workspace was saved with an incompatible version: 1229866053. at org.eclipse.core.internal.resources.WorkspaceTreeReader.getReader(WorkspaceTreeReader.java:58) at org.eclipse.core.internal.resources.WorkspaceTreeReader.getReader(WorkspaceTreeReader.java:66) at org.eclipse.core.internal.resources.SaveManager.restoreTree(SaveManager.java:1000) at org.eclipse.core.internal.resources.SaveManager.restore(SaveManager.java:687) at org.eclipse.core.internal.resources.SaveManager.startup(SaveManager.java:1530) at org.eclipse.core.internal.resources.Workspace.startup(Workspace.java:2503) at org.eclipse.core.internal.resources.Workspace.open(Workspace.java:2252) at org.eclipse.core.resources.ResourcesPlugin.start(ResourcesPlugin.java:439) at org.eclipse.osgi.framework.internal.core.BundleContextImpl$1.run(BundleContextImpl.java:711) at java.security.AccessController.doPrivileged(Native Method) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.startActivator(BundleContextImpl.java:702) at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:683) at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:381) at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:300) at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:478) at org.eclipse.osgi.internal.loader.BundleLoader.setLazyTrigger(BundleLoader.java:263) at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:109) at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:469) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:216) at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:395) at org.eclipse.osgi.internal.loader.SingleSourcePackage.loadClass(SingleSourcePackage.java:35) at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:461) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:421) at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107) at java.lang.ClassLoader.loadClass(Unknown Source) at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:125) at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110) at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:354) at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:181) 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.eclipse.equinox.launcher.Main.invokeFramework(Main.java:636) at org.eclipse.equinox.launcher.Main.basicRun(Main.java:591) at org.eclipse.equinox.launcher.Main.run(Main.java:1450) at org.eclipse.equinox.launcher.Main.main(Main.java:1426) ------------------------------------- 以上是log文件错误,求大神们指点
Springmvc上传文件限制大小,异常处理返回报错信息后,eclipse控制台还报错
**1、web.xml配置:** ``` <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <!-- 注册主控制器DispatcherServlet --> <servlet> <servlet-name>DispatcherServlet</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <!-- 指定spring配置文件位置 --> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:applicationContext.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>DispatcherServlet</servlet-name> <url-pattern>*.from</url-pattern> </servlet-mapping> <!-- 指定读取所有文件的编码格式 --> <filter> <filter-name>encodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>UTF-8</param-value> </init-param> </filter> <filter-mapping> <filter-name>encodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> </web-app> ``` **spring的applicationContext.xml配置:** ``` <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:jee="http://www.springframework.org/schema/jee" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jpa="http://www.springframework.org/schema/data/jpa" xmlns:util="http://www.springframework.org/schema/util" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.2.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.2.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.2.xsd http://www.springframework.org/schema/data/jpa http://www.springframework.org/schema/data/jpa/spring-jpa-1.3.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.2.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd"> <!-- 定义自动扫描组件 --> <context:component-scan base-package="controller"></context:component-scan> <!-- 定义@RequestMapping映射的注解驱动 --> <mvc:annotation-driven></mvc:annotation-driven> <!-- 定义视图解析器 --> <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix"> <value>/WEB-INF/jsp/</value> </property> <property name="suffix"> <value>.jsp</value> </property> </bean> <!-- 注册spring web mvc中处理上传事件的组件CommonsMultipartResolver, 而具体怎样处理上传文件,则是由导入的包common-upload.jar和common-io.jar去处理--> <bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver"> <property name="maxUploadSize" value="10240"></property> <property name="resolveLazily" value="true"></property> </bean> </beans> ``` **java代码Controller处理:** ``` package controller; import java.io.File; import java.util.HashMap; import java.util.Map; import javax.servlet.http.HttpServletRequest; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.multipart.MaxUploadSizeExceededException; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.servlet.ModelAndView; @Controller public class UploadController { // 访问upload.jsp页面 @RequestMapping("/toUpload") public String toUpload() { return "upload"; } @RequestMapping("/upload") public String upload(@RequestParam("file") MultipartFile file, HttpServletRequest request, ModelMap model) throws Exception { // 判断提交来的文件是否为空 if (file.isEmpty()) { // model.addAttribute("error", "上传文件不能为空"); // return "upload"; throw new RuntimeException("file is null"); } // 获取文件所要保存目录在服务器上所对应的实际路径 String path = request.getSession().getServletContext().getRealPath( "upload"); System.out.println(path); // 组成拥有真实路径的一个完整的地址字符串 String fileUrl = path + "\\" + file.getOriginalFilename(); // 封装上传文件名称到model对象中 model.addAttribute("fileName", file.getOriginalFilename()); // 根据这个完整地址字符串,生成提交文件所要保存到的目标文件或目录的对象 File targetFile = new File(fileUrl); // 判断目标文件或目录的对象是否已经存在 if (!targetFile.exists()) { targetFile.mkdirs(); } // 传送文件到目标对象 file.transferTo(targetFile); System.out.println("已上传文件:" + file); return "ok"; } @ExceptionHandler public ModelAndView doException(Exception e,HttpServletRequest request) throws Exception { Map<String,Object> map = new HashMap<String,Object>(); if (e instanceof MaxUploadSizeExceededException) { long maxSize = ((MaxUploadSizeExceededException) e) .getMaxUploadSize(); map.put("error", "上传文件太大,不能超过" + maxSize / 1024 + "k"); }else if(e instanceof RuntimeException){ map.put("error", "未选中文件"); }else{ map.put("error", "上传失败"); } return new ModelAndView("upload",map); } } ``` **上传文件页面upload.jsp:** ``` <%@ page pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>上传页面</title> </head> <body> <form action="upload.from" method="post" enctype="multipart/form-data"> <input type="file" name="file"/> <input type="submit" value="上传"/><font color="red">${error}</font> </form> </body> </html> ``` **上传成功页面ok.jsp:** ``` <%@ page pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>ok.jsp</title> </head> <body> <h1>上传成功</h1> <a href="upload/${fileName}">${fileName}</a> </body> </html> ``` **eclipse控制台报错信息如下:** ``` 五月 01, 2015 10:27:01 下午 org.springframework.web.multipart.commons.CommonsMultipartResolver cleanupMultipart 警告: Failed to perform multipart cleanup for servlet request org.springframework.web.multipart.MaxUploadSizeExceededException: Maximum upload size of 10240 bytes exceeded; nested exception is org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (19243) exceeds the configured maximum (10240) at org.springframework.web.multipart.commons.CommonsMultipartResolver.parseRequest(CommonsMultipartResolver.java:160) at org.springframework.web.multipart.commons.CommonsMultipartResolver$1.initializeMultipart(CommonsMultipartResolver.java:131) at org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest.getMultipartFiles(AbstractMultipartHttpServletRequest.java:119) at org.springframework.web.multipart.support.AbstractMultipartHttpServletRequest.getMultiFileMap(AbstractMultipartHttpServletRequest.java:99) at org.springframework.web.multipart.commons.CommonsMultipartResolver.cleanupMultipart(CommonsMultipartResolver.java:188) at org.springframework.web.servlet.DispatcherServlet.cleanupMultipart(DispatcherServlet.java:1062) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:955) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:856) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:953) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:855) at javax.servlet.http.HttpServlet.service(HttpServlet.java:650) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:829) at javax.servlet.http.HttpServlet.service(HttpServlet.java:731) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:505) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:423) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1079) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:620) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.doRun(AprEndpoint.java:2476) at org.apache.tomcat.util.net.AprEndpoint$SocketProcessor.run(AprEndpoint.java:2465) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) Caused by: org.apache.commons.fileupload.FileUploadBase$SizeLimitExceededException: the request was rejected because its size (19243) exceeds the configured maximum (10240) at org.apache.commons.fileupload.FileUploadBase$FileItemIteratorImpl.<init>(FileUploadBase.java:914) at org.apache.commons.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:331) at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:349) at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126) at org.springframework.web.multipart.commons.CommonsMultipartResolver.parseRequest(CommonsMultipartResolver.java:156) ... 37 more ``` 上传文件超过限制大小,异常处理后页面返回了提示信息“上传文件太大,不能超过10k”,但是为啥eclipse的控制台还是有报错呢?
maven项目在cmd里正常导入eclipse却报错
各位大神们,我为这个问题已经弄了四天了。一开始怀疑插件安装有问题,捣鼓各种安装方式均以失败告终。 后来我仔细看报错信息怀疑是因为连中央仓库连不上,导致jar包下载不下来。可是这就很奇怪了,我挂了阿里云的镜像,自己用cmd 下载jar包的时候那速度简直不能用快形容了,怎么在eclipse里就下不动了?况且我连基本的导入maven项目都做不到,一个很简单的maven项目,在cmd里已经做了compile 、clean test、clean install和clean package 操作,按理说不需要其他jar包了。 我试过各种方法,把.lastUpdated后缀的文件不断地删。还是然并卵。求各位大神施以援手。 ![图片说明](https://img-ask.csdn.net/upload/201703/05/1488691877_909287.png) ![图片说明](https://img-ask.csdn.net/upload/201703/05/1488692538_638827.png) ![图片说明](https://img-ask.csdn.net/upload/201703/05/1488692548_435089.png) ![图片说明](https://img-ask.csdn.net/upload/201703/05/1488692558_991876.png) ps...我现在又把目光转移到插件上了,是否插件安装的不行? 以下是我的插件安装详情(eclipse文件夹里可能有两个不同的插件安装方式,不知道是否会冲突,而且因为另一种安装方式比较粗暴,直接把文件粘贴进去了,搞的我也忘记了是哪几个,不好删除) ![图片说明](https://img-ask.csdn.net/upload/201703/05/1488692414_201765.png) ![图片说明](https://img-ask.csdn.net/upload/201703/05/1488692426_543981.png)
eclipse中tomcat启动报错
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener java.lang.ExceptionInInitializerError at org.springframework.beans.factory.support.AbstractBeanFactory.requiresDestruction(AbstractBeanFactory.java:1474) at org.springframework.beans.factory.support.AbstractBeanFactory.registerDisposableBeanIfNecessary(AbstractBeanFactory.java:1492) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:565) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:461) at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:295) at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:223) at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:292) at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198) at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:439) at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:624) at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461) at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389) at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294) at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4323) at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4771) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:785) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:763) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:558) at org.apache.catalina.startup.HostConfig.deployDescriptor(HostConfig.java:674) at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:599) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:538) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1390) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:355) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119) at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:89) at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:312) at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:292) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:998) at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:772) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138) at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:990) at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:275) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138) at org.apache.catalina.core.StandardService.startInternal(StandardService.java:424) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138) at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:648) at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:138) at org.apache.catalina.startup.Catalina.start(Catalina.java:576) 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.catalina.startup.Bootstrap.start(Bootstrap.java:288) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:415) Caused by: java.lang.SecurityException: Prohibited package name: java.lang at java.lang.ClassLoader.preDefineClass(Unknown Source) at java.lang.ClassLoader.defineClassCond(Unknown Source) 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$000(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 java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1651) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1509) at org.springframework.beans.factory.support.DisposableBeanAdapter.<clinit>(DisposableBeanAdapter.java:72) ... 46 more 2017-3-15 10:48:12 org.apache.catalina.core.ApplicationContext log 以前正常启动,今天突然不能启动了
kepler版本的eclipse中安装activiti报错求大牛
An error occurred while collecting items to be installed session context was:(profile=epp.package.standard, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=). Unable to read repository at http://activiti.org/designer/update/plugins/org.activiti.designer.libs_5.18.0.201508100929.jar. Premature end of Content-Length delimited message body (expected: 8041396; received: 3553301
eclipse中File类程序运行报错
程序如下: package nmd; import java.io.File; public class FileHello { public static void main(String[] args) { try { Runtime ec=Runtime.getRuntime(); File file=new File("file.txt"); ec.exec(file.getAbsolutePath()); } catch (Exception e) { System.out.println(e); } } } 运行报错如下: java.io.IOException: Cannot run program "D:\Java": CreateProcess error=193, %1 不是有效的 Win32 应用程序。 求大神指点这是神马意思?怎么才能正常显示结果呢?
JavaFX代码运行之后报错找不到或无法加载主类?
出现报错 错误: 找不到或无法加载主类 com.Test.MyJavaFX 原因: java.lang.NoClassDefFoundError: javafx/application/Application 附上代码 package com.Test; import javafx.application.Application; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.stage.Stage; public class MyJavaFX extends Application{ @Override public void start(Stage primaryStage) { Button btOK = new Button("OK"); Scene scene = new Scene(btOK, 200, 250); primaryStage.setTitle("MyJavaFX"); primaryStage.setScene(scene); primaryStage.show(); } public static void main(String[] args) { Application.launch(args); } }
jpcap运行在eclipse报错 ,求大神
Exception in thread "main" java.lang.NoClassDefFoundError: jpcap/JpcapCaptor at jptext.jptext.main(jptext.java:13) Caused by: java.lang.ClassNotFoundException: jpcap.JpcapCaptor at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source) at java.base/java.lang.ClassLoader.loadClass(Unknown Source) ... 1 more package jptext; import jpcap.JpcapCaptor; import jpcap.NetworkInterface; import jpcap.PacketReceiver; import jpcap.packet.Packet; public class jptext { public static void main(String args[]){ try{ //获取本机上的网络接口对象数组 final NetworkInterface[] devices = JpcapCaptor.getDeviceList(); for(int i=0;i<devices.length;i++){ NetworkInterface nc=devices[i]; //一块卡上可能有多个地址: String address=""; for(int t=0;t<nc.addresses.length;t++){ address+="|addresses["+t+"]: "+nc.addresses[t].address.toString(); } //打印说明: System.out.println("第"+i+"个接口:"+"|name: "+nc.name +"|loopback: "+nc.loopback+"\r\naddress: "+address); } }catch(Exception ef){ ef.printStackTrace(); System.out.println("显示网络接口数据失败: "+ef); } } }
jenkins部署maven工程构建,报错“package org.springframework.web.bind.annotation does not exist”
【背景】: 1、jenkins部署maven工程做自动编译打包构建 2、工程集成了spring+springboot+mybatis 3、多模块方式部署maven工程,有一个总的pom工程。 4、总的pom工程由上游依赖(已install到仓库中) 【问题描述】: 构建此pom工程给多模块编译打包,报错 ``` ...I18nController.java:package org.springframework.web.bind.annotation does not exist. ...I18nController.java ..cannot find symbol.. ... ``` 【定位】: 1、初步排查应该是缺包导致的问题,根据代码报错找到为导入包为spring-web中的一个类找不到 2、因为继承jenkins构建使用的maven未配置localRepository,因此构建时下载的临时仓库在slave的WORKSPACE下的m2chche目录下。 3、可以明确在该m2chche种找到spring-web对应版本已下载的jar包。 4、在jenkins执行日志中,搜索加载到的"org/springframework/spring"时,其他的spring-jdbc,spring-tx,spring-core,spring-aop等包都能查到,但是查不到spring-web的。 5、根据spring boot的pom文件往上找依赖,在spring-boot-starter 找到spring-boot-starter-web,在往上找到spring-web的依赖,scope配置的 compile 至此暂没有头绪了。 【求助】:请教大家了解maven的朋友,给点指导,谢谢!
初次编写java类,在编写完后运行报错
![图片说明](https://img-ask.csdn.net/upload/201910/24/1571924382_719561.png) 应该不是代码的问题。 报错信息: Error occurred during initialization of boot layer java.lang.module.ResolutionException: Modules jstl and taglibs.standard.impl export package org.apache.taglibs.standard.functions to module catalina
android程序,eclipse没报错,但是运行会意外停止
本人刚开始学习android,跟着书写了个程序,这个程序是会有一个东西随着手指拖动而移动,编译完没有问题,但是在手机上运行的时候却是意外停止,错误显示在了MainActivity的第27行,我真不知道哪里错,代码和书上写的一模一样,求大神指导 MainActivity的代码: package com.example.test34; import android.app.Activity; import android.os.Bundle; import android.view.Menu; import android.view.MotionEvent; import android.view.View; import android.view.View.OnTouchListener; import android.widget.FrameLayout; public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); FrameLayout frameLayout=(FrameLayout)findViewById(R.id.mylayout); final RabbitView rabbit=new RabbitView(MainActivity.this); rabbit.setOnTouchListener(new OnTouchListener(){ @Override public boolean onTouch(View v,MotionEvent event){ rabbit.bitmapX=event.getX(); rabbit.bitmapY=event.getY(); rabbit.invalidate(); return true; } }); frameLayout.addView(rabbit); } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.main, menu); return true; } } RabbitView.java代码 package com.example.test34; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Paint; import android.view.View; public class RabbitView extends View { public float bitmapX; public float bitmapY; public RabbitView(Context context){ super(context); bitmapX=750; bitmapY=500; } @Override protected void onDraw(Canvas canvas){ super.onDraw(canvas); Paint paint=new Paint(); Bitmap bitmap=BitmapFactory.decodeResource(this.getResources(),R.drawable.ic_launcher); canvas.drawBitmap(bitmap,bitmapX,bitmapY,paint); if(bitmap.isRecycled()){ bitmap.recycle(); } } } activity_main代码 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity" android:background="@drawable/background" android:id="@+id/mylayout" > </FrameLayout> logcat为: 07-22 17:27:52.100: D/dalvikvm(11872): GC_EXTERNAL_ALLOC freed 47K, 50% free 2740K/5379K, external 0K/0K, paused 71ms 07-22 17:27:52.120: D/AndroidRuntime(11872): Shutting down VM 07-22 17:27:52.120: W/dalvikvm(11872): threadid=1: thread exiting with uncaught exception (group=0x4001e578) 07-22 17:27:52.120: E/AndroidRuntime(11872): FATAL EXCEPTION: main 07-22 17:27:52.120: E/AndroidRuntime(11872): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.test34/com.example.test34.MainActivity}: java.lang.NullPointerException 07-22 17:27:52.120: E/AndroidRuntime(11872): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651) 07-22 17:27:52.120: E/AndroidRuntime(11872): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667) 07-22 17:27:52.120: E/AndroidRuntime(11872): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 07-22 17:27:52.120: E/AndroidRuntime(11872): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935) 07-22 17:27:52.120: E/AndroidRuntime(11872): at android.os.Handler.dispatchMessage(Handler.java:99) 07-22 17:27:52.120: E/AndroidRuntime(11872): at android.os.Looper.loop(Looper.java:130) 07-22 17:27:52.120: E/AndroidRuntime(11872): at android.app.ActivityThread.main(ActivityThread.java:3691) 07-22 17:27:52.120: E/AndroidRuntime(11872): at java.lang.reflect.Method.invokeNative(Native Method) 07-22 17:27:52.120: E/AndroidRuntime(11872): at java.lang.reflect.Method.invoke(Method.java:507) 07-22 17:27:52.120: E/AndroidRuntime(11872): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:912) 07-22 17:27:52.120: E/AndroidRuntime(11872): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:670) 07-22 17:27:52.120: E/AndroidRuntime(11872): at dalvik.system.NativeStart.main(Native Method) 07-22 17:27:52.120: E/AndroidRuntime(11872): Caused by: java.lang.NullPointerException 07-22 17:27:52.120: E/AndroidRuntime(11872): at com.example.test34.MainActivity.onCreate(MainActivity.java:27) 07-22 17:27:52.120: E/AndroidRuntime(11872): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1050) 07-22 17:27:52.120: E/AndroidRuntime(11872): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615) 07-22 17:27:52.120: E/AndroidRuntime(11872): ... 11 more 07-22 17:27:54.130: I/dalvikvm(11872): threadid=4: reacting to signal 3 07-22 17:27:54.130: I/dalvikvm(11872): Wrote stack traces to '/data/anr/traces.txt'
初学者eclipse报错:not well-formed (invalid token)
新建有两个Activity用于两个Activity之间简单的切换,java文件跟xml文件都没问题了,就是在Androidmanifest中声明使用IntentTestActivity和AnotherActivity出问题 代码如下: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.intenttest" android:versionCode="1" android:versionName="1.0" > <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="18" /> <application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <activity android:name=".IntentTestActivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <activity android:name=".AnotherActivity" <intent-filter>//这里报错,Error parsing XML:not well-formed (invalid token) <action android:name="android.guo.action.anotheractivity" /> </intent-filter> </activity> </application> </manifest>
Android 开发的程序eclipse没报错,但意外停止
# 目的是编写一个单点触摸用户输入的例子,以下是程序代码 package com.example.ontouchlistenerdemo; import android.app.Activity; import android.content.Context; import android.content.res.AssetManager; import android.graphics.*; import android.os.Bundle; import android.view.*; import android.view.View.OnTouchListener; public class Game extends Activity implements OnTouchListener { DrawView drawView; Point touch = new Point(0,0); String inputAction= ""; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); drawView = new DrawView(this); setContentView(drawView); drawView.setOnTouchListener(this); } public void onResume(){ super.onResume(); drawView.resume(); } public void onPause(){ super.onPause(); drawView.pause(); } public boolean onTouch(View v,MotionEvent event){ switch (event.getAction()) { case MotionEvent.ACTION_DOWN: inputAction = "DOWN"; break; case MotionEvent.ACTION_MOVE: inputAction = "MOVE"; break; case MotionEvent.ACTION_UP: inputAction = "UP"; break; } touch.x = (int)event.getX(); touch.y = (int)event.getY(); return true; } public class DrawView extends SurfaceView implements Runnable { Thread gameloop = null; SurfaceHolder surface = null; volatile boolean running = false; AssetManager assets = null; public DrawView(Context context) { super(context); surface = getHolder(); assets = context.getAssets(); } public void resume(){ running = true; gameloop = new Thread(this); gameloop.start(); } public void pause(){ running = false; while(true){ try{ gameloop.join(); }catch(InterruptedException e){} } } public void run(){ while(running) { if(!surface.getSurface().isValid()) continue; Canvas canvas = surface.lockCanvas(); canvas.drawColor(Color.BLACK); Paint paint= new Paint(); paint.setColor(Color.WHITE); paint.setTextSize(24); canvas.drawText("Touch screen to test single touch input", 10, 20, paint); canvas.drawText("Action: " +inputAction, 10, 50, paint); canvas.drawText("Position: "+touch.x+","+touch.y,10 ,80, paint); if(touch.x != 0&& touch.y!=0) canvas.drawCircle(touch.x, touch.y, 50, paint); surface.unlockCanvasAndPost(canvas); try{ Thread.sleep(20); }catch(InterruptedException e) { e.printStackTrace(); } } } } } ## 然后是Log的报错 04-23 09:05:03.901: E/AndroidRuntime(350): FATAL EXCEPTION: main 04-23 09:05:03.901: E/AndroidRuntime(350): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.example.ontouchlistenerdemo/com.example.ontouchlistenerdemo.MainActivity}: java.lang.ClassNotFoundException: com.example.ontouchlistenerdemo.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.ontouchlistenerdemo-1.apk] 04-23 09:05:03.901: E/AndroidRuntime(350): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1569) 04-23 09:05:03.901: E/AndroidRuntime(350): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 04-23 09:05:03.901: E/AndroidRuntime(350): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 04-23 09:05:03.901: E/AndroidRuntime(350): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 04-23 09:05:03.901: E/AndroidRuntime(350): at android.os.Handler.dispatchMessage(Handler.java:99) 04-23 09:05:03.901: E/AndroidRuntime(350): at android.os.Looper.loop(Looper.java:123) 04-23 09:05:03.901: E/AndroidRuntime(350): at android.app.ActivityThread.main(ActivityThread.java:3683) 04-23 09:05:03.901: E/AndroidRuntime(350): at java.lang.reflect.Method.invokeNative(Native Method) 04-23 09:05:03.901: E/AndroidRuntime(350): at java.lang.reflect.Method.invoke(Method.java:507) 04-23 09:05:03.901: E/AndroidRuntime(350): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 04-23 09:05:03.901: E/AndroidRuntime(350): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 04-23 09:05:03.901: E/AndroidRuntime(350): at dalvik.system.NativeStart.main(Native Method) 04-23 09:05:03.901: E/AndroidRuntime(350): Caused by: java.lang.ClassNotFoundException: com.example.ontouchlistenerdemo.MainActivity in loader dalvik.system.PathClassLoader[/data/app/com.example.ontouchlistenerdemo-1.apk] 04-23 09:05:03.901: E/AndroidRuntime(350): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:240) 04-23 09:05:03.901: E/AndroidRuntime(350): at java.lang.ClassLoader.loadClass(ClassLoader.java:551) 04-23 09:05:03.901: E/AndroidRuntime(350): at java.lang.ClassLoader.loadClass(ClassLoader.java:511) 04-23 09:05:03.901: E/AndroidRuntime(350): at android.app.Instrumentation.newActivity(Instrumentation.java:1021) 04-23 09:05:03.901: E/AndroidRuntime(350): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1561) 04-23 09:05:03.901: E/AndroidRuntime(350): ... 11 more 谢谢大家看下,帮个忙看看是什么错误
myeclipse10 installedJres换成1.8之后String报错
myeclipse10里边的工程把installedJres从原本的1.6换成自己安装的1.8之后, 各种报错,有时候是文件一开始package语句就报错,有时候是String类报错,反正各种错,根本没法用,求解释,是IDE的问题么?不用myeclipse自己手动编译都能过去。。。
Kafka实战(三) - Kafka的自我修养与定位
Apache Kafka是消息引擎系统,也是一个分布式流处理平台(Distributed Streaming Platform) Kafka是LinkedIn公司内部孵化的项目。LinkedIn最开始有强烈的数据强实时处理方面的需求,其内部的诸多子系统要执行多种类型的数据处理与分析,主要包括业务系统和应用程序性能监控,以及用户行为数据处理等。 遇到的主要问题: 数据正确性不足 数据的收集主要...
volatile 与 synchronize 详解
Java支持多个线程同时访问一个对象或者对象的成员变量,由于每个线程可以拥有这个变量的拷贝(虽然对象以及成员变量分配的内存是在共享内存中的,但是每个执行的线程还是可以拥有一份拷贝,这样做的目的是加速程序的执行,这是现代多核处理器的一个显著特性),所以程序在执行过程中,一个线程看到的变量并不一定是最新的。 volatile 关键字volatile可以用来修饰字段(成员变量),就是告知程序任何对该变量...
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它是一个过程,是一个不断累积、不断沉淀、不断总结、善于传达自己的个人见解以及乐于分享的过程。
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过...
有哪些让程序员受益终生的建议
从业五年多,辗转两个大厂,出过书,创过业,从技术小白成长为基层管理,联合几个业内大牛回答下这个问题,希望能帮到大家,记得帮我点赞哦。 敲黑板!!!读了这篇文章,你将知道如何才能进大厂,如何实现财务自由,如何在工作中游刃有余,这篇文章很长,但绝对是精品,记得帮我点赞哦!!!! 一腔肺腑之言,能看进去多少,就看你自己了!!! 目录: 在校生篇: 为什么要尽量进大厂? 如何选择语言及方...
大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了
大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 free -m 其中:m表示兆,也可以用g,注意都要小写 Men:表示物理内存统计 total:表示物理内存总数(total=used+free) use...
比特币原理详解
一、什么是比特币 比特币是一种电子货币,是一种基于密码学的货币,在2008年11月1日由中本聪发表比特币白皮书,文中提出了一种去中心化的电子记账系统,我们平时的电子现金是银行来记账,因为银行的背后是国家信用。去中心化电子记账系统是参与者共同记账。比特币可以防止主权危机、信用风险。其好处不多做赘述,这一层面介绍的文章很多,本文主要从更深层的技术原理角度进行介绍。 二、问题引入 假设现有4个人...
GitHub开源史上最大规模中文知识图谱
近日,一直致力于知识图谱研究的 OwnThink 平台在 Github 上开源了史上最大规模 1.4 亿中文知识图谱,其中数据是以(实体、属性、值),(实体、关系、实体)混合的形式组织,数据格式采用 csv 格式。 到目前为止,OwnThink 项目开放了对话机器人、知识图谱、语义理解、自然语言处理工具。知识图谱融合了两千五百多万的实体,拥有亿级别的实体属性关系,机器人采用了基于知识图谱的语义感...
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发...
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 演示地点演示 html代码如下` music 这个年纪 七月的风 音乐 ` 然后就是css`*{ margin: 0; padding: 0; text-decoration: none; list-...
微信支付崩溃了,但是更让马化腾和张小龙崩溃的竟然是……
loonggg读完需要3分钟速读仅需1分钟事件还得还原到昨天晚上,10 月 29 日晚上 20:09-21:14 之间,微信支付发生故障,全国微信支付交易无法正常进行。然...
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。
数据库优化 - SQL优化
以实际SQL入手,带你一步一步走上SQL优化之路!
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 cpp 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7 p...
通俗易懂地给女朋友讲:线程池的内部原理
餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”
《奇巧淫技》系列-python!!每天早上八点自动发送天气预报邮件到QQ邮箱
将代码部署服务器,每日早上定时获取到天气数据,并发送到邮箱。 也可以说是一个小型人工智障。 知识可以运用在不同地方,不一定非是天气预报。
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
英特尔不为人知的 B 面
从 PC 时代至今,众人只知在 CPU、GPU、XPU、制程、工艺等战场中,英特尔在与同行硬件芯片制造商们的竞争中杀出重围,且在不断的成长进化中,成为全球知名的半导体公司。殊不知,在「刚硬」的背后,英特尔「柔性」的软件早已经做到了全方位的支持与支撑,并持续发挥独特的生态价值,推动产业合作共赢。 而对于这一不知人知的 B 面,很多人将其称之为英特尔隐形的翅膀,虽低调,但是影响力却不容小觑。 那么,在...
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹...
面试官:你连RESTful都不知道我怎么敢要你?
干货,2019 RESTful最贱实践
刷了几千道算法题,这些我私藏的刷题网站都在这里了!
遥想当年,机缘巧合入了 ACM 的坑,周边巨擘林立,从此过上了"天天被虐似死狗"的生活… 然而我是谁,我可是死狗中的战斗鸡,智力不够那刷题来凑,开始了夜以继日哼哧哼哧刷题的日子,从此"读题与提交齐飞, AC 与 WA 一色 ",我惊喜的发现被题虐既刺激又有快感,那一刻我泪流满面。这么好的事儿作为一个正直的人绝不能自己独享,经过激烈的颅内斗争,我决定把我私藏的十几个 T 的,阿不,十几个刷题网...
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看...
白话阿里巴巴Java开发手册高级篇
不久前,阿里巴巴发布了《阿里巴巴Java开发手册》,总结了阿里巴巴内部实际项目开发过程中开发人员应该遵守的研发流程规范,这些流程规范在一定程度上能够保证最终的项目交付质量,通过在时间中总结模式,并推广给广大开发人员,来避免研发人员在实践中容易犯的错误,确保最终在大规模协作的项目中达成既定目标。 无独有偶,笔者去年在公司里负责升级和制定研发流程、设计模板、设计标准、代码标准等规范,并在实际工作中进行...
SQL-小白最佳入门sql查询一
不要偷偷的查询我的个人资料,即使你再喜欢我,也不要这样,真的不好;
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
Nginx 原理和架构
Nginx 是一个免费的,开源的,高性能的 HTTP 服务器和反向代理,以及 IMAP / POP3 代理服务器。Nginx 以其高性能,稳定性,丰富的功能,简单的配置和低资源消耗而闻名。 Nginx 的整体架构 Nginx 里有一个 master 进程和多个 worker 进程。master 进程并不处理网络请求,主要负责调度工作进程:加载配置、启动工作进程及非停升级。worker 进程负责处...
YouTube排名第一的励志英文演讲《Dream(梦想)》
Idon’t know what that dream is that you have, I don't care how disappointing it might have been as you've been working toward that dream,but that dream that you’re holding in your mind, that it’s po...
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
相关热词 基于c#波形控件 c# 十进制转十六进制 对文件aes加密vc# c#读取栈中所有的值 c# rsa256加密 好 学c# 还是c++ c# 和java的差距 c# curl网络框架 c# https证书请求 c# 中崎
立即提问