java-ee-6

Shiro UnknownSessionException after logout

感情迁移 提交于 2019-12-22 10:29:49
问题 I'm currently working on a web application in JavaEE6 stack and I've integrated Shiro for security. I think the authentication and authorization is working properly now and I have 1 last problem. When I logout, I'm encountering UnknownSessionException, here are my config and codes for inspection: web.xml <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns

Issue with EJB 3.1 injected with CDI bean while running JUnit

回眸只為那壹抹淺笑 提交于 2019-12-22 10:25:09
问题 I created a EJB3.1 and injected CDI bean using the @inject but facing some issues while unit testing however when tested from the servlet its working fine. I have the beans.xml in the WEB-INF folder. Below is my EJB code: @Stateless public class CdiUsingEjb { @Inject private HelloServletCDIPojo helloServletCDIPojo; public String greet() { assert helloServletCDIPojo != null; return helloServletCDIPojo.from(); } } Below is my CDI bean: public class HelloServletCDIPojo { public String from() {

Issue with EJB 3.1 injected with CDI bean while running JUnit

大憨熊 提交于 2019-12-22 10:18:47
问题 I created a EJB3.1 and injected CDI bean using the @inject but facing some issues while unit testing however when tested from the servlet its working fine. I have the beans.xml in the WEB-INF folder. Below is my EJB code: @Stateless public class CdiUsingEjb { @Inject private HelloServletCDIPojo helloServletCDIPojo; public String greet() { assert helloServletCDIPojo != null; return helloServletCDIPojo.from(); } } Below is my CDI bean: public class HelloServletCDIPojo { public String from() {

Custom Security mechanism in Java EE 6/7 application

故事扮演 提交于 2019-12-22 10:10:02
问题 I would like to create (implement by my own) authentication mechanism which will be plugged into my Java EE application. As far as I know I have to implement LoginModule and connect this implementation with container mechanisms somehow. But the problem is that I don't know how to do it. Maybe You know where I can find sample code or tutorial about it? In other words I would like to force container to call my classes whenever methods: authenticate, login, and logout are called. Sample

JavaEE CDI in Weld: Generic Events?

狂风中的少年 提交于 2019-12-22 10:02:52
问题 I have an idea for a specific event handling based on generics, but seems like Weld can't handle them. I asked google but couldn't find an alternative CDI extension for this. Question : is there a CDI extension, that can handle event propagation of generic-typed events? In the following the explicit problem I have. I have three general events, EntityCreated, EntityChanged and EntityDeleted. The base class for them is defined like this: public abstract class DatabaseEvent<TargetType> { public

jax-b xml inverse reference with many to many relationship

流过昼夜 提交于 2019-12-22 09:18:18
问题 I have a few many to many relationships in my data model. I have been trying to use JAX=B to get XML representations of the data models, however I have read that for one to many relationships an: @XmlInverseReference is needed for the inverse side of the mapping. I believe this is for using different fetch types (ie. LAZY and EAGER). I am unsure of exactly how this annotation works. Does it use back pointers to ensure that data is not fetched when it is specified on certain fields? I also do

Rest Filter : registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime

大兔子大兔子 提交于 2019-12-22 08:51:59
问题 I am getting an error : A provider com.xyx.in.astra.aqr.security.application.requestFilter.UniversalSessionManagerFilter registered in SERVER runtime does not implement any provider interfaces applicable in the SERVER runtime. Due to constraint configuration problems the provider com.xyx.in.astra.aqr.security.application.requestFilter.UniversalSessionManagerFilter will be ignored. NOTE : 1) This UniversalSessionManagerFilter filter is in external jar file which is in the server classpath 2) I

Any open source java library which can parse an EDI file in both ANSI x12 and UN/EDIFACT standards?

匆匆过客 提交于 2019-12-22 08:14:27
问题 Is there any open source java library which can parse an EDI file in both ANSI X12 and UN/EDIFACT standards? I have found smooks (http://www.smooks.org), which supports UN/EDIFACT standard but not sure whether this will support EDI files in ANSI X12 standard. Thanks in advance. 回答1: Smooks team publish their future release would start supporting the X12 version.I eagerly waiting here too. 回答2: According documentation EDIReader can parse both ANSI X12 and UN/EDIFACT. 回答3: I have successfully

Controlling CDI Startup inside EJB 3.1

試著忘記壹切 提交于 2019-12-22 07:24:49
问题 I'm new in here and also new to the CDI world, and the first task I got in my job was to find out a way to controlled CDI uploading. We are using both EJB 3.1 and CDI 1.0 , and because they are controlled by different containers, we can control when and in what order the EJB Managed Beans will be up by using @Startup and @Singleton annotations. But the @Inject CDI bean I have declared in my class is coming as null since the CDI Container hasn't started yet. I have been trying for several days

What is the difference between mappedName and lookup attributes of @Resource annotation in EJB?

蹲街弑〆低调 提交于 2019-12-22 05:23:36
问题 I'm confused between two attributes of @Resource annotation. Java Documentations says : mappedName : A product specific name that this resource should be mapped to. The name of this resource, as defined by the name element or defaulted, is a name that is local to the application component using the resource. (It's a name in the JNDI java:comp/env namespace.) Many application servers provide a way to map these local names to names of resources known to the application server. This mapped name