草庐IT

does_not_have_foo

全部标签

java.lang.NoClassDefFoundError : Could not initialize class org. bytedeco.javacpp.avutil

我使用的是Windows10,eclipse-neonwithJDK1.8版本,我收到以下异常。Exceptioninthread"main"java.lang.NoClassDefFoundError:Couldnotinitializeclassorg.bytedeco.javacpp.avutilatjava.lang.Class.forName0(NativeMethod)atjava.lang.Class.forName(UnknownSource)atorg.bytedeco.javacpp.Loader.load(Loader.java:385)atorg.bytedec

java - 访问限制 : The type 'BASE64Decoder' is not API

这个问题在这里已经有了答案:EncodingasBase64inJava(19个回答)关闭3年前。我正在尝试将旧项目转换为Maven项目。但是当项目是maven时,它会在带有导入的类上显示警告:importsun.misc.BASE64Decoder;importsun.misc.BASE64Encoder;Accessrestriction:Thetype'BASE64Decoder'isnotAPI(restrictiononrequiredlibrary'C:\ProgramFiles\Java\jre7\lib\rt.jar')那么它有什么问题呢?

java - 泛型和通配符 : Java likes "new Foo<Bar<?>>"

好的,所以Java不允许以下内容:Foohello=newFoo();这是有道理的——毕竟,如果您只是想装箱/拆箱所有东西,泛型有什么意义呢?奇怪的是,Java确实允许这样做:Foo>howdy=newFoo>();诚然,这实际上完成了更多,但在某些时候,会有一个转换来获取Bar正在使用的任何内容。但是,如果Java可以接受一些特殊性,为什么它不允许这样做呢?:Foobonjour=newFoo();我问的唯一原因是我决定依赖“构造函数的类参数内的通配符”,并且非常想知道它背后的含义/意图。编辑:为了澄清我的问题,允许/禁止这些陈述的理由是什么?我知道“Java不允许在构造函数中使用通

java - ( hibernate ) java.sql.SQLException : Field 'xxxx' doesn't have a default value

Hibernate抛出以下异常:Causedby:java.sql.SQLException:Field'catVerb_id'doesn'thaveadefaultvalue人们说问题出在我的PK没有AUTO_INCREMENT语句,但是你可以看到我已经在我的数据库中完成了这个并且问题仍然存在。所以,我带来了我的类(class)和我的数据库实现。我认为我的问题出在测试类上......有人可以告诉我如何测试它吗?(是的,有些词是葡萄牙语,但您可以理解)。CategoriaVerbete@Entity@Table(name="verbete_categoria")publicclassC

java - 这是什么意思 : Not a v4. 0.0 POM。对于项目 org.codehaus.mojo:rpm-maven-plugin

恐怕我就是不知道这个错误是什么意思,除此之外还有一个错误。我以前能够构建jar,但这是我第一次使用rpm-maven-plugin。我想创建一个rpm,但到目前为止使用rpm-maven-plugin导致错误。[INFO]------------------------------------------------------------------------[ERROR]BUILDERROR[INFO]------------------------------------------------------------------------[INFO]Errorbuildin

java - ConstraintViolationException : NOT NULL when using Spring, HSQL 和 Hibernate

当我试图在数据库中插入一个Individual类型的对象时,我得到了一个NOTNULL违反约束的异常。我使用hsql版本2.3.2。我让hibernate为我生成数据库表。在正常代码中(我使用SQLServer数据库)一切正常。这是我的IndividualObject,ID是数据库生成的,是表的主键。单个对象:@XmlRootElement@Entity@Table(name="INDIVIDUALS")publicclassIndividual{@Id@GeneratedValue(strategy=GenerationType.IDENTITY)@Column(name="INDI

java.lang.AssertionError : Content type not set - Spring Controller Junit Tests 错误

我正在尝试对我的Controller进行一些单元测试。无论我做什么,所有Controller测试都会返回java.lang.AssertionError:Contenttypenotset我正在测试这些方法是否返回json和xml数据。这里是Controller的例子:@Controller@RequestMapping("/mypath")publicclassMyController{@AutowiredMyServicemyService;@RequestMapping(value="/schema",method=RequestMethod.GET)publicResponse

Java 错误 - 错误的源文件 : file does not contain class x . 请删除或确保它出现

最近为了考试开始学习Java。在学习包时,尝试了这个并得到了一条错误消息。我做的是//CreatingclassA(Withinpackagethepackage:com.test.helpers)packagecom.test.helpers;publicclassA{publicvoidsayHello(){System.out.println("HelloWorld");}}//AndthentheclassApputilisingtheclassAimportcom.test.helpers.*;publicclassApp{publicstaticvoidmain(Strin

java - 如何解决Primefaces中的 "p:message not working"?

我正在构建一个允许用户输入数据库连接参数的表单。输入参数后用户可以测试(btnTester)是否可以使用其参数建立连接。在所有情况下,都会为用户生成一条消息。这里是来自支持bean代码的连接尝试失败的示例:(...)addMessage(null,newFacesMessage(FacesMessage.SEVERITY_ERROR,"Connectionfailed.",t.getLocalizedMessage()));(...)这是表单代码。我希望消息出现在p:message中。不幸的是,什么也没有发生。按钮后不显示任何消息(连接成功与否):\即使将全局属性设置为false或tr

java - JPA 2.0/hibernate : Why does LAZY fetching with "@OneToOne" work out of the box?

我的问题是关于JPA2.0与Hibernate、@OneToOne关系和延迟加载。首先我的设置:Spring3.0.5.RELEASESprnigDataJPA1.0.1.RELEASEhibernate3.5.2-Final数据库管理系统:PostgreSQL9.0我最近发现,@OneToOne关系无法以惰性方式(FetchType.LAZY)获取,至少在没有字节码检测、编译时编织等情况下是这样。许多网站都这样说,例如:http://community.jboss.org/wiki/SomeExplanationsOnLazyLoadingone-to-onehttp://justo