FAQ Database Discussion Community


Null pointer exception when attempting to use JNDI for JDBC

java,jdbc,glassfish,jndi,glassfish-4
In Glassfish admin, I setup a JDBC connection pool that I can ping ok. Also in Glassfish admin, I have setup a JNDI JDBC resource called jdbc/myDb However I'm unable to connect to it from Java. I have tried both injection style: @Resource (mappedName="jdbc/myDB") private DataSource datasource; I have also...

How to run on GlassFish in IntelliJ?

java,intellij-idea,glassfish
I am using IntelliJ, and I have a J2EE project. I have setted up a local GlassFish server in the IDE, but how can I configure the project to run on that local GlassFish server? My project uses Java EE's features (such as servlets), but IntelliJ says that those libraries...

Older “java.version” value in GlassFish than on console

java,linux,glassfish,glassfish-4
Operating system: Ubuntu 12.04, GlassFish version: 4.0.1 (build 10) In a GlassFish servlet I print the Java version in processRequest with this code: out.println("<p>" + System.getProperty("java.version") + "</p>"); out.println("<p>" + System.getProperty("java.home") + "</p>"); out.println("<p>" + System.getProperty("java.vendor") + "</p>"); When I enter the servlet address in a web browser the output...

Postgresql and GlassFish - cannot commit when autoCommit is enabled

java,postgresql,jdbc,glassfish,mybatis
I have postgresql 9.4 and glassfish 4.1. Besides I use MyBatis inside EJB. Now I try to make select from table and this is what I get: javax.resource.spi.LocalTransactionException: Cannot commit when autoCommit is enabled. at com.sun.gjc.spi.LocalTransactionImpl.commit(LocalTransactionImpl.java:112) at com.sun.enterprise.resource.ConnectorXAResource.commit(ConnectorXAResource.java:124) at com.sun.enterprise.transaction.JavaEETransactionImpl.commit(JavaEETransactionImpl.java:518) at...

Does it make sense to close JsonGenerator if it was created on top of ByteArrayOutputStream

java,json,glassfish
Suppose I want to create JSON and store it in String using Java JSON Streaming API. For that purpose I create ByteArrayOutputStream (BAOS) and JsonGenerator on top of it. ByteArrayOutputStream collector = new ByteArrayOutputStream(); JsonGenerator jsonGenerator = Json.createGenerator(collector); After a while, when I'm done with it, I take String from...

Webstart Security is Impossible. Trying to use with glassfhish 4

java,security,deployment,glassfish,java-web-start
The end goal is to provide application client downloads using Java webstart from Glassfish 4. I've been trying to get this working for 3 days, researching every method I can find and no matter what I try, webstart is blocked. Exception list. Doesn't work. Adding the certificate as a trusted...

SessionContext not injected when using decorators

java,java-ee,glassfish,ejb,cdi
I'm using Glassfish 4 to deploy an application. It used to have an EJB where the SessionContext is injected via a @Resource annotation. @Stateless @DeclareRoles({"StandardRole1", "StandardRole2"}) public class MyClass implements MyInterface { @Resource private SessionContext ctx; @Override public String getPrincipalName() { return ctx.getPrincipal().getName(); } } This worked fine like it...

How to resolve ClassNotFoundException for Throwable in Weblogic 12c

java-ee,glassfish,weblogic,classnotfoundexception,throwable
I have a J2EE EJB 2.0 application, which was running on Glassfish perfectly. I have just finished the transformation of this application from Glassfish to Weblogic 12c (Sun Glassfish specification XMLs to Weblogic specification XMLs). When I am deploying it to Weblogic 12c, the server log contains the following: ####<Jan...

NullPointerException during deployment of Spring/Hibernate app to glassfish SessionFactoy init failed

java,spring,hibernate,glassfish
I know this question has bee ansked a bunch of times, however non of the answeres seemed to work for me. I use Spring 4.1.4 /Hibernate 4.3.8 my application context lloks as follows <context:component-scan base-package="com.redast"/> <!-- Use annotation for configuration--> <context:annotation-config/> <context:spring-configured/> <!-- Data Source Declaration --> <bean name="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">...

glashfish 4.1 not start on ubuntu server 14.04

java,ubuntu,glassfish,ubuntu-14.04,glassfish-4
I follow http://www.lyonlabs.org/howto/howdoi-glassfish.html to install Glassfish 4.1 on Ubuntu 14.04 server. But when I try to start glassfish server it show: remote server does not listen for requests on [localhost:4848] is the server up Thanks ...

Handling of Objects in WebSocket Session

java,session,websocket,glassfish
I am trying to build a WebSocket Server in Java, and to connect with a simple javascript WebSocketClient. Now i want to "give" every incoming session an unique instance of an object which is created on onopen, their methods called on onmessage and destroyed on onclose. How can i manage...

Glassfish server not found in Eclipse Luna

eclipse,glassfish
I'm trying to install Glassfish Server on Eclipse Luna. I installed Glassfish Tools 7.3.3 (from Oracle) plugin and I downloaded Glassfish 3.1.2 on my computer. However, I can't see Glassfish Server on server lists in Eclipse. When I click on "Download additional servers adapters", it's not visible. I tried to...

JDBC Connection Pool SSL Error PKIX building failed

java,postgresql,jdbc,glassfish,glassfish-4
This is using the latest Glassfish (4.1), the latest Postgres Driver (9.3-1102 JDBC 41) against Postgres 9.4, and the latest Java (1.8.0_31-b13). This is also using a commercial CA certificate, I have checked the CA root is present in $JAVA_HOME/jre/lib/security/cacerts. For good measure I have also added the intermediate certificate....

Glassfish 4 can't enable remote admin?

java,glassfish,remote-access,glassfish-4
I have a Glassfish 4 server running on a headless Debian VM. I can access the application just fine, but I cannot seem to access the admin port from anything other than localhost. I'd like to be able to access it so I can remotely deploy/debug from an IDE on...

Spring social /connect return 404

spring,spring-mvc,glassfish,spring-social
I'm trying to configure spring social inside my (maven)spring MVC secured(spring security) application but when I try to access /connect/ or /connect/providerid , I always get error 404 Here is my Glassfish server log when I try to access: Info: Mapped "{[/connect/{providerId}],methods=[POST],params=[],headers=[],consumes=[],produces=[],custom=[]}" onto public org.springframework.web.servlet.view.RedirectView...

Password protected domain glassfish

security,java-ee,authentication,amazon-web-services,glassfish
Wich is the best way to make a password-protected domain? I currently running Glassfish4 on AWS EC2 ubuntu server. I mean something like that: (For non italians, the windows says: Authentication required: Insert username and password in order to access: https://..... ) Thanks all....

Debugging service test client: Netbeans debugger won't recognize Glassfish server

java,debugging,java-ee,netbeans,glassfish
Here's what I've done so far: Did a fresh build of project (web service project). Redeployed project war file to Glassfish server. Restarted server with --debug=true. Attached debugger from Netbeans. Debugger attaches to the server without an error (responds "User Program Running"), however the Debug tab (in the Projects/Files/Services window)...

java.lang.NullPointerException at com.sun.ejb.codegen.EjbOptionalIntfGenerator.generateSubclass(EjbOptionalIntfGenerator.java:280)

java-ee,nullpointerexception,glassfish,ejb,subclass
So I was using EJB to create users in DB. It worked. So after that I made a profile page that user can change. Unfortunately I'm hit with an NPE because the EJB can't load. So I've another @Stateless class and that I pretty much copy pasted to create this...

How to find servlet API version for glassfish server?

java,java-ee,servlets,glassfish
While coding a servlet I found a method that says Since: Servlet 3.1 I guess that if I have the autohint from NetBeans to use it is because I have that Servlet version. But I cannot find a place to confirm that. I'm using glassfish4.1 as container. If I go...

How to check Glassfish4 server is overloaded?

jsp,java-ee,servlets,glassfish,servlet-filters
My java web application runs on Glassfish4. I want to show a webpage have the string - Server too busy. Please try again later. Which solution is the best for this case?...

How do I create a simple JSON Jersey 2.x RESTful web service on Glassfish 4?

json,rest,glassfish,jackson,jersey-2.0
I've spent days trying to figure this out. All I want to do is create a simple web service to return Lists of POJOs as JSON. Why is this so difficult? I'm starting with this in my POM: <dependency> <groupId>javax</groupId> <artifactId>javaee-web-api</artifactId> <version>7.0</version> <scope>provided</scope> </dependency> <dependency> <groupId>org.glassfish.jersey.containers</groupId> <artifactId>jersey-container-servlet</artifactId>...

Reading an EAR's manifest

java,java-ee,glassfish,classloader,manifest
I need to load the manifest of an application I am deploying on Glassfish as an EAR. All the info I've found on internet is regarding reading manifests of jars or wars. I've tried to apply the snippets of code I've found to my problem but I've not made it....

Couldn't get JSON response from Java Jersey app using Tomcat or GlassFish server

eclipse,tomcat,java-ee,glassfish,jersey
I have problem with my Java Jersey app. I'm writing an app with this tutorial: http://programmerguru.com/android-tutorial/android-restful-webservice-tutorial-how-to-create-restful-webservice-in-java-part-2/ My app is almost the same as in this example expect fact that I'm using Maven to import .jar files. I also have some changes in db. I run this db on wamp server...

JEE can't run JAX-RS WebService skeleton app

java,maven,glassfish,jersey,jax-rs
I'm using Windows, NetBeans 8.0.2, GlassFish 4.1. I can't make my example JAX-RS app running. This is pom.xml: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.wld</groupId> <artifactId>HelloWebService</artifactId> <packaging>war</packaging>...

java.lang.NoSuchMethodError: javax.ws.rs.core.Application.getProperties()Ljava/util/Map

java,rest,deployment,glassfish,jersey
I am trying to deploy my first rest application using jersey 2.17. I am using Maven, GlassFish 3.1.2.2 for deployment. Application runs in eclipse (tomcat), but gives following error when deploying through glassfish admin console. Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException:...

Exception in using appclient jar in EJB 3 :javax.ejb.EJBException: java.rmi.MarshalException:

java,java-ee,glassfish,ejb-3.0
I am trying to learn ejb 3 and facing an issue in the below mentioned scenario which I am not able to figure out. I am having one Entity (Book) to store book related data. I have created Stateless Bean and Remote interfaces and deployed the jar in glassfish 4....

Why tomcat is running when I deploy my projects on netbeans using glassfish?

java,tomcat,netbeans,glassfish
I use xampp to open mysql and stop other services. But when I run my servlet project in netbeans it opens glassfish server, at that time in xampp, tomcat status is running. What is the reason?

PWC1232: Exceeded maximum depth for nested request dispatches: 20 at org.apache.catalina.core.ApplicationDispatcher.doInvoke

jsf,glassfish,infinite-loop,facesservlet
I am using jsf 2.1 (mojara) with glassfish 3.1 , and my web .xml looks like : <welcome-file-list> <welcome-file>NewFile.xhtml</welcome-file> </welcome-file-list> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>*.xhtml</url-pattern>...

java.lang.RuntimeException: java.lang.IllegalStateException: IIOP1004: Key alias s1as not found in keystore

security,ssl,glassfish,ssl-certificate,glassfish-4.1
I am trying to add a self-signed certificate in GlassFish Server 4.1 for the development purpose only. The server certificate is generated using the following command. "C:\Program Files\Java\jdk1.8.0_25\bin\keytool" -genkey -alias server-alias -keyalg RSA -keypass changeit -storepass changeit -keystore keystore.jks The server name localhost was taken in response to the keytool's...

spnego.jar switch from Java 7 to Java 8 cast exception

java,glassfish,jaas,spnego
I'm using spnego.jar from dfelix with Glassfish 4.1 as filter in web.xml. I asked the question on project forum but did not receive response. I want to switch from Java 1.7.0_45 to 1.8.0_45 (tried also other 1.8 versions). After switching on a test environment I'm getting the error shown below....

Best way redirect REST service request on glassfish + JAX-RS to https URL?

rest,glassfish,jax-rs
I have implemented a REST service on glassfish4 + JAX-RS. Now I want use a https connection for authentication. The URI for http is http://myhost/myapp/services/rest/myservice and for https is https://myhost_2/myapp/services/rest/myservice. I want prevent the usage of http://myhost/myapp/services/rest/myservice. I think one way is redirect a request over http://myhost in the REST...

Change colour of Glassfish 3.1 Community Edition Domain Application Server

glassfish,glassfish-3
How do you change the default colour scheme on a Glassfish 3.1 community edition? To distinguish between different environments.

Persistent session in glassfish behind nginx proxy

java,session,nginx,proxy,glassfish
I am running a glassfish webserver behind a nginx proxy (which resolves domains). I want to store @SessionScoped data on the Webserver. My problem is, that nginx opens a new session everytime it connects to glassfish and that session is in no way connected to the client. The client itself...

What is the nature of the dependency between GreeterEJB and GreeterLibrary?

java,netbeans,ant,jar,glassfish
When GreeterEJB builds as a JAR, it doesn't build with a libs folder for dependencies: [email protected]:~$ [email protected]:~$ ll NetBeansProjects/GreeterEJB/dist/ total 20 drwxrwxr-x 2 thufir thufir 4096 Feb 25 14:34 ./ drwxrwxr-x 6 thufir thufir 4096 Feb 25 14:34 ../ -rw-rw-r-- 1 thufir thufir 2802 Feb 25 14:34 GreeterEJB.jar [email protected]:~$ However,...

Java servlet access to config file

java,servlets,glassfish
I am deploying a war file to glassfish and would like to know if it is possible to have a file that can have properties stored in them that can be accessed within my web methods. The catch is I would like to change the file as business requests change...

Java-webservice: Glassfish3.0 error “org.codehaus.jackson.jaxrs.JacksonJsonProvider”

java,web-services,glassfish
While I restarting the Glassfish 3.0 server from NetBeans 8.0 after adding a RESTful web service, I got this exception and couldn't request the web service!! Glassfish 3.0: java.lang.ClassNotFoundException: org.codehaus.jackson.jaxrs.JacksonJsonProvider I checked the Maven Pom.xml for jersey dependency and the tag is already exist! <dependency> <groupId>com.fasterxml.jackson.jaxrs</groupId> <artifactId>jackson-jaxrs-json-provider</artifactId> <version>2.4.0</version> </dependency> ...

Glassfish 3.1.2 binding error

binding,glassfish
Glassfish 3.1.2, JDevloper 12.1.3, JSF, BC4J ADF Essential. JSF page shows no content in Glassfish but shows correct content i Weblogic. The involved components in JDeveloper seems to be free of errors. Any ideas to what is wrong - please. Glassfish log shows: Complete Message java.lang.IllegalStateException: The expression "#{bindings.adminTubetypes1.regionModel}" (that...

Server Authentication Module forwarding in Glassfish

java,glassfish,jaas,jaspic,jsr196
I found this guide for developing your own Server Authentication Module (SAM) for Glassfish: http://docs.oracle.com/cd/E18930_01/html/821-2418/gizel.html It seems pretty straightforward to verify some credentials (in HTTP Auth headers for instance), but my question is this: Can I develop my SAM in such a way that I can forward the user to...

Glassfish service throws an error

java-ee,netbeans,service,glassfish
I have successfully installed a Glassfish service that runs on my server. When I try to access the application, I get an HTTP 500 error : org.apache.jasper.JasperException: PWC6345: There is an error in invoking javac. A full JDK (not just JRE) is required When I launch NetBeans and Glassfish, it...

java.lang.illegalstateexception unable to retrieve entitymanagerfactory for unitname null

java,maven,java-ee,jpa,glassfish
I write Entity.jar .It's EJB Module contain entity class and etitydao class. When i run it on GlassFish , i have error: Caused by: java.lang.IllegalStateException: Unable to retrieve EntityManagerFactory for unitName null at com.sun.enterprise.container.common.impl.EntityManagerWrapper.init(EntityManagerWrapper.java:138) at com.sun.enterprise.container.common.impl.EntityManagerWrapper.doTxRequiredCheck(EntityManagerWrapper.java:158) at...

doesn't show up bean's attributes in .xhtml [duplicate]

jsf,netbeans,xhtml,glassfish,managed-bean
This question already has an answer here: JSF returns blank/unparsed page with plain/raw XHTML/XML/EL source instead of rendered HTML output 1 answer I started to learn JSF. I use netbeans and glass fish as server. I have this problem: my code of start.xhtml: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0...

File upload via h:inputfile (prettyfaces) does not work

jsf,file-upload,glassfish,jsf-2.2,prettyfaces
I'm trying to upload a file to the glassfish application server (v4.1) via h:inputfile. xhtml-file and bean are prepared as almost every example in the web shows. I tried with and without Pretty Filter in web.xml, allowCasualMultipartParsing in context.xml, and a handful of other possible workarounds. None of them seemed...

My Websocket takes forever to connect

java,websocket,glassfish,ipv6,tyrus
UPDATE It seems that in org.glassfish.tyrus.core.BaseContainer in the constructor, these two lines run super slow: this.managedExecutorService = lookupManagedExecutorService(); this.managedScheduledExecutorService = lookupManagedScheduledExecutorService(); What is the deal with the mention of Android in the comments of both methods, am I using the wrong code for Java that is aimed at Desktops? I...

Google API Exception “invalid_grant” in DEVs GlassFish but not in Local

java,oauth,google-api,glassfish
I'm working using OAuth 2.0 to authenticate to a Google's API and everything works just fine in my local GlassFish. The problem begins when I'm deploying to the DEV's GlassFish, which throws me the following exception: com.google.api.client.auth.oauth2.TokenResponseException: 400 Bad Request { "error" : "invalid_grant" } This is my code: transport...

NULL EJB referece

java-ee,glassfish,ejb,ejb-3.0,glassfish-4
I have a EAP created with Eclipse containing two modules: a Dynamic Web Application, and a EJB module. The application.xml of the EAP: <?xml version="1.0" encoding="UTF-8"?> <application xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/application_7.xsd" id="Application_ID" version="7"> <display-name>JExecuterEAP</display-name> <module>...

Simple JavaEE HTML GET/POST application

java,java-ee,intellij-idea,glassfish,jax-rs
I'm just starting out with JavaEE (I'm decently fluent in JavaSE) and am having trouble wrapping my brain around all the new things that are required to make even the simplest of applications. Right now I am trying to use JAX-RS annotations to generate a simple "Hello World" html page...

How convert GlassFish connection pool and GlassFish realm to WildFly container?

java,jsf,glassfish,wildfly
I have an application developed to GlassFish container. In my searches I saw how create a connection pool in WildFly, but, how about data base configurations in the glassfish-resources.xml? How can I adapt this file to use with WildFly? And about glassFish-web.xml, with the realm configuration? How can I convert...

jersey - moxy returning appended json in class property

java,json,glassfish,jersey,moxy
I have a jersey client that makes a call to a 3rd party rest api and retrieves some JSON. {"A":1,"W":2,"List":[{"name":"John","amount":10.0}]} After that I need to append this JSON to my response class and give it back in the response. @XmlRootElement public class MyResponse { private JsonObject body; private String status;...

WAR file is deployed but works incorrectly on GlassFish

javascript,grails,glassfish
I have a grails app (grails-2.4.4). I make a war file with grails war command. War file structure: 1. /css ... 2. /images ... 3. /js /prototype .... application.js 4. META-INF ... 5. WEB-INF ... I can succesfully deploy the war on GlassFish4 and run the app. But the index...

@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) doesn't work

java,jpa,glassfish,ejb-3.0
I need to delete a list of employees ignoring any integrity constraints (i.e. successfully delete the entity that doesn't related to any others yet or skip the entity that related to others) using JPA 2.0 and EJB3.0 on glassfish3.0: I iterated on the list and call entity manager in a...

GWT + Glassfish 4 : Error 404 for RPC servlet

java,tomcat,servlets,gwt,glassfish
I created a servlet for my GWT app made with eclipse. When I deploy it in TOMCAT works perfectly, but in Glassfish I have an 404 Error. I have no deploy errors, the main html page loads well. But anything that use the RPC servlet gives me this error: com.google.gwt.user.client.rpc.StatusCodeException:...

How to avoid Thread Interrupted Exception

java,multithreading,glassfish
I'm indexing pdf files using Apache lucene with threads. Some threads take time more than 15 minutes. After 15 minutes of thread execution it will throw Thread interrupted Exception.Is there a way to increase the time limit to avoid this issue. I got this exception when there is a single...

Why does Glassfish have two 'glassfish' folders and duplicate directories?

java,glassfish
The question is in the title I guess. Both folders have a bin directory with some duplication of scripts, etc. Then there are multiple lib directories as well. One in the /glassfish/lib and another in /glassfish/domains//lib. It just seems odd to me and gets confusing as to where I should...

Java EE, differentiate context by path

java,glassfish,pathing
I'm working on a workaround for the problem, that glassfish does not support individual certificates for virtual hosts. My Application is supposed to be running context dependent based on which customer wants access to his data. I actually wanted to use seprarate domains for that, but since that is not...

Hiding foreign entity classes from EclipseLink

java,jpa,glassfish,eclipselink
I have a Java EE web application and a custom realm (authentication module) for Glassfish 4 (see GlassFish Application Development Guide, II 4-6 "Creating a Custom Realm"). Both of them are using JPA, with subtle differences. Custom realm <persistence-unit name="AuthPU" transaction-type="JTA"> <jta-data-source>jdbc/AuthDB</jta-data-source> <class>auth.User</class> <exclude-unlisted-classes>true</exclude-unlisted-classes> </persistence-unit> auth.User is a technical entity...

WAR web app redeploying dependencies

java,maven,java-ee,deployment,glassfish
I'm new to Java. Having some trouble deploying a web app. I have an EJB project which I deploy on Glassfish (4.1). I also have a second, JSF WEB application that I deploy to the same server. Though I am making it with the consideration that it will be deployed...

Glassfish4 gzip encoding issue (corrupted responses)

java,glassfish,gzip
Glassfish4 after GZIP enabling works wrong. All the responses after ~12kb are corrupted.

How to send message or redirect user when security constraint block access

jsf,glassfish,web.xml,http-status-code-403,security-constraint
I have following security constraint in my web.xml <security-constraint> <display-name>Admin Pages</display-name> <web-resource-collection> <web-resource-name>Protected Admin Area</web-resource-name> <description/> <url-pattern>/administrator/*</url-pattern> <url-pattern>/faces/backend/*</url-pattern> <http-method>GET</http-method> <http-method>POST</http-method> <http-method>HEAD</http-method>...

Glassfish 3.1.2 will not load

glassfish
JDeveloper 12.1.3.0.0 Glasfish 3.1.2 JSF/JSP bc4j Deploying our application ( originaly developed in JDeveloper 11.1.1.7) for the first time to Glassfish fails with the below entry in the log. I have tried to compile (and run Glassfish) on Java 6 & 7. That makes no difference. The application deploys and...

Application server: Tomcat, Glassfish, Jetty

tomcat,java-ee,servlets,glassfish
In the context of a project we have to write a client/server application in Java. For this purpose we designed the server and the client application using HTTP requests/responses and a database. As we are fresh to this kind of project I have looked for a http server that could...

Getting ClassNotFoundException org.eclipse.persistence.jpa.rs.resources.MetadataResource

java,jpa,glassfish,eclipselink,jpa-rs
I'm trying to walk through the JPA-RS tutorials like: http://java.dzone.com/articles/introducing-eclipselink-jpa-rs or http://www.eclipse.org/eclipselink/documentation/2.5/solutions/restful_jpa.htm But after trying to deploy (/w maven and glassfish plugin) the application on my glassfish I get the following error stacktrace: WebModule[/rest]Servlet /rest threw load() exception java.lang.ClassNotFoundException: org.eclipse.persistence.jpa.rs.resources.MetadataResource at...

HTTP transport error: javax.net.ssl.SSLHandshakeException

java,ssl,glassfish
I have a Java Client on Glassfish that has to consume a soap web service from a third party but I can't get around the error: "error": { "code": "ClientTransportException", "description": "HTTP transport error: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target"...

Could not start GlassFish Server (DAS Port is occupied)

java,netbeans,glassfish
Exception in server.log when I entered start-domain command: Shutting down server due to startup exception java.net.SocketException: Permission denied: listen at sun.nio.ch.Net.listen(Native Method) at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:200) at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) at org.glassfish.grizzly.nio.transport.TCPNIOBindingHandler.bindToChannelAndAddress(TCPNIOBindingHandler.java:131) at...

How to use Mojarra 2.2.10 in Glassfish

jsf-2,glassfish,mojarra
I usually download the latest Mojarra jar from https://maven.java.net/content/repositories/releases/org/glassfish/javax.faces/ or http://repo1.maven.org/maven2/org/glassfish/javax.faces/ and replace the old 'javax.faces.jar' file in C:\glassfish-4.1\glassfish\modules\ With Mojarra 2.2.10, they did not upload the new jar file to either of the above sites, I can only get the following 2 jar files: http://mvnrepository.com/artifact/com.sun.faces/jsf-api/2.2.10 http://mvnrepository.com/artifact/com.sun.faces/jsf-impl/2.2.10 These two files...

CDI will not work with implicit @Dependent scope, unsatisfied injection point compile time error

dependency-injection,glassfish,cdi,managed-bean,glassfish-4.1
The container is Glassfish 4.1 I am having a very weird issue with CDI right now. If I don't annotate my NumberGenerator services @Dependent, then I keep getting unsatisfied injection point error when I run the app. But if I explicitly annotate my NumberGenerator implementations, then everything will work. In...

ArrayIndexOutOfBoundsException: 3 issue in glassfish. How do i resolve?

java,linux,eclipse,glassfish
I am new at both linux and glassfish, I am trying to deploy this .war project I made in Eclipse Kepler. But I get the following error while deploying: Error occurred during deployment: Exception while loading the app : java.lang.ArrayIndexOutOfBoundsException: 3. Please see server.log for more details. Then I go...

Hibernate lazy initilizer issue in glassfish jersy with codehus jackson rest service

hibernate,glassfish,jersey-2.0
I am working on glashfish jersey rest services with codehus-Jackson for json data. But i am getting Hibernate lazy initialization exception for that i have added the lazy=false for all child classes. But it was giving infinite recursion error. So i have added JsonIgnore on reverse mapped properties. But it...

Java EE application and “global” variables

java,java-ee,glassfish,global-variables
we have a Java EE application with primefaces and we are wondering if there's a way to have a "global" application variable. I mean: imagine user1 is editing document1, when user2 try to access document1 we'd like to show a message: "User1 is already editing this document". So, we have...

Why won't my JSF app deploy to GlassFish?

jsf,netbeans,glassfish
Yesterday I had trouble with my app suddenly failing to deploy from NetBeans to GlassFish server. I now know why, and am going to answer this question myself. I just wanted to record this information for the next person that needs it. I hope the etiquette of that is OK?...

Remove “JVM invocation command line” from glassfish logs

java-ee,netbeans,glassfish,netbeans-8,glassfish-4.1
I've a remote glassfish 4.1 registered with netbeans 8.0.2 buy my glassfish logs are being filled up with a continuous repetitive output that looks something like this: [2015-02-02T18:59:45.449+0000] [] [INFO] [NCLS-GFLAUNCHER-00005] [javax.enterprise.launcher] [tid: _ThreadID=1 _ThreadName=main] [timeMillis: 1422903585449] [levelValue: 800] [[ JVM invocation command line: /usr/lib/jvm/java-7-openjdk-amd64/bin/java -cp /glassfish4/glassfish/modules/glassfish.jar -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=9010...

Netbeans Tomcat to Glassfish

glassfish
I have an app that works on Netbeans 8 and Tomcat 8. I tried running on Glassfish 4 and got error on server startup : Severe: Exception during lifecycle processing java.lang.IllegalArgumentException: Invalid URL Pattern: [{0}] at org.glassfish.web.deployment.node.FilterMappingNode.setElementValue(FilterMappingNode.java:143) at com.sun.enterprise.deployment.node.SaxParserHandler.endElement(SaxParserHandler.java:583) I'm using SSI Filter in web.xml : <filter> <filter-name>ssi</filter-name> <filter-class>...

Hippo cms and mysql on Glassfish

mysql,glassfish,hippocms
I have a big problem with the addition of a mysql database to Glassfish. I did all the steps located here http://www.onehippo.org/library/deployment/configuring/configuring-hippo-7-for-mysql.html . When I use $ mvn clean install $ mvn -P cargo.run It's looks fine, because in my workspace.xml I have : <FileSystem class="org.apache.jackrabbit.core.fs.db.DbFileSystem"> <param name="url" value="java:comp/env/jdbc/repositoryDS"/> <param...

project not geting deployed in glassfish server

java,eclipse,glassfish
i am trying to debug my project but its showing error message as such : "cannot Deploy WebForm Deployment Error for module: WebForm: Error occurred during deployment: Exception while preparing the app : Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: java.sql.SQLException: Error in allocating a connection. Cause:...

Displaying version and date of build in the xhtml page from manifest in run time

maven,glassfish,manifest,war
Enumeration<URL> resources = getClass().getClassLoader() .getResources("META-INF/MANIFEST.MF"); //Can't find resource name META-INF/MANIFEST.MF ?...

Jersey MessageBodyWriter not found for media type=text/plain

java,rest,glassfish,jersey,jersey-2.0
I'm trying to follow the Jersey docs to enable a non-200 response if an error occured (https://jersey.java.net/documentation/latest/representations.html#d0e3586) My code looks like : @POST @Produces(MediaType.TEXT_PLAIN) @Consumes(MediaType.APPLICATION_FORM_URLENCODED) public ResponseBuilder getData(@FormParam("one") String one,@FormParam("two") String two,@FormParam("three") String three) { if(one.isEmpty() || two.isEmpty() || three.isEmpty()) { logger.error("Missing params for getData"); throw new WebApplicationException(501); } return...

Object persistence doesn't work

java,glassfish,entity,persistence
I'm trying to implement a little chat with JPA. Everythings work except one thing. I want, when my user open the connection with the endPoint, save his room number, his nickname and the timstamp. My table has been well created, columns too but i cant persist my Connexion Object in...

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

maven,twitter,glassfish,twitter4j,twitter-hbc
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.....

JavaEE - Cannot get rid of session

session,java-ee,glassfish,web.xml,java-security
I built web application using JavaEE, JSF and one Servlet. I use security via Glassfish and web.xml . When I'm logged in I can do whatever I'm allowed to but as soon as I log out the problem happens. Exactly I logout, I'm redirected to the homepage, in the other...

JAX-RS: Jersey + Genson = MessageBodyProviderNotFoundException

java,glassfish,jersey,jax-rs,genson
I am developing RESTful web service using JAX-RS (Jersey) and Glassfish as server. I implemented simple method that returns list of entites and when I attempting to access it server drops 500 error with org.glassfish.jersey.message.internal.MessageBodyProviderNotFoundException: MessageBodyWriter not found for media type=application/json. I tried to add Genson lib to my project...

JAAS Forbidden Error (403) when accessing a protected URL

java-ee,glassfish,jaas
I have just started working on a pet project using JSF, JPA, and EJB on a GlassFish server and I'm currently setting up the authentication module using JAAS. It's about complete now except for a bug for which I can't figure out a solution. My Premise I have a single...

Failed to send an email after migration from Glassfish 2.1 to Glassfish 4.1

java,glassfish,glassfish-4,httplistener,glassfish-4.1
I did a migration of my Client WebApp. Previously, it was running on Glassfish 2.1 and JDK 1.6. Now, it's on Glassfish 4.1 and jdk 1.8. When I try to send an email from my WebApp, the same ".war" packaged in JDK 1.6 (Project facets 1.6) works perfectly on Glassfish...

OpenCSV + JMS/MDB behavior + performance issue

java,glassfish,jms,message-driven-bean,opencsv
I have an web application, that runs under Glassfish 4.1, that contains a couple of features that require JMS/MDB. In particular I am having problems regarding the generation of a report using JMS/MDB, that is, obtain data from a table and dump them in a file. This is what happens,...

Using causes EvaluationException on Submit but executes properly with standard

maven,jsf,glassfish,cdi,java-ee-7
Development Environment 1.8.0_45 JDK Glassfish 4.1 (latest) Maven 3.3.3 NetBeans 8.0.2 MS SQL 2012 Project Details Maven Enterprise Application 2 EJBs 1 WAR (JSF 2.2 Library from Glassfish) EAR Deployment Problem Statement When I use standard <head></head> tags, everything works properly. My CDI works, values are processed, and the site...

Make @PostConstruct do only for first instance of StateLess EJB

java,java-ee,glassfish,ejb
I have a class of staleless EJB (not singleton!). I need one method to be called (load configuration) only once when first bean of this class is created. @PostConstruct solves half of my problem but it's executed for every bean. What is the most elegant way to solve such problem?