小编Hel*_*sch的帖子

JPA SubGraph定义嵌入属性的fetchtype

我有一个实体Ride,它嵌入了一个可嵌入的"实体" 路径.路线有一个列表属性城镇与多对多的关系,所以它有fetchtype LAZY(我不希望使用EAGER).所以我想定义的实体NamedEntityGraph 平顺,加载加载一个物体路线与instantied名单城镇.但是当我部署战争时,我得到了这个例外:

java.lang.IllegalArgumentException:Attribute [route]不是托管类型

@Entity
@NamedQueries({
@NamedQuery(name = "Ride.findAll", query = "SELECT m FROM Ride m")})
@NamedEntityGraphs({
@NamedEntityGraph(
        name = "rideWithInstanciatedRoute",
        attributeNodes = {
            @NamedAttributeNode(value = "route", subgraph = "routeWithTowns")
        },
        subgraphs = {
            @NamedSubgraph(
                    name = "routeWithTowns",
                    attributeNodes = {
                        @NamedAttributeNode("towns")
                    }
            )
        }
    )
})
public class Ride implements Serializable {

    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = …
Run Code Online (Sandbox Code Playgroud)

java jpa embeddable jpa-2.1

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

Wildfly 8基本身份验证

我在Wildfly 8上运行了一个Java-Webapp.I尝试使用resteasy Annotations保护我的restful webservice.我使用命令行工具curl来测试其余的api.

基本身份验证设置似乎有效.带注释"@PermitAll"的Web服务的Http请求工作正常.Curl说:

~ % curl -v http://localhost:8080/ItilityServer-web/rest/account 
> GET /ItilityServer-web/rest/account HTTP/1.1
> User-Agent: curl/7.40.0
> Host: localhost:8080
> Accept: */*
> 
< HTTP/1.1 200 OK
< Connection: keep-alive
< X-Powered-By: Undertow/1
< Server: WildFly/8
< Content-Length: 0
< Date: Wed, 28 Jan 2015 10:47:11 GMT
< 
* Connection #0 to host localhost left intact
Run Code Online (Sandbox Code Playgroud)

但是包含有效用户名和密码的http请求被拒绝,状态代码401未经授权.Wildfly记录错误无法匹配的密码:

2015-01-28 11:42:43,565 TRACE [org.jboss.security] (default task-5) PBOX000263: Executing query SELECT a.password FROM Account a WHERE a.name = ? with username hans
2015-01-28 …
Run Code Online (Sandbox Code Playgroud)

authentication jax-rs resteasy wildfly

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

Wildfly刷新安全域的缓存

我有一个部署在wildfly上的JAX-RS接口的war项目,并且配置了一个安全域,它从db加载用户密码和角色.安全域使用cache-type = default.安全域无法识别经过身份验证的用户的更新,因为旧数据已缓存.我用jboss-cli.sh验证了这一点.那么如何从缓存中删除特定用户?我想在已部署的应用程序中执行此操作,而不是通过jboss-cli.sh执行此操作.

jboss caching flush securitydomain wildfly

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

Arquillian测试未执行

我有一个多模块项目,用maven组织和构建.它由一个war-module,一个ejb-module和一个ear-module组成.他们拥有相同的父项目(用于依赖管理).结构如下:

| - parent(包装pom)
| - ejb-module
| - war-module
| - ear-module

Built order is first ejb-module then war-module than ear-module. The project depends on arquillian for testing. Both ejb-module and war-module contain a test. When I run "mvn clean test -Parq-wildfly-managed" (profile is to activate testing) the test of ejb-module is executed, but the test of war-module is not executed and there is no surefire-report in the target folder. There is no additional information on the output. I …

java testing java-ee maven jboss-arquillian

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