java-ee

OpenJPA 2.1.1 enhancement problem on Glassfish 3.1.1

那年仲夏 提交于 2019-12-22 10:16:39
问题 My problem is this exception: Caused by: <openjpa-2.1.1-r422266:1148538 nonfatal user error> org.apache.openjpa.persistence.ArgumentException: This configuration disallows runtime optimization, but the following listed types were not enhanced at build time or at class load time with a javaagent: " I'm trying to get an very simple java application with jsf and jpa running, but there seems to be a problem with the enhancement of my entities. As far as I know, tries OpenJPA to enhance my

How to store retrieved object in session and access it afterwords?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-22 09:55:13
问题 I am trying to create a simple login page. I retrieve a User object from my database using hibernate. That part works fine, I'm doing that as follows: //data from login form String username = request.getParameter("username").trim(); String password = request.getParameter("password").trim(); SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory(); Session session = sessionFactory.openSession(); session.beginTransaction(); try { User currentUser = (User) session

Single page application with Java EE/Wildfly: server-side configuration

半世苍凉 提交于 2019-12-22 09:55:02
问题 I want to write an SPA with AngularJS on client side and Java EE on server side. If I understand it correctly, the idea for the frontend is to create a default page (let's call it index.html ) and implement routing to exchange parts of this default page. So with every request the default page is loaded and the routing logic replaces its parts depending on context path: <!-- index.html --> <html> <body> <!-- this block is replaced depending on context --> <div ng-view></div> </body> </html> <!

Netbeans 7.1.2 - Unable to add glassfish server 3.1.2

。_饼干妹妹 提交于 2019-12-22 09:41:40
问题 I downloaded glassfish server from http://glassfish.java.net/downloads/3.1.2.2-final.html and installed in separately. Now I am trying to add this in Netbeans. But it does not work. I did the below steps Open Netbeans as administrator Open Tools -> Servers Click "Add Server" button Choose GlassFish Server 3+ Specify a name as "GlassFish" Choose the installation folder location - C:\glassfish3 Now it displays the error "Not a valid Glassfish server Installation". I am new to Netbeans &

@Singleton bean failed to initialize because of not expected transaction status 4 when it's marked TransactionAttribute=NOT_SUPPORTED

和自甴很熟 提交于 2019-12-22 09:40:10
问题 I'm having difficulty with my EJB3.1 bean initialisation and more specifically to do with it failing due to perceived transaction rollback, even though I've marked the bean with @TransactionAttribute(NOT_SUPPORTED) . This should mean that any client transaction is paused on bean method entry until exit (when it will be resumed. It's definitely the transactional apprach I want. The "gist" of the code and error are as follows (note some of it is hand-cranked to hide details but is all relevant

Message Driven Bean Selectors (JMS)

你说的曾经没有我的故事 提交于 2019-12-22 08:39:32
问题 I have recently discovered message selectors @ActivationConfigProperty( propertyName="messageSelector", propertyValue="Fragile IS TRUE") My Question is: How can I make the selector dynamic at runtime? Lets say a consumer decided they wanted only messages with the property "Fragile IS FALSE" Could the consumer change the selector somehow without redeploying the MDB? Note: I am using Glassfish v2.1 回答1: To my knowledge, this is not possible. There may be implementations that will allow it via

Injecting EntityManager in JBoss/WildFly

纵然是瞬间 提交于 2019-12-22 08:38:48
问题 I am learning JPA, EJB and JBoss/WildFly. I need to inject an EntityManager into my application. I am trying to do it in the following way: @Stateless @LocalBean public class ProductsService implements IProductsService { @PersistenceContext(unitName = "myUnit") EntityManager entityManager; //.... } And I have persistence.xml file in the META-INF directory in my .war archive: <?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">

How do I specify which security domain to use for my web application in JBoss AS7?

[亡魂溺海] 提交于 2019-12-22 08:36:35
问题 I'm using JBoss AS7 + JSF 2.1 I'm trying to use a Database login module to authenticate users on a specific resource in my web application. In standalone.xml there are 3 security domains: "other", "jboss-web-policy" and "jboss-ejb-policy". Should I put my database login module in the "other" security domain? Or I should define a new custom security domain and put my database login module in it? Either way, how will I tell JBoss which security-domain/login module it should use for my

javac: invalid flag: activation-1.1.jar

若如初见. 提交于 2019-12-22 08:23:35
问题 I'm using Tomcat7 , jdk 1.7.0_55 & eclipse, when I trying to compile the entire project(Java Code) using COMMAND PROMPT, its showing Error Like javac: invalid flag: D:\COMPILE\lib\activation-1.1.jar. The given below steps are followed to compile the code. Step.1: dir *.java /s /b > FilesList.txt Step.2: javac @FilesList.txt -d compiledCode -cp D:\COMPILE\lib\*.jar After run the Step.2 command its showing Error.so I removed the error jar file from my lib folder & run the command but its

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