草庐IT

not_matched

全部标签

使用 findbugs 的 java 编译错误。 com.sun.tools.javac.code.Symbol$CompletionFailure : class file for javax. annotation.meta.When not found

我正在尝试使用findbugs1.3.2的注释。我在一个简单的测试中使用了edu.umd.cs.findbugs.annotations.NonNull注释,它工作正常。但是,现在我有一个大项目,由子模块组成,使用maven,我通过在某个java文件中导入该注释得到以下编译错误:com.sun.tools.javac.code.Symbol$CompletionFailure:classfileforjavax.annotation.meta.Whennotfound可能是什么问题?我尝试在所有子模块中添加findbugs依赖项。也许它与jsr305冲突?我看到我们的依赖项之一使用js

Java "Jackson"JsonMappingException : Can not deserialize instance of float out of FIELD_NAME token

与这个类:publicclassProductsimplementsSerializable{privateBigDecimalproductId;privatefloatpriority;publicfloatgetPriority(){returnpriority;}publicvoidsetPriority(floatpriority){this.priority=priority;}}在对此类JSON数据进行反序列化时:{"productId":47552,"priority":78}出现这个错误:org.codehaus.jackson.map.JsonMappingExce

Java Spring WS org.springframework.ws.soap.saaj.SaajSoapEnvelopeException : Could not access envelope

我在不同的环境中遇到了springws的奇怪行为。以下在本地tomcat7.0.29上与SoapUI一起工作正常,但确实返回下面提到的错误。servlet.xml:classpath:ws.propertiescom.db.vhs.ws.jaxb.PlacementRequestcom.db.vhs.ws.jaxb.PlacementResponse...scheam.xsd:第一种方法适用于两种环境,第二种方法(placementRequest)返回:ApacheTomcat/7.0.29-ErrorreportHTTPStatus500-Requestprocessingfaile

java - "variable may not have been initialized"的设计合理性是什么?

这个问题在这里已经有了答案:Whymustlocalvariables,includingprimitives,alwaysbeinitializedinJava?(8个答案)关闭9年前。众所周知,在Java中需要在使用局部变量之前对其进行初始化(参见JLS)Alocalvariable(§14.4,§14.14)mustbeexplicitlygivenavaluebeforeitisused,byeitherinitialization(§14.4)orassignment(§15.26),inawaythatcanbeverifiedusingtherulesfordefinit

java - 名称未找到异常 : While trying to lookup 'jdbc' only when publishing from Eclipse Kepler but not Indigo

我可以使用oepe12.1.1.1.1从EclipseIndigo3.7.2将我的网络应用程序发布到OracleWeblogic12c(12.1.1)AdminServer但是,使用oepe12.1.2.2导入到EclipseKepler4.3.1中的完全相同的web应用程序无法发布,并出现以下(相当常见的)异常,我正在尝试找出原因?...NameNotFoundException:Whiletryingtolookup'jdbc.oraclexe'didn'tfindsubcontext'jdbc'.Resolved'';remainingname'jdbc/oraclexe'];L

java - grails spock 测试失败,显示 'java.lang.IllegalArgumentException: ServletContext must not be null'

我在commandclass中有一个方法,它使用messageSource.getMessage(...),因为messageSource不会被注入(inject)到commandClass。我用defmessageSource=Holders.applicationContext.getBean("messageSource")在commandClass中。我的问题是在尝试编写单元测试这个方法时,@Beforevoidsetup(){Holders.applicationContext.getBean("messageSource")}void"testFunction"(){//i

java - 导入jar文件时pyjnius "Class not found"

我试图让pyjnius使用我从java应用程序构建的jar文件,但我不断收到“找不到类”错误:>>>importos>>>os.environ['CLASSPATH']="~/workspace/myapp-Tools/Admin/Console/couchdb/myapp-web.jar">>>fromjniusimportautoclass>>>bla=autoclass('com/myapp/webapp/server/helpers/licensee/CalculationHelper')Traceback(mostrecentcalllast):File"",line1,in

java - Log4j2 的 FailoverAppender 错误 : appender Failover has no parameter that matches element Failovers

当我使用log4j2.1编译我的spring3.2.9web应用程序时,这个错误出现在控制台中:2015-02-0212:08:25,213ERRORappenderFailoverhasnoparameterthatmatcheselementFailovers我的理解是元素“Failover”中不存在元素“Failover”,对吗?为什么会这样?我看不出有什么问题,因为我有sameconfigurationasthelog4j2manual.我的log4j2.xml中有这个配置:[%d{ISO8601}]%c[%C{1}]-%p:%m%n[%d{ISO8601}][%c]-%p:%

java - 使用 JVM Nashorn (Play Framework) 呈现 React.js 时出错。我得到 "null is not a function"

我一直在阅读本教程:http://tylermcginnis.com/reactjs-tutorial-a-comprehensive-guide-to-building-apps-with-react/,并在使用Nashorn在JVM上渲染React时遇到问题。我的App.js文件如下。在客户端上运行时它可以正常工作。只是在使用Nashorn/JVM时报错:varApp=React.createClass({getInitialState:function(){return{name:'TylerMcGinnis',friends:['JakeLingwall','MurphyRan

java - 如何在 SonarQube 中抑制警告 'Source files should not have any duplicated blocks'?

我正在使用SonarQube5.4并调查几个问题的抑制。我发现一旦我插入@SuppressWarnings("common-java:DuplicatedBlocks"),SonarQube就没有检测到抑制规则Sourcefilesshouldnothaveanyduplicatedblocks在文件的开头(文件无法编译)或在其中一个重复代码块的标记处。我在http://docs.sonarqube.org/display/PLUG/Java+FAQ找到了信息声明如下:The//NOSONARtagisusefultodeactivateallrulesatagivenlinebuti