glassfish-embedded

Any best practices for dealing with Java EE and java.endorsed.dirs?

非 Y 不嫁゛ 提交于 2020-02-01 03:12:41
问题 I've recently run into a problem with glassfish standalone (v3.1) vs glassfish embedded (v3.1) vs java SE and the way java.endorsed.dirs is used. The specific problem I had is here, but I don't think it's the last time I'm going to run into something similar. The information I found here and here suggests adding the glassfish endorsed libs to the bootstrap classpath when compiling. However, this bug report suggests it is difficult to get the endorsed libs set correctly when using glassfish

What is the official Maven repository for Embedded GlassFish?

假如想象 提交于 2020-01-03 12:33:47
问题 http://maven.glassfish.org/content/groups/glassfish/ looks like it should be GlassFish's official Maven repository, but it currently hosts only up to version 3.1.1-b05 of glassfish-embedded-all (see http://maven.glassfish.org/content/groups/glassfish/org/glassfish/extras/glassfish-embedded-all/). http://download.java.net/maven/glassfish/org/glassfish/extras/ is linked to from Embedded GlassFish's site (Embedded Jars). It doesn't look like an official Maven repository but hosts up to 3.1.1-b11

How to test login/authentication with Arquillian - Java EE 7

北城余情 提交于 2019-12-30 02:19:10
问题 We have a Java EE 7 application and use Arquillian to test stuff. Now we want to check for some permissions of the currently logged in user. My question is quite basic, how do I login a user when inside a testcase? I have read ProgrammaticLogin doesnt work in arquillian tests and Embedded Glassfish, security and Arquillian questions but they are not clearly answered. My current approach is something like this: // Inject services etc. @Test public void testLogin(){ UserAccount user = new

Using different eclipselink than bundled in glassfish-embedded-web

半世苍凉 提交于 2019-12-24 02:26:27
问题 I use glassfish-embedded-web for integration tests inside a maven project: <dependency> <groupId>org.glassfish.extras</groupId> <artifactId>glassfish-embedded-web</artifactId> <version>3.2-b06</version> <scope>test</scope> </dependency> glassfish-embedded-web comes with Eclipselink 2.2.0, but the project requires features of 2.4. For regular deployment, this is solved by adding je required jars to glassfish's modules directory and this dependency: <dependency> <groupId>org.eclipse.persistence

Java EE 6 - Embedded container EJB tests

≡放荡痞女 提交于 2019-12-20 10:57:16
问题 This questiong is regarding Java EE 6 , using glassfish v3 embedded-all . I have a unit test that uses EJBContainer to test my stateless EJB. Problem is I'm having trouble looking up the EJB (remote) using JNDI: setup() { ctx = EJBContainer.createEJBContainer().getContext(); } ... test() { BookService bookService = (BookService)ctx.lookup("java:global/BookServiceEJB!com.something.service.BookService"); ... } @Stateless public class BookServiceEJB implements BookService { ... } @Remote public

Maven Embedded Glassfish plugin

时光怂恿深爱的人放手 提交于 2019-12-18 12:28:47
问题 I cannot seem to get the Maven Glassfish plugin working for the life of me: <project> ... <pluginRepositories> <pluginRepository> <id>glassfish-repository</id> <name>Java.net Repository for Glassfish</name> <url>http://download.java.net/maven/glassfish</url> <layout>default</layout> <snapshots> <enabled>true</enabled> <updatePolicy>never</updatePolicy> </snapshots> </pluginRepository> </pluginRepositories> ... <build> <plugins> <plugin> <groupId>org.glassfish</groupId> <artifactId>maven

glassfish-embedded-maven-plugin - how to deploy resources

筅森魡賤 提交于 2019-12-12 21:35:54
问题 I'm providing a quick and easy way for users to deploy my Java EE 6 application via glassfish-embedded-maven-plugin, so they don't have to install and configure a standalone glassfish. However, I'm running into trouble with resource deployment. The app needs a JavaMail resource from the container, and needs a JAAS realm with a suitable role->user/group mapping. When deploying to a standalone glassfish this is easily provided with a sun-resources.xml file and/or a couple of asadmin commands.

Specify logging.properties in embedded Glassfish with maven-embedded-glassfish-plugin

狂风中的少年 提交于 2019-12-12 18:51:19
问题 I use a project template containing a Maven configuration for an embedded Glassfish (using the maven-embedded-glassfish-plugin). I need to enable logging, but I do not even know which logging engine is enabled in the Glassfish (since I did not create the template). The template uses slf4j-log4j12 as a dependency, but I am not sure if slf4j or java.util.logging does the actual logging. Therefore I created two logging files, one logging.properties and one log4j.properties and put them both to

Unexpected behaviour of EntityManager.merge()

人盡茶涼 提交于 2019-12-12 06:15:31
问题 I am using embedded glassfish (3.1.2.2) with junit (4.11), with JDK 1.7, though my source and target is set to 1.6 (maven-compiler-plugin configuration). Following is my code: Person.java @Entity public class Person implements Serializable { private static final long serialVersionUID = 81398385247591972L; @Id @GeneratedValue private Long id; @Version private Long version; @Column(length = 15, nullable = false, unique = true, updatable = false) private String username; @Column(length = 50)

Deployed null when using embedded glassfish server

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-11 22:55:46
问题 after reading several tutorials (e.g. ocpsoft, oracle) I started to use embedded glassfish for running my hello-world app. It does work with the remote server but for some reason nothing is deployed when using the embedded server. 1.) "Cannot find javadb client jar file, derby jdbc driver will not be available by default." I am using derby and although e.g. variable AS_DERBY_INSTALL is set and exported it seems the jars cannot be found. Why? 2.) "INFO: Deployed null" Why is my app not