glassfish-4

GlassFish 4.0 / Jersey 2.0 - NoClassDefFoundError for JsonStructureBodyReader

╄→尐↘猪︶ㄣ 提交于 2019-12-07 18:15:43
问题 I'm using GlassFish 4.0 R89 on my dev system, working with JAX-RS. Simple calls work, so I can get a serialized object, represented in XML. I had to install that on the machine of a guy who will also be involved in the coding process, and I also tried that on my notebook - and I'm getting the same result - a NoClassDefFoundError is thrown for the class JsonStructureBodyReader (although I'm not even using JSON, tried that, the server definitely returns XML with correct headers for the content

Using a secured EJB from a JAX-RS web service

我的未来我决定 提交于 2019-12-07 14:42:48
问题 I'm running Glassfish 4 and Jersey as JAX-RS implementation. I have secured my EJB like this: @Stateless @DeclareRoles({"Authentication_Reader"}) @RolesAllowed({"Authentication_Reader"}) public class AuthenticationServiceBean { public void foo() { ... } } I have created a security-role-mapping entry in glassfish-web.xml, and I've also created a security-role declaration in web.xml. The following works from a servlet: @WebServlet(name = "TestServlet", urlPatterns = {"/test.do"}) @RunAs(

How to fix a javax.naming.NamingException: Lookup failed

倾然丶 夕夏残阳落幕 提交于 2019-12-07 07:14:56
问题 I'm trying to persist an entity via a simple jsp form but it doesn't work. the exception that appear is : javax.naming.NamingException: Lookup failed for 'java:global/jee-projet-web' . I'm using glasfish as server. This is the code of my form: <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content

REST Service errors with: resource is not available Glassfish 4.0 JAX-RS 2.0

蓝咒 提交于 2019-12-07 05:21:33
问题 I am trying to deploy a simple JAX-RS service on Glassfish 4.0 and keep getting the following error: HTTP Status 404 - Not Found type Status report messageNot Found descriptionThe requested resource is not available. GlassFish Server Open Source Edition 4.0 War file deploys fine in Glassfish server however it appears the class loader is not doing its job and exposing the rest service appropriately. I am trying to figure out why class is not loading appropriately. I know it is probably a

How to change EclipseLink in GlashFish 4.0?

久未见 提交于 2019-12-07 01:52:19
问题 I want to change EclipseLink from 2.5.0 to 2.5.1 in GlashFish 4.0. I have downloaded the OSGi bundle and replaced the following jar files org.eclipse.persistence.antlr.jar org.eclipse.persistence.jpa.jar org.eclipse.persistence.asm.jar org.eclipse.persistence.jpa.modelgen.jar org.eclipse.persistence.core.jar org.eclipse.persistence.oracle.jar javax.persistence.jar under $GLASSFISH_HOME/glassfish/modules . After doing this, the version still remains the same. The following code, String version

getJavaFileForOutput(…) method of custom JavaFileManager not called by compiler

与世无争的帅哥 提交于 2019-12-06 06:49:19
I have a custom JavaFileManager that looks something like this: public class InMemoryForwardingFileManager extends ForwardingJavaFileManager<StandardJavaFileManager> { private final Map<String, ByteArrayJavaFileObject> javaFileObjects = new HashMap<>(); @Override public JavaFileObject getJavaFileForOutput(Location location, String className, Kind kind, FileObject sibling) throws IOException{ JavaFileObject fileObject = new ByteArrayJavaFileObject( ... ); javaFileObjects.put(className, fileObject); return fileObject; } @Override public ClassLoader getClassLoader(Location location){ return new

javax.ejb.EJBException java.lang.IllegalStateException: Unable to retrieve EntityManagerFactory for unitName

会有一股神秘感。 提交于 2019-12-06 05:44:07
I'm working on a JavaEE application with EJB. I have an Entity called Medico which code is: @Entity public class Medico implements Serializable{ /** * */ private static final long serialVersionUID = 1L; /** * */ public Medico(String nome_medico, String morada_medico, String esp, GregorianCalendar dnasc_medico, int tel_medico) { //construtor parametrico super(); this.nome_medico = nome_medico; this.morada_medico = morada_medico; this.esp = esp; this.dnasc_medico = dnasc_medico; this.tel_medico = tel_medico; } @Id @GeneratedValue private int cod_medico; //bi private String nome_medico; private

Eclipse - Glassfish 4 Debugging startup timeout

南楼画角 提交于 2019-12-06 04:37:36
问题 Glassfish 4.0 final gives a timeout everytime I try to start it in Debug mode. The normal run on server (from Eclipse) does work without a timeout. I've tried running Glassfish 4.0 from Eclipse Juno and Eclipse Kepler, both have the correct port configuration for debugging (9009), both are failing to start Glassfish in debug. Is this a known problem? How do I fix this? 回答1: Yes, this is a known issue with the Glassfish 4.0 adapter in Eclipse. Here is a workaround: Shut down Eclipse, open a

GF4 incorrect timeout exception thrown in Servlet when multiple large responses are returned (requested)

淺唱寂寞╮ 提交于 2019-12-06 03:48:27
The issue occurs when multiple requests (in this example, for images) are handled by GF. For some reason, the response outputstream blocks (for larger writes) and I get a timeout after a few seconds. I downloaded the latest (2/12/2013) promoted built from glassfish repo and replaced nucleus-grizzly-all.jar but I still get the same issue. Any ideas of what causes this issue and how I can resolve it? Thanks. Exception java.io.IOException: java.util.concurrent.TimeoutException at org.glassfish.grizzly.utils.Exceptions.makeIOException(Exceptions.java:81) at org.glassfish.grizzly.http.io

How to setup an empty password for a MySQL connection pool in glassfish 4 from the GUI?

巧了我就是萌 提交于 2019-12-06 03:17:34
问题 Im being unable to set an empty password for a MySQL connection pool from the GUI in glassfish 4. In previous versions of glassfish it used to work by simply putting "()" without the quotes. It doesnt work anymore for me in glassfish 4. By the way, I've been googling my issue with any luck. Does anyone know what is the proper way to do it in glassfish 4? Thanks in advance for you support Regards 回答1: What I did to fix this was to manually in /glassfish/domains/(yourDomainName)/domain.xml add