glassfish-3

How to specify domain name while creating jdbc resource/connection pool in glassfish 3

杀马特。学长 韩版系。学妹 提交于 2019-12-25 01:56:10
问题 I have multiple domains in a glassfish 3 server. I am able to login to different domains using glassfish admin console and I want to create jdbc resource/connection pool for a particular domain (say domain2). I know, I can create it using admin console. But I want to do it through CLI. I checked the format of create-jdbc-connection-pool and create-jdbc-resource commands. It does not take any parameter where I can specify the domain name. Can somebody tell me how to do this using CLI. Thanks

How do I make alternatedocroot work in glassfish 3.1.2?

不打扰是莪最后的温柔 提交于 2019-12-24 16:42:36
问题 I'm trying to get my page resources and uploaded files out of the proyect working folder (working with JSF 2 and in Netbeans IDE 7.2) so I did not know how to access them, so i started to read how to do it and I have found the "alternatedocroot"... I have been trying to get it work creating the glassfish-web file (because it was not created) and putting the property leaving my glassfish-web.xml like this: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish

EntityManagerFactory not being injected using @PersistenceUnit

送分小仙女□ 提交于 2019-12-24 16:25:02
问题 I'm a java beginner. I'm in trouble to configure a persistance unit using JTA transactions. I need to use a PostgreSQL database that is already defined, configured and populated. Using netbeans, i created the persistance.xml and glassfish-resources.xml as fallows: <persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence

Injecting @Stateful bean into another @Stateful bean

非 Y 不嫁゛ 提交于 2019-12-24 12:17:44
问题 On a glassfish 3.1 server, I have a @Stateful session bean which is injected into another stateful session bean. The stateful session bean which is injected presents my entity access layer, it itself has it's EntityManager injected with @PersistenceContext and it looks like this. @Stateful MyEAO { @PersistenceContext EntityManager em; MyEAO() { // default constructor } .... } This access layer is injected into another stateful bean: @Stateful public class ShopAdmin implements

Exception while creating EntityManagerFactory - Lookup failed for 'persistence/myPU' in SerialContext

♀尐吖头ヾ 提交于 2019-12-24 03:47:11
问题 I'm working with Glassfish application server and trying to connect my spring-hibernate web application to my db, I have the following configurations: In Glassfish I have added a jdbc connection and send a successful ping to the DB. I also added a JDBC resource (in glassfish) with jndi name: jdbc/myResource . This resource is under the connection pool in which I have created and tested (in step 1). My EntityManaget is annotated with @PersistenceContext: @PersistenceContext(unitName = "myPU")

JAR libraries in WEB-INF/lib not added to classpath during Glassfish deployment

别说谁变了你拦得住时间么 提交于 2019-12-24 03:33:00
问题 I'm new to Glassfish and Java EE although I've been using Java for a few years. I've inherited a project that stalled and now I need to start development on it again. I'm trying to deploy the web application as-is to see what works and what needs attention. While there is a lot of code to implement various functions, it appears that the first point needing attention is deployment of the application. The web application I'm trying to deploy is MyServer and is packaged in a WAR archive. A class

group memberships in (AD) ldap Realm

我的未来我决定 提交于 2019-12-23 22:24:12
问题 I use the JAAS Framework for the authentification and authorization process in a java ee enterprise application. I use GlassFish as the application server. My realm configuration looks like: <auth-realm name="ads-realm" classname="com.sun.enterprise.security.auth.realm.ldap.LDAPRealm"> <property name="jaas-context" value="ldapRealm" /> <property name="base-dn" value="CN=Users,DC=company,DC=intern" /> <property name="directory" value="ldap://ad.company.intern:389" /> <property name="search

Can I use CDI to @Inject a class in Jersey 1.x?

自闭症网瘾萝莉.ら 提交于 2019-12-23 20:13:06
问题 I think I'm asking this question but for Jersey 1.x: Dependency injection with Jersey 2.0 I'm using Glassfish 3, CDI and Jersey 1.x. I have a @WebService that is injecting a class like this: @Inject Foo foo; I've tested this in the @WebService and it works. But the same line of code in my Jersey resource throws a NPE when it tries to use foo . I think Jersey 1.x is ignoring the CDI annotations. How can I get dependency injection working like it does in my @WebService ? Foo is a pojo and my

Unmarshal a single element list fails

柔情痞子 提交于 2019-12-23 18:09:51
问题 I'm running a sample (which i can't find anymore) from Blaise Doughans blog on Glassfish 3 using EclipseLink 2.5 MOXy for JAXB service. @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class Company { @XmlElementWrapper(name="employees") @XmlElement(name = "employee", type=Employee.class) private List<Employee> employees; } @XmlAccessorType(XmlAccessType.FIELD) public class Employee { private String id; private String name; } I added some annotations to the classes, to produce the

JSF Named Bean, Eager application scoped (aka @ManagedBean(eager=true) )

断了今生、忘了曾经 提交于 2019-12-23 10:09:30
问题 Is there any way to initialize Named Bean annotaded by javax.inject.Named / javax.enterprise.context.ApplicationScoped like @ManagedBean(eager=true) from javax.faces package? @Named @ApplicationScoped public Mail() { ... } I want to load this class when application starts, not when webapplication refers to this bean. ps. JSF 2.1 Bean Injected by Glassfish 3.1 回答1: You can create a CDI extension that has the @Observes AfterBeanDiscovery parameter on one of his methods. There you can