glassfish

How can I inject an EJB from an other application on the same GlassFish Server?

随声附和 提交于 2019-12-18 13:36:56
问题 I have two applications running on my local glassfish server. One to rent bicylces and one to buy train tickets. I now wanted to call a remote ejb from the train application to allow the rental of bicycles for the chosen time but I'm not really sure how to do it. I already tried a few different approaches. Both applications are in different packages and the train application has to know the bicycle remote interface but I don't know how to accomplish that. The remote interface (bicyle app):

Persistence.xml where to put in eclipse project

匆匆过客 提交于 2019-12-18 13:08:30
问题 Simple question... I have a few projects in Eclipse enviroment MainApp(Enterprise Application Project) which "includes" WebController (EJB Project) WebModel (JPA Project) WebView(Dynamic Web Project) Problem is where to put persistance.xml file? Getting exception: java.lang.IllegalStateException: Unable to retrieve EntityManagerFactory for unitName DataModel 回答1: The JPA 2.0 specification in section 8.2 states the requirements for packaging. It says A persistence unit is defined by a

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

How to use a property-file with GlassFish

◇◆丶佛笑我妖孽 提交于 2019-12-18 12:27:21
问题 I'm creating a web service, which run in GlassFish, and I want to have some custom properties. For this I'm using the Properties class. The code I'm using is: Properties p=new Properties(); File f=new File(System.getProperty("user.dir"), "settings.properties"); p.load(new FileInputStream(f)); But how do I get the settings.properties -file in my config directory? I'm not sure about my classpath, since this is managed by NetBeans and GlassFish. I assume my .war -file is added to the classpath,

How to configure Glassfish Server in Eclipse manually

时间秒杀一切 提交于 2019-12-18 10:37:29
问题 I have GlassFish server3.1.2.2 pre installed on my machine. Which I want to use in my Eclipse Luna How do I manually configure it to use in Eclipse? When I tried using Eclipse Market Place i got an error No repository found at http://download.oracle.com/otn_software/oepe/luna. I tried searching through net for which I get pointed to the Oracle Enterprise Pack for Eclipse (OEPE) which is of about 485MB. Is there an another way round for this? 回答1: You must use Eclipse WTP ( Web Tool Platform )

Glassfish 3 security - Form based authentication using a JDBC Realm

一世执手 提交于 2019-12-18 10:10:23
问题 I want to understand form based security and JDBC realms with glassfishV3, so i decided to create a little app that just allows to sign in and out, i followed the instructions from this book to do so. I understand how the hold thing works, but something is wrong and i cant get it to work properly. What i did first was create a little database with JPA annotations: @Entity @Table(name="USERS") public class User implements Serializable { private static final long serialVersionUID =

java.lang.NullPointerException at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate$SerializableLocalObjectDelegate.createObject

百般思念 提交于 2019-12-18 09:36:19
问题 I create simple maven Enterprise Application project in NetBeans 8.0.2 with GlassFish 4.1 Session scoped managed bean: import java.io.Serializable; import javax.ejb.EJB; import javax.inject.Named; import javax.enterprise.context.SessionScoped; @Named( value = "newJSFManagedBean" ) @SessionScoped public class NewJSFManagedBean implements Serializable { @EJB private NewSessionBean newSessionBean; public NewJSFManagedBean() { } public String getName( ) { return newSessionBean.getName(); } }

Glassfish 5 Server's HTTPS Not Working “Out of the Box”

本秂侑毒 提交于 2019-12-18 09:10:23
问题 I am reading this tutorial page: https://javaee.github.io/tutorial/security-intro006.html Which explains that I should be able to view the SSL version of the home page (index.html) by going to the following URL: https://localhost:8181. However, when I point my browser at this address I receive an error that is shown in Figure 1. I have a feeling configuring this could take hours the first time. Does anyone have a tutorial that can help me configure HTTPS on my loopback address in Glassfish? I

Glassfish 5 Server's HTTPS Not Working “Out of the Box”

﹥>﹥吖頭↗ 提交于 2019-12-18 09:10:06
问题 I am reading this tutorial page: https://javaee.github.io/tutorial/security-intro006.html Which explains that I should be able to view the SSL version of the home page (index.html) by going to the following URL: https://localhost:8181. However, when I point my browser at this address I receive an error that is shown in Figure 1. I have a feeling configuring this could take hours the first time. Does anyone have a tutorial that can help me configure HTTPS on my loopback address in Glassfish? I

When adding dependency: CDI deployment failure, Unsatisfied dependencies for type Set<Service> with qualifiers @Default

冷暖自知 提交于 2019-12-18 08:57:42
问题 When I add the twitter hbc dependency to my pom.xml I'm getting an error. I followed the instructions from here. I don't get it, if it was a dependency problem I should have found a fix on the web but if I comment out that dependency, my server is starting.. this is my what I added to my pom.xml: <dependency> <groupId>com.twitter</groupId> <artifactId>hbc-core</artifactId> <!-- or hbc-twitter4j --> <version>2.2.0</version> <!-- or whatever the latest version is --> </dependency> This is the