glassfish-4

Hibernate 4.3.6 and Glassfish 4.0 JPA 2.1 object is not an instance of declaring class

孤人 提交于 2019-12-09 19:05:11
问题 I'm using Hibernate 4.3.6 and Glassfish 4.0 for my ejb project. My test Dao class : @PersistenceContext private EntityManager entityManager; public void saveTest(){ Foo testFoo = new Foo(); testFoo.setSomething("test"); entityManager.persist(testFoo); entityManager.flush(); } and POJO class Foo.class: @Entity @Table(name = "FOO") public class Foo implements Serializable { private static final long serialVersionUID = 1L; private Long id; private String something; @Id @GeneratedValue(strategy =

Glassfish 4, JSF 2.2 and PrimeFaces FileUploadEvent not working together

喜欢而已 提交于 2019-12-09 18:03:16
问题 After upgrading to GlassFish 4 and JSF 2.2 Primefaces FileUploadEvent stop working. With JSF 2.1 it was working with no problem. Everything is working fine except file uploading. Is there something that I am missing? GlassFish 4 JSF 2.2 PrimeFaces 3.4.2 and 3.5 Commons io version: 2.4 Commons fileupload version: 1.3 Controller side public void handleFileUpload(FileUploadEvent event) { System.out.println("HandleFileUpload"); byte[] file = event.getFile().getContents(); newFieldset.setData(file

Glassfish 4 - JDBC Realm

感情迁移 提交于 2019-12-09 17:08:51
问题 What's the difference between the Password encryption algorithm and the Digest Algorithm in Glassfish 4? Because Password encryption algorithm cannot be blank, I used MD5, and for Encoding, Hex. The Digest Algorithm is blank, so the default is SHA-256. But if I made a simple login application with JAAS, and create the tables, insert one user, and the password is encrypted with MD5, the user cannot log in. If i encrypt the password with SHA-256, the user can log in. So, what is the Password

Accesing JobContext from a partitioned step in JSR 352

↘锁芯ラ 提交于 2019-12-09 13:15:40
问题 I'm trying to pass an object between batchlets, but I've encountered a problem when trying to access the jobContext from a partitioned step (batchlet). According to the JSR 352 Specification 9.4.1.1 Batch Context Lifecycle and Scope: A batch context has thread affinity and is visible only to the batch artifacts executing on that particular thread. A batch context injected field may be null when out of scope. Each context type has a distinct scope and lifecycle as follows: 1. JobContext There

How to make each user access resources at a specific location according to their authority/role in JAAS?

穿精又带淫゛_ 提交于 2019-12-08 19:44:25
问题 I'm using GlassFish server 4.0 in which I have assigned different authorities/roles to different users. A user may have multiple authorities/roles. For example, an admin user may be associated with ROLE_ADMIN (to perform administrative tasks) and ROLE_USER (to perform tasks as a registered user). In my web.xml , this is configured as follows. <security-constraint> <display-name>AdminConstraint</display-name> <web-resource-collection> <web-resource-name>ROLE_ADMIN</web-resource-name>

Glassfish 4: how to set application or module name for JNDI

[亡魂溺海] 提交于 2019-12-08 16:49:44
问题 I use EJB inside OSGi bundles. And now when I need to get EJB I have long jndi, for example: bean = (InterfaceName) ctx.lookup("java:global/longBundleName_version/OrganizationDirBean!and.plus.path.and.InterfaceName"); I want to change this part: longBundleName_version I mean, when I deploy bundle this part must be set from [glassfish-]application.xml or from [glassfish-]-ejb-jar.xml or from any other xml descriptor. I want jndi name for my ejb to be like: java:global

JPA and SYS_REFCURSOR like OUT parameter

╄→尐↘猪︶ㄣ 提交于 2019-12-08 11:00:18
问题 I want to call a procedure using JPA with SYS_REFCURSOR like OUT parameter. This is very easy using plain JDBC but I'm not sure that is possible in JPA. My procedure is like following: CREATE OR REPLACE FUNCTION FN_GET_COINS RETURN SYS_REFCURSOR IS vCursor SYS_REFCURSOR; BEGIN OPEN vCursor FOR SELECT ... RETURN vCursor; CLOSE vCursor; EXCEPTION ... END FN_GET_COINS; 回答1: JPA 2.0 has no support for stored procedures, but support has been added in JPA 2.1 , part of Java EE 7 . Examples of

AFNetworking with Java and Glassfish

ε祈祈猫儿з 提交于 2019-12-08 08:56:34
问题 This could be a longshot question, but I haven't found any specific tutorials or articles on this particular combination of technologies. My intentions are to use my own APIs (from Java Beans deployed on a GlassFish server) on the iOS device using AFNetworking. The problem is, I don't really understand the linkage method between the server and the iOS device. How does the iOS code gain access to GlassFish webservices (for example)? Disclaimer: I have no experience in this particular field (i

Calling a remote ejb on a different glassfish 4.0 instance

…衆ロ難τιáo~ 提交于 2019-12-08 04:28:29
问题 I have two servers installed. Both are running an own Glassfish 4.0 domain. On one server, I've installed an Singleton Remote EJB. This Glassfish has an IIOP-Listener specified (name=UF enabled=true network adress=192.168.10.95 listener port=1072). The second Glassfish instance is running a simple JSF-2.2 Application. Now I'm trying to connect to the remote ejb in one JSF-Managed-Bean constructor. Properties props = new Properties(); props.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun

Undeployment gives the error: Application not registered (Glassfish)

坚强是说给别人听的谎言 提交于 2019-12-08 00:32:55
问题 I undeployed my APP by using the web gui of Glassfish. But if I press undeploy for my actual APP nothing happend. In my Log File a new error occurs: Application not registered (severe). How can I undeploy my APP now correctly ? 回答1: I found a simple answer: remove all references to your app from domain.xml (in glassfish/glassfish/domains/yourDomain/config/) (see also unable to redeploy web application on glassfish3) remove directory glassfish/glassfish/domains/yourDomain/applications/yourAPP