草庐IT

java - 使用自定义字体 [java.io.IOException : Error reading font data.]

标题不允许我说问题,所以实际的错误信息是-java.io.IOException:Problemreadingfontdata.atjava.awt.Font.createFont(UnknownSource)atAddFont.createFont(AddFont.java:11)atMainFrame$1.run(MainFrame.java:105)atjava.awt.event.InvocationEvent.dispatch(UnknownSource)atjava.awt.EventQueue.dispatchEventImpl(UnknownSource)atjava.

java - 使用 Cargo Java API 和 Jenkins 部署到 Wildfly 时出现 "XNIO001001: No XNIO provider found"错误

我正在开发一个Jenkins插件,它使用CodehausCargoJavaAPI管理EAR文件到JavaEE容器的部署,但是我在使用API部署到远程Wildfly容器时遇到了问题。当部署到其他容器(如Glassfish)时,代码工作正常,但当尝试将EAR文件部署到Wildfly容器时,返回错误消息XNIO001001:NoXNIOproviderfound。我花了几个小时研究这个问题,但找不到任何可能解决问题的方法。尝试部署到在Windows和Ubuntu上运行的Wildfly8.1和8.2时会出现此问题。我还检查了Wildfly服务器日志,但它不包含与此问题相关的任何内容。我的问题是

java - Hibernate : could not initialize proxy - no Session 中的 LazyInitializationException

我从我的服务中调用dao@Override@TransactionalpublicProductgetProductById(intid){returnproductDao.getProductById(id);}在dao中我得到的产品是@OverridepublicProductgetProductById(intid){Productp=sessionFactory.getCurrentSession().load(Product.class,id);System.out.print(p);returnp;}这运行良好,但如果我将我的dao类更改为@OverridepublicPr

java - 编译时间 : no instance(s) of type variable(s) U exist

以下语句虽然毫无意义,但在句法上是合理的。finalStreamfoobar=IntStream.empty().flatMap(x->IntStream.empty().mapToObj(y->IntStream.empty().mapToLong(z->1)));//compilationerrorhereon`z->1`但是它不编译,返回:java:incompatibletypes:badreturntypeinlambdaexpressionnoinstance(s)oftypevariable(s)Uexistsothatjava.util.stream.Streamcon

java - 如何将 hibernate @DynamicUpdate 与 spring data jpa 一起使用?

我正在使用springdata-jpa。我只想更新一列。我的仓库是;publicinterfaceUserRepositoryextendsJpaRepository{}我的服务是;publicUsersave(Useruser){returnuserRepository.save(user);}我的实体;@Entity@DynamicUpdate(true)publicclassUserimplementsSerializable{//columndefinitions,etc.}如何只更新User中的一列? 最佳答案 首先,我想

java - 无法在 Spring Data Repository 中创建自定义查询方法

这个问题在这里已经有了答案:HowtoaddcustommethodtoSpringDataJPA(13个答案)关闭4年前。我想创建自定义存储库:publicinterfaceFriendRepositoryCustom{PagefindFriends(FriendCriteriafriendCriteria,Pageablepageable);}及其实现:@Repository@Transactional(readOnly=true)publicclassFriendRepositoryCustomImplimplementsFriendRepositoryCustom{@Persi

java - 为什么 ‘No database selected’ SQLException?

这个问题在这里已经有了答案:java.sql.SQLException:Nodatabaseselected-why?(4个答案)关闭3年前。为什么这个程序在第二次进入dowhile循环时没有执行,为什么它给出异常“Exceptionjava.sql.SQLException:[MySQL][ODBC5.1Driver][mysqld-5.0.51a-community-nt]没有选择数据库”//importjava.io.InputStream;importjava.sql.Connection;importjava.sql.DriverManager;importjava.sql.

java - 为什么我在使用 SAXParser 时得到 "MalformedURLException: no protocol"?

我正在将代码从我们应用程序的一部分(小程序)复制到应用程序内部。我正在将XML解析为字符串。自从我解析XML以来已经有一段时间了,但从抛出的错误来看,它似乎与找不到.dtd有关。堆栈跟踪使得很难找到错误的确切原因,但消息如下:java.net.MalformedURLException:noprotocol:http://www.mycomp.com/MyComp.dtdXML的前几行是这样的:http://www.mycomp.com/MyComp.dtd'>这是相关的代码片段classXMLImportParserextendsDefaultHandler{privateSAXPa

java - 属性 'userDetailsService' : no matching editors or conversion strategy found

我总是得到:java.lang.Exception:java.lang.IllegalStateException:ContainerBase.addChild:start:org.apache.catalina.LifecycleException:org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'org.springframework.security.filterChains':Cannotresolvereferencetobean'org.springframew

java - Spring Data 网页分页 "page"参数不起作用

我正在尝试让SpringData的Web分页正常工作。在这里描述:http://static.springsource.org/spring-data/data-jpa/docs/current/reference/html/repositories.html#web-pagination这是我的Java(SpringWebMVC@Controller处理程序方法):@RequestMapping(value="/list",method=RequestMethod.GET)publicStringlist(@PageableDefaults(value=50,pageNumber=0