草庐IT

command-not-found

全部标签

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 - Play Framework CSRF 错误 "[CSRF] Check failed because no token found in headers"

我是PlayFramework的新手,正在尝试提交表单,但是得到这个错误:“p.filters.CSRF-[CSRF]Checkfailedbecausenotokenfoundinheaders”。我正在使用Play2.6,这是我的Controller代码:packagecontrollers;importplay.libs.Json;importplay.mvc.*;importviews.html.*;importjava.util.ArrayList;importjava.util.List;importjava.util.Map;publicclassHomeControll

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 - 测试上下文中的 "Could not open ServletContext resource"

我正在尝试使用Spring创建单元测试。测试类:@RunWith(SpringRunner.class)@SpringBootTest(classes={MyConfig.class})publicclassMyTest{@Testpublicvoid...}要加载的类:@ConfigurationProperties()@PropertySource("config/myConfig.properties")@ComponentpublicclassMyConfig{}异常(exception):Causedby:org.springframework.beans.factory.B

java - OffsetDateTime 在 GET 方法中产生 "No injection source found for a parameter of type public javax.ws.rs.core.response"

我有以下GETREST方法:importjava.time.OffsetDateTime;importjavax.ws.rs.Consumes;importjavax.ws.rs.DELETE;importjavax.ws.rs.GET;importjavax.ws.rs.HeaderParam;importjavax.ws.rs.POST;importjavax.ws.rs.PUT;importjavax.ws.rs.Path;importjavax.ws.rs.PathParam;importjavax.ws.rs.Produces;importjavax.ws.rs.QueryP