小编SJu*_*n76的帖子

不能将@IdClass属性用于@ManyToOne关系

我有一个Gfh_i18n实体,带有一个复合键(@IdClass):

@Entity @IdClass(es.caib.gesma.petcom.data.entity.id.Gfh_i18n_id.class)
public class Gfh_i18n implements Serializable {

  @Id @Column(length=10, nullable = false)
  private String localeId = null;

  @Id <-- This is the attribute causing issues
  private Gfh gfh = null;
  ....
}
Run Code Online (Sandbox Code Playgroud)

和id类

public class Gfh_i18n_id implements Serializable {
  private String localeId = null;
  private Gfh gfh = null;
  ...
}
Run Code Online (Sandbox Code Playgroud)

正如这写的,这是有效的.问题是我还有一个Gfh与之@OneToMany关系的课程Gfh_i18n:

@OneToMany(mappedBy="gfh")
@MapKey(name="localeId")
private Map<String, Gfh_i18n> descriptions = null;
Run Code Online (Sandbox Code Playgroud)

使用Eclipse Dali,这给了我以下错误:

 In attribute 'descriptions', the "mapped by" …
Run Code Online (Sandbox Code Playgroud)

jpa jpa-2.0

2
推荐指数
1
解决办法
8283
查看次数

查找Drawable资源时出现NotFoundException

我开始使用android,我想在这个答案中描述为细胞添加边框.所以我创建了我的cell_background.xml文件,Eclipse在其中创建res\drawable并包含

<?xml version="1.0" encoding="utf-8"?>
<shape
   xmlns:android="http://schemas.android.com/apk/res/android"
   android:shape= "rectangle"  >
    <solid android:color="#000"/>
    <stroke android:width="1dp"  android:color="#ff9"/>
</shape>
Run Code Online (Sandbox Code Playgroud)

看过drawable文件夹有几个问题后,我将其逐字复制到res\drawable-*dpi目录中

现在,我的应用程序崩溃在以下行

Drawable drawable = Resources.getSystem().getDrawable(R.drawable.cell_background);
Run Code Online (Sandbox Code Playgroud)

有这个例外

12-16 14:26:28.624: E/AndroidRuntime(533): Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f020000
Run Code Online (Sandbox Code Playgroud)

项目和模拟器都设置为v3.0

有任何想法吗?我已经清理并重建了该项目,但它仍然崩溃了.

android

1
推荐指数
1
解决办法
4139
查看次数

在jsf primefaces中停止ajax轮询?

我正在使用素面3.2.Ajax轮询没有停止,我使用停止属性来停止轮询,我试图使用getter和setter停止它来形成bean.即使我已经使用java脚本停止但我不能.任何停止投票的解决方案?

jsf primefaces

1
推荐指数
1
解决办法
9437
查看次数

Primefaces扩展ajaxErrorHandler无法正常工作

在WildFly 8-1我primefaces-5.1.jarprimefaces-extensions-2.1.0.jar我的webapps WEB-INF/lib目录下.

我配置了WEB-INF/faces-config.xml:

<?xml version="1.0" encoding="UTF-8"?>
<faces-config
  xmlns="http://xmlns.jcp.org/xml/ns/javaee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_2.xsd"
version="2.2">
  <application>
    <el-resolver>org.primefaces.application.exceptionhandler.PrimeExceptionHandlerELResolver</el-resolver>
  </application>

  <factory>
    <exception-handler-factory>org.primefaces.application.exceptionhandler.PrimeExceptionHandlerFactory</exception-handler-factory>
  </factory>
</faces-config>
Run Code Online (Sandbox Code Playgroud)

我有以下JSF.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
  xmlns:h="http://xmlns.jcp.org/jsf/html"
  xmlns:f="http://xmlns.jcp.org/jsf/core"
  xmlns:p="http://primefaces.org/ui"
  xmlns:pe="http://primefaces.org/ui/extensions">
<h:head></h:head>
<h:body>
  <h:form id="form">
    <pe:ajaxErrorHandler body="ERROR"/>
    <p:commandButton actionListener="#{dossierResumen.excepcion}" value="Excepción"/>
  </h:form>
</h:body>
</html>
Run Code Online (Sandbox Code Playgroud)

这里DossierResumen#excepcion()

public void excepcion() {
  throw new NullPointerException("EXCEPCION! EXCEPCION!");
}
Run Code Online (Sandbox Code Playgroud)

当我点击按钮时,我根本没有弹出窗口; 页面被重定向到定义的错误500的URL web.xml.在日志中,我得到以下堆栈跟踪墙:

我究竟做错了什么?

15:44:14,206 ERROR [stderr](默认任务-42)java.lang.NullPointerException:EXCEPCION!EXCEPCION!15:44:14,206 ERROR [stderr](默认任务-42)at es.imasmallorca.selene.webone.jsf.controller.dossier.DossierResumen.excepcion(DossierResumen.java:55)15:44:14,206 ERROR [stderr](默认任务-42)at es.imasmallorca.selene.webone.jsf.controller.dossier.DossierResumen $ Proxy $ _ $$ …

primefaces jsf-2 primefaces-extensions wildfly-8

1
推荐指数
1
解决办法
6331
查看次数

定义 jboss-web.xml 安全域导致我的 EJB 缺少依赖项

我有一个工作正常的 Web 应用程序(一个 .war,其中包含一个带有三个 EJB 的 .jar)。

我通过 jboss-cli 定义 LDAP 安全域:

/subsystem=elytron/dir-context=pepDirContext:add(url="ldap://127.0.0.1:10389",principal="uid=admin,ou=system",credential-reference={clear-text="secret “})

/subsystem=elytron/ldap-realm=pepRealm:add(dir-context=pepDirContext,identity-mapping={search-base-dn="ou=Users,dc=jboss,dc=org",rdn-identifier=uid, user-password-mapper={from="userPassword"},attribute-mapping=[{filter-base-dn="ou=Roles,dc=jboss,dc=org",filter="(&(objectClass=groupOfNames) (member={1}))",from="cn",to="Roles"}]})

/subsystem=elytron/simple-role-decoder=from-roles-attribute:add(attribute=Roles)

/subsystem=elytron/security-domain=pepSD:add(realms=[{realm=pepRealm,role-decoder=from-roles-attribute}],default-realm=pepRealm,permission-mapper=default-permission-mapper)

/subsystem=elytron/http-authentication-factory=pep-http-auth:add(http-server-mechanism-factory=global,security-domain=pepSD,mechanism-configurations=[{mechanism-name=BASIC,mechanism-realm -configurations=[{领域名称=pepRealm}]}]

/subsystem=undertow/application-security-domain=pepASD:add(http-authentication-factory=pep-http-auth)

/subsystem=undertow/application-security-domain=pepSD:add(http-authentication-factory=pep-http-auth)

注意:我已经决定两个“应用程序安全域”作为测试的一部分,理想情况下我只想使用 pepASD。

现在,我将 WEB-INF/jboss-web.xml 文件添加到我的 war 中:

<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
    <security-domain>pepSD</security-domain>
</jboss-web>
Run Code Online (Sandbox Code Playgroud)

当我部署它时,我得到:

14:48:31,347 错误 [org.jboss.as.controller.management-operation](DeploymentScanner-threads - 2)WFLYCTL0013:操作(“完全替换部署”)失败 - 地址:([]) - 失败描述: {
"WFLYCTL0412: 未安装所需的服务:" => ["jboss.security.security-domain.pepSD"],
"WFLYCTL0180: 缺少/不可用依赖项的服务" => [
"jboss.deployment.unit.\" frontend.war\".component.UsuarioEjb.CREATE 缺失 [jboss.security.security-domain.pepSD]"、
"jboss.deployment.unit.\"frontend.war\".component.GerenciaEjb.CREATE 缺失 [jboss .security.security-domain.pepSD]”、
“jboss.deployment.unit.\”frontend.war\“.component.FlujoEjb.CREATE 丢失 [jboss.security.security-domain.pepSD]”

我缺少什么?

我在 Java 11 上使用 WildFly 18.0.0.1。

java wildfly elytron

1
推荐指数
1
解决办法
1928
查看次数