glassfish-4

Why am I getting a TransactionRequiredException in @PostConstruct method in JTA EJB?

风流意气都作罢 提交于 2019-12-24 10:03:50
问题 I have Java EE project where I want to use an injected JTA EntityManager in the @PostConstruct method. EntityManager.persist fails due to javax.persistence.TransactionRequiredException . It succeeds when called through an EJB instance injected into a JSF managed bean. Manually starting a transaction with @Resource UserTransaction and UserTransaction.begin/commit or EntityManager.getTransaction.begin/commit because it's a JTA EntityManager . The EJB interface @Local public interface

Glassfish eclipse Plugin with jdk 8

本小妞迷上赌 提交于 2019-12-23 12:33:39
问题 Im trying to launch glassfish-4 using glassfish-eclipse-plugin. Unfortunately it does not seem to recognize the JDK-8 Release candidate i just installed (The "Finish" button stays disabled). Finish button will be enabled if i select a java 7 jdk Is there any options to work around this? 回答1: Now Lambda support works "out-of-the-box" if using below combination of software Oracle JDK 8 http://www.oracle.com/technetwork/java/javase/downloads/index.html Glassfish from 4.01 branch http://dlc.sun

JSF calling method with non String parameters

℡╲_俬逩灬. 提交于 2019-12-23 05:17:35
问题 I have in my JSF: <h:commandButton value="Add to Cart" rendered="#{movieDisplayController.movie.available != 0}" action="#{cartController.addMovie(movieDisplayController.movie, '2')}"> </h:commandButton> The action is underlined in red in eclipse (kepler JEE) and displays: Method must have signature "String method(), String method(), String method(String), String method(String, String), String method(String, String, String), String method(String, String, String, String), String method(String,

using GlassFish 4.0 and getting No suitable driver found for jdbc:mysql error

六月ゝ 毕业季﹏ 提交于 2019-12-23 05:11:24
问题 the following error i am getting; type Exception report messageInternal Server Error descriptionThe server encountered an internal error that prevented it from fulfilling this request. exception javax.servlet.ServletException: java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/chh-cw root cause java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/chh-cw the following is my project structure: is this the correct path to put the external

deploying web app to external glassfish4 instance with maven cargo plugin

梦想与她 提交于 2019-12-22 06:59:07
问题 I'm trying to deploy an app using cargo, this is the config for it: <plugin> <groupId>org.codehaus.cargo</groupId> <artifactId>cargo-maven2-plugin</artifactId> <version>1.4.9</version> <configuration> <wait>true</wait> <container> <containerId>glassfish4x</containerId> <type>remote</type> </container> <configuration> <type>runtime</type> <properties> <cargo.hostname>remote-IP-address</cargo.hostname> <cargo.remote.username>admin</cargo.remote.username> <cargo.remote.password>######</cargo

Stacktrace does not print in Glassfish 4.1 Cluster log

試著忘記壹切 提交于 2019-12-22 04:03:24
问题 Doing our first cluster setup on Glassfish (4.1). Application(EAR) level logs (ex printing a stacktrace) don't seem to reach the server.log in (GF-dir)/domains//logs/server.log or (GF-dir)/nodes/(node-name)/(instance-name)/server.log (There is no cluster.log as stated in documentation) We didn't change any of the default logging options in logging.properties. The current logs only show cluster and instance related information. 回答1: I had similar probrem. server.log is not output after MQJMSRA

why am I receiving NullPointerException on my jsp file?

吃可爱长大的小学妹 提交于 2019-12-22 01:18:24
问题 Once I click on a anchor tag on my jsp page, it perfectly works but the following exception will be thrown in console, based on this answer, I removed the jap-api*.jar files from my dependencies folder but the application still throws the exception. WARNING: Servlet.service() for servlet jsp threw exception java.lang.NullPointerException at org.apache.jsp.products.ProductShow_jsp._jspx_meth_c_if_1(ProductShow_jsp.java:211) at org.apache.jsp.products.ProductShow_jsp._jspService(ProductShow_jsp

injectionPoint.getBean() returns null if bean is an EJB bean in Java EE 7 (CDI 1.1)

久未见 提交于 2019-12-21 02:36:08
问题 I want to get bean from producer method in order to read its properties. In some scenarios the bean is a EJB Singleton bean. I've simplified my code to focus on the problem. My simple qualifier: @Qualifier @Retention(RUNTIME) @Target({TYPE, METHOD, FIELD, PARAMETER}) public @interface InjectMe {} Simple producer: @Dependent public class SimpleProducer { @Produces @InjectMe public String getInjectMe(InjectionPoint ip) { // ip.getBean() returns null for some reason return "ip=" + ip + ", bean="

injectionPoint.getBean() returns null if bean is an EJB bean in Java EE 7 (CDI 1.1)

三世轮回 提交于 2019-12-21 02:35:20
问题 I want to get bean from producer method in order to read its properties. In some scenarios the bean is a EJB Singleton bean. I've simplified my code to focus on the problem. My simple qualifier: @Qualifier @Retention(RUNTIME) @Target({TYPE, METHOD, FIELD, PARAMETER}) public @interface InjectMe {} Simple producer: @Dependent public class SimpleProducer { @Produces @InjectMe public String getInjectMe(InjectionPoint ip) { // ip.getBean() returns null for some reason return "ip=" + ip + ", bean="

How to deploy a war file in GlassFish 4 server Using Jenkins

让人想犯罪 __ 提交于 2019-12-20 04:24:19
问题 I am using Jenkins to deploy a war file in GlassFish 4 server.But unable to deploy war file in Glassfish 4 server. I am following below process. But it gives following error at the build time. ERROR: Build step failed with exception org.codehaus.cargo.util.CargoException: Cannot create the DeploymentManager at org.codehaus.cargo.container.spi.deployer.AbstractJsr88Deployer.getDeploymentManager(AbstractJsr88Deployer.java:356) at org.codehaus.cargo.container.spi.deployer.AbstractJsr88Deployer