Menu
  • HOME
  • TAGS

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

java,glassfish

The reason for this is that it gives you the flexibility to provide libs at different visibility levels. The folder glassfish/lib contains the libs which should be available for the whole server and all domains. The folder glassfish/domains/domain1/lib contains only the libs which are available for domain1. If you had...

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

dependency-injection,glassfish,cdi,managed-bean,glassfish-4.1

If you do not specify a META-INF/beans.xml file, which seems to be your case, you got an implicit bean archive (see CDI-1.1 §12.1). In an implicit bean archive, only beans with a bean defining annotation will be discovered by the CDI engine. Any scope is a bean defining annotation (see...

Netbeans Tomcat to Glassfish

glassfish

On looking at "Invalid URL Pattern:" errors in general for glassfish, I came across a number of issues where it doesn't like tags that don't start with a '/' So, I changed <url-pattern>*</url-pattern> to <url-pattern>/*</url-pattern> and it worked. More importantly, Tomcat accepts this format as well. ...

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

java-ee,nullpointerexception,glassfish,ejb,subclass

I had written @Stateless over my interface of my service. That was the problem.

WAR web app redeploying dependencies

java,maven,java-ee,deployment,glassfish

You could give the dependency a scope of provided: <dependency> <groupId>group.id</groupId> <artifactId>artifact.some.id</artifactId> <version>1.0</version> <type>ear</type> <scope>provided</scope> </dependency> This means that at runtime, the dependency will be provided by the container. see maven doc: This is much like compile, but indicates you expect the JDK or a container to provide the dependency...

Glassfish 3.1.2 will not load

glassfish

The solution was to exclude 2 jar files (both named security from deplyment in GUI project.

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

java,jsf,glassfish,wildfly

Follow the guide from the Wildfly makers themselves. Below is the link: Glassfish to Wildfly Migration Also a very similar guide over here.Another Glassfish to Wildfly Migration...

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

java,web-services,glassfish

I don't know your exact setup but the problem is that you are providing Jersey/Jackson 2.x libs but you are obviously using Jersey/Jackson 1.x. Note that Glassfish 3.x comes with Jersey/Jackson 1.x by default (Glassfish 4.x comes with Jersey/Jackson 2.x by default). The error message shows it can't find class...

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

java,glassfish,jaas,spnego

You need to reformat the [realms] section of krb5.conf like this: [realms] LOC.COM = { KDC = ax.loc.com default_domain = LOC.COM } There are some changes to krb5.conf parsing in JDK8, and JDK-7184246 : Simplify Config.get() of krb5 looks interesting. The diff shows significant changes to the line-by-line processing of...

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

java,tomcat,netbeans,glassfish

Go to xampp setings and stop the tomcat server or change its default port from 8080 to anything else. once you will change the port no. your problem will be solve.

Persistent session in glassfish behind nginx proxy

java,session,nginx,proxy,glassfish

It helps if you post your NGINX proxy config. A basic reverse proxy config looks like this: ... http { .... server { listen 80; server_name www.yourdomain.com; location / { access_log off; proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_redirect off; proxy_set_header X-Real-IP $remote_addr; ... } .... } } ...

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

eclipse,tomcat,java-ee,glassfish,jersey

It looks like you're missing the /rest/ part (before login) in your URL. The rest is set up in your web.xml as the servlet mapping <servlet-mapping> <servlet-name>Jersey REST Service</servlet-name> <url-pattern>/rest/*</url-pattern> </servlet-mapping> So just change the URL to http://localhost:8080/silownia_java/rest/login/dologin ...

project not geting deployed in glassfish server

java,eclipse,glassfish

You have some sort of DB-connection configured in your app. The message "Error connecting to server localhost on port 1527 with message Connection refused: connect. Error Code: 0" says, your program tries to reach a DB on port 1527. The possibilities are: on the production server is no DB running:...

JSF 2.1 to 2.2 migration causes java.lang.NullPointerException at org.apache.catalina.connector.CoyoteAdapter.service

maven,jsf,glassfish,jsf-2.2

ok the answer is simple guys.. i had the same issue ! just be sure to follow it =). its indeed a bug of glassfish 4.1. nucleus Grizzly jar file has a problem and there is a patch for it. Just replace this file in your glassfish jar files. with...

glashfish 4.1 not start on ubuntu server 14.04

java,ubuntu,glassfish,ubuntu-14.04,glassfish-4

Today I done some searching and get same Issue on https://www.stagejava.net/forum/topic/glassfish/glassfish/issues-starting-glassfish-server according to this issue. If you give wrong option to Asadmin then this error message are come. I correct option and try it work. thanks to all.

Glassfish 4 can't enable remote admin?

java,glassfish,remote-access,glassfish-4

You need the following to administer Glassfish remotely: set a non-blank password for all admin logins enable secure admin ensure the network listener is listening on the correct IP addresses (it could be set to listen only on the loopback interface) ...

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

java,rest,deployment,glassfish,jersey

Ok looked at your issue. The External Glassfish v 3.1.2.2 that you are using is JAVA-EE 6 compatible. And the one through which you are running your app in eclipse is JAVA-EE 7 compatible. Have a look at both the java docs: Application class Java Doc for EE6 Application class...

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

java,jpa,glassfish,eclipselink,jpa-rs

Use your eclipselink dependencies of the same version: either both eclipselink and org.eclipse.persistence.jpars should be 2.6.0 or both should be 2.5.0. When using 2.6.0 org.eclipse.persistence.jpa.rs.resources.MetadataResource is in the eclipselink.jar...

How to run on GlassFish in IntelliJ?

java,intellij-idea,glassfish

Did you follow the recommended way to create your J2EE project in Intellij? Follow the guide here: Getting Started with Java EE 7 and GlassFish 4.0...

Rollback in ManagedBean on a project JSF + EJB + CDI + JAX-RS + GlassFish 4.1

jsf,glassfish,ejb,cdi,jta

Change your class as below: @Transactional public class TestManagedBean extends AbstractManagedBean { And your method as below: @Transactional public String test() { ...

How to use Mojarra 2.2.10 in Glassfish

jsf-2,glassfish,mojarra

Have a look again. The file you are looking for IS available for download! See here: https://maven.java.net/content/repositories/releases/org/glassfish/javax.faces/2.2.10/ Or here: Direct link: https://maven.java.net/content/repositories/releases/org/glassfish/javax.faces/2.2.10/javax.faces-2.2.10.jar...

Java EE application and “global” variables

java,java-ee,glassfish,global-variables

If you want to save something globally, in Java EE 6+ it should use the Application Scope http://docs.oracle.com/javaee/6/api/javax/enterprise/context/ApplicationScoped.html For example: @ApplicationScoped class Global { void setDocInUse(boolean) { ... } boolean isDocInUse() { ... } } @RequestScoped class MyDocEditor { @Inject Global global; public void edit() { if (global.isDocInUse()) { ......

HTTP transport error: javax.net.ssl.SSLHandshakeException

java,ssl,glassfish

Finally got it working. I had to explicitly tell Glassfish about the cacerts to be used even with those certificates being available in the /jdk/jr, /jre and the glassfish domain config cacerts... asadmin> create-jvm-options -Djavax.net.ssl.trustStore="/Program Files/Java/jre7/lib/security/cacerts" ...

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

java,java-ee,glassfish,ejb-3.0

it looks like your entity class is not serialize, implement Serializable interface in your Book class @Entity @NamedQuery(name = "findAllBooks", query = "select b from Book b") public class Book implements Serializable { @Id @GeneratedValue private long id; ... } hope it will help....

Password protected domain glassfish

security,java-ee,authentication,amazon-web-services,glassfish

This is Basic access authentication used primarily on Apache webservers. In this instance is negotiated by use of an .htaccess and .htpasswd file. There is a very good .htaccess/passwd creation tool here which will allow you to create the files to give basic password http password protection to any site....

How to avoid Thread Interrupted Exception

java,multithreading,glassfish

UPDATE: I see that you are using Glassfish and are saying this interrupt is occurring every time at 15 minutes. It appears Glassfish is set to timeout at around 900 seconds which is 15 minutes by default - this throws an InterruptException. Since your application viably needs to process for...

Using causes EvaluationException on Submit but executes properly with standard

maven,jsf,glassfish,cdi,java-ee-7

The lackof an h:head makes the ajax tag give warning. It needs script to be added to the head which only workswith h:head, nota plain head. When this starts working, most likely one of the inputs is not send to the server when the button is pressed, resulting in execptions...

Glassfish service throws an error

java-ee,netbeans,service,glassfish

So I have found the answer, I post it there in case someone does read this topic. I had to set another parameter to the glassfish conf, AS_JAVA, and give it the path to the JDK. I then got a 404 error. So I put my .war file in the...

Remove “JVM invocation command line” from glassfish logs

java-ee,netbeans,glassfish,netbeans-8,glassfish-4.1

After searching all over found out that the daemon manager was trying to start it over and over because it was expected to stay on foreground. So this caused that each time the daemon manager tried to bring it back Glassfish reported it on its logs. Specifically it's a docker...

Why won't my JSF app deploy to GlassFish?

jsf,netbeans,glassfish

The problem was caused by a compile error in my code, which didn't show up until I did a complete "Clean and Build" ...and this couldn't be done until I shut-down the GlassFish server. Conclusion: If the problem occurs try shutting down the GlassFish server and doing a complete "Clean...

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

maven,glassfish,manifest,war

The correct resource name is /applications/ProjectName/META INF/MANIFEST.MF . Replace ProjectName with your project name. Updated the code according below: . . Enumeration resources = getClass().getClassLoader() .getResources("/applications/ProjectName/META INF/MANIFEST.MF"); . .

Make @PostConstruct do only for first instance of StateLess EJB

java,java-ee,glassfish,ejb

I see tow options: Consider using a singleton object encapsulating the configuration data of your file and add a reference to it in your EJB. consider a creational design patterns. I think that the prototype pattern should fit your need but you may find other alternatives. Check this for details:...

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

maven,twitter,glassfish,twitter4j,twitter-hbc

In Short: Use a newer version of Guava. Explanation I guess, you have Guava 14 or 15 on your class path. The class com.google.common.util.concurrent.ServiceManager contains an @Inject expecting a Set of services. This dependency is not available, and the container raises a DeploymentException. The solutions Use a newer Guava version...

Implementation of CRL in Glassfish 4.1 [SOLVED]

ssl,glassfish

I finally found out how to make it work. The first link I gave in my question pointed in the good direction, but it had an error. Actually, the property "crlFile" doesn't exist, at least not in Glassfish v3.0.1 ([Oracle GlassFish Server 3.0.1 Domain File Format Reference]). The right name...

Handling of Objects in WebSocket Session

java,session,websocket,glassfish

You don't need to handle these objects yourself, the Java EE server handles it. Your just need to create an instance variable in the endpoint class. For example, @ServerEndpoint(value = "/test-server/") public class TestWebSocketServer { private YourObject yourObject = new YourObject(); //or instantiate it in constructor } The Java EE...

Object persistence doesn't work

java,glassfish,entity,persistence

The EJB container injects an entity manager in your bean, but you discard it and replace it by one you create yourself. All you need is @Stateless @LocalBean public class DAO { @PersistenceContext EntityManager em; public void createConnection(String nickName, String roomName) { Connexion c = new Connexion(); c.setNickName(nickName); c.setRoomName(roomName); c.setConnectionDate(new...

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

rest,glassfish,jax-rs

you could answer requests to http with 301 (Moved permanently, telling the client to use the new location in future requests) pointing to the https equivalent in the location header of the response.

Java EE, differentiate context by path

java,glassfish,pathing

I'm assuming you mean SSL certificates. I would consider setting up a reverse proxy that handles the multiple domains and their SSL encryption and forwards the requests to normal HTTP on Glassfish. In the application itself the distinction by customers can be made via the login they use (roles/groups, ...)....

Glassfish4 gzip encoding issue (corrupted responses)

java,glassfish,gzip

The reason is internal Glassfish issue. The solution could be found here. https://java.net/jira/browse/GRIZZLY-1535 Just download nucleus-grizzly-all.jar stop domain replace existing jar in glassfish\modules with downloaded one clear osgi-cache (just remove everything in glassfish\domains\YOUR_DOMAIN\osgi-cache\felix) start domain. ...

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

jsf,netbeans,xhtml,glassfish,managed-bean

I guess the problem is that your JSF code isn't evaluated. You can prove this by looking at the source code of the generated HTML, if it is the same as the code in your start.xhtml, the code isn't evaluated. To fix this, change the servlet-mapping in your web.xml to...

JEE can't run JAX-RS WebService skeleton app

java,maven,glassfish,jersey,jax-rs

Glassfish 4 uses Jersey 2.x. You should change the dependency and web.xml configuration accordingly. For the dependency, you can use <dependency> <groupId>org.glassfish.jersey.containers</groupId> <artifactId>jersey-container-servlet</artifactId> <version>${jersey2.version}</version> <scope>provided</scope> </dependency> And configuration <servlet> <servlet-name>jersey-serlvet</servlet-name>...

NULL EJB referece

java-ee,glassfish,ejb,ejb-3.0,glassfish-4

Actually, after trying a lot things, it worked when I annotated the class ExecuterEndpoint with @Stateless. I really appreciate if someone has a good explanation. ...

SessionContext not injected when using decorators

java,java-ee,glassfish,ejb,cdi

SessionContext is a resource that is linked to EJB and a Decorator is not an EJB but a CDI bean so it's normal that you get a null SessionContext. You could try getting your SessionContext via Jndi like it is describe here: http://javahowto.blogspot.fr/2006/06/4-ways-to-get-ejbcontext-in-ejb-3.html

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

hibernate,glassfish,jersey-2.0

Just i have added the codehusjackson 1.9.2 jars now it is recognizing @JsonBack reference. But on each pojo class we need to add @JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})

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

jsf,glassfish,infinite-loop,facesservlet

This problem suggests that you're using JSF 1.x, not JSF 2.x. JSF 1.x uses JSP as default view technology whereas JSF 2.x uses Facelets as default view technology. And, JSF 1.x has the known bug ("feature") that its FacesServlet would run in an infinite loop when it's being mapped on...

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

java,debugging,java-ee,netbeans,glassfish

Additional information relevant to the problem is that I was trying to get a test client working for the service. The problem turned out to be that I was simply adding another java class to the service package. The solution is: Create a new project. Add a new Web Service...

How to find servlet API version for glassfish server?

java,java-ee,servlets,glassfish

Look at Java EE version. Servlet (and JSP, JSF, EJB, JPA, etc) version goes hand in hand with Java EE version. Java EE 8 = Servlet 4.0 Java EE 7 = Servlet 3.1 Java EE 6 = Servlet 3.0 Java EE 5 = Servlet 2.5 J2EE 1.4 = Servlet 2.4...

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

java,glassfish,glassfish-4,httplistener,glassfish-4.1

On glassfish Instead of "Default-configuration" add Djava.net.preferIPv4Stack=true to server-config. I think it can fix your problem

jersey - moxy returning appended json in class property

java,json,glassfish,jersey,moxy

MOXy is a JAXB implementation, while JsonObject is part of JSON-P. MOXy happens to be able to deal with JSON too, but that is a proprietary extension over the JAXB standard. As far as I know, there is no default mapping available between JSON-P and JAXB. The reason you're seeing...

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

jsf,file-upload,glassfish,jsf-2.2,prettyfaces

Found a sufficient solution, was posted here on stackoverflow.com before: Fileupload and PrettyFaces and JSF 2.2 Not pretty, but it works....

Basic Authentication on Glassfish using Ldap

java,authentication,active-directory,glassfish,ldap

In order to configure the realm in Glassfish look To Create an LDAP Realm in the GlassFish Server. Regarding Apache Directory Studio, see Let's create an LDAP user and search for him. You may want to see Setting up an LDAP directory server for Alfresco development....

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

java,maven,java-ee,jpa,glassfish

persistence.xml should be put inside the folder CLASS_PATH_ROOT/META-INF. If you are using Maven 's standard project layout , the path should be src/main/resources/META-INF/persistence.xml...

OpenCSV + JMS/MDB behavior + performance issue

java,glassfish,jms,message-driven-bean,opencsv

Adding the @TransactionAttribute(NOT_SUPPORTED) annotation on the bean might solve the problem (and it did, as your comment indicates). Why is this so? Because if you don't put any transactional annotation on a message-driven bean, the default becomes @TransactionAttribute(REQUIRED) (so everything the bean does, is supervised by a transaction manager). Apparently,...

Glassfish server not found in Eclipse Luna

eclipse,glassfish

Try to install GlassFish tool in Eclipse correctly. http://marketplace.eclipse.org/content/glassfish-tools-luna And I have tip: Install NetBeans IDE with built-in GlassFish server, if you are new comer. Almost things has been configured for you. ...

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

jsf,glassfish,web.xml,http-status-code-403,security-constraint

Simply configure the desired page as a custom HTTP 403 error page in web.xml. <error-page> <error-code>403</error-code> <location>/WEB-INF/errorpages/403.xhtml</location> </error-page> This assumes that you've covered *.xhtml as URL pattern of FacesServlet. And, it's being placed in /WEB-INF to prevent direct access....

Hippo cms and mysql on Glassfish

mysql,glassfish,hippocms

Your MySQL configuration seems to be fine. You have to keep in mind that the most important thing is that all the configuration needs to be correct in the repository.xml file. The workspace.xml is generated/extracted out of the repository.xml file once the repository gets initialized for the first time. So...

Webstart Security is Impossible. Trying to use with glassfhish 4

java,security,deployment,glassfish,java-web-start

Here is what I found incase others find it useful. It looks like Glassfish 4.1 has a webstart bug when using Java 7 update 25 or later (currently 8.0.31). The workaround is to use an older version of Java. I never could get the java console exceptions list to work....

Java servlet access to config file

java,servlets,glassfish

Sure you can. You can load the properties at startup and note the modification time for the file; then you can reload the properties again when the modification time has changed, i.e. when someone has edited it. The check and reload can be done using a background thread or on...

Glassfish deploy error “Archive type of MyProject.jar was not recognized”

java,rest,deployment,jar,glassfish

Okay, because my comment was rather unexplanatory: Web applications are handled by application servers or servlet containers. Both do quiet a lot of work for you and web applications are not comparable to desktop or standalone java applications. While your standalone applications are deployed as jar - files and then...

JAAS Forbidden Error (403) when accessing a protected URL

java-ee,glassfish,jaas

After a bit of tinkering with configuration, I finally found a solution. I made following changes to my Realm Assign Groups: ADMIN,MEMBER and then in glassfish-web.xml, <security-role-mapping> <role-name>MEMBER</role-name> <principal-name>MEMBER</principal-name> <group-name>MEMBER</group-name> </security-role-mapping> I also had a case-sensitivity issue, I was storing roles as Member in the table but using MEMBER in...

GWT + Glassfish 4 : Error 404 for RPC servlet

java,tomcat,servlets,gwt,glassfish

Solved! I didn't check the server.log of glassfish. There was an error of casting of the RPC servlet: rpc servlet cannot be cast to javax.servlet.Servlet The problem was I messed up the libs and added javax* in the classpath, and Glassfish don't need this. I deleted all additional libs I...

Change colour of Glassfish 3.1 Community Edition Domain Application Server

glassfish,glassfish-3

I didn't find an example but it looks like it is possible to change the layout of Glassfishs Admin UI via a so called integration-point which looks similar to this: <integration-point id="myOwnBrand" type="org.glassfish.admingui:customtheme" priority="2" content="myOwnBrand.properties" /> The Oracle docs for Changing the Theme or Brand of the Administration Console contains...

Jersey MessageBodyWriter not found for media type=text/plain

java,rest,glassfish,jersey,jersey-2.0

The problem is the return type of your method. It has to be Response instead of ResponseBuilder. Change your code to the following and it should work: @POST @Produces(MediaType.TEXT_PLAIN) @Consumes(MediaType.APPLICATION_FORM_URLENCODED) public Response 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");...

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

java,linux,eclipse,glassfish

I found the solution. I was creating the project on one machine using jdk8 and then tried to deploy it on another machine in glass-fish version 3 which was running on jdk6. I then simply switched to glass-fish version 4 and jdk8 and it is running ok now.

Null pointer exception when attempting to use JNDI for JDBC

java,jdbc,glassfish,jndi,glassfish-4

Got to the Menu JDBC -> JDBC Resources -> jdbc/__default Choose your DBName at the DropDown Menu "Pool Name: " and use @Resource (mappedName="jdbc/__default") Mind the two "_" ! At least this works for me. p.s.: Can you specify where the NPE is thrown ?...

WAR file is deployed but works incorrectly on GlassFish

javascript,grails,glassfish

Make sure you installed the prototype-plugin for Grails. From the Grails plugin page: As of Grails 2.0 Prototype is no longer the default JavaScript library (jQuery is used instead). This plugin allows older application to continue to use Prototype by uninstalling the jQuery plugin and installing this one. See https://github.com/gpc/grails-prototype...

Application server: Tomcat, Glassfish, Jetty

tomcat,java-ee,servlets,glassfish

As i understand you serach something and want some useful links to start, lets try to answer your question: How these application server work? Basically when they are run it starts to listen a port(it can be change or configuravle according to server you select tomcat default 8080 etc.) and...

Postgresql and GlassFish - cannot commit when autoCommit is enabled

java,postgresql,jdbc,glassfish,mybatis

The solution: in glassfish web console open postgresql pool and at section transactions set enable to Non transactional connections.

Could not start GlassFish Server (DAS Port is occupied)

java,netbeans,glassfish

Sometimes it helps to add the following JVM option: -Djava.net.preferIPv4Stack=true To set it, open your domain.xml and search for the part with <jvm-options>...</jvm-options> inside of <config name="server-config">. Add a new JVM option like this: <jvm-options>-Djava.net.preferIPv4Stack=true</jvm-options> Save the file and try to start the server....

Glassfish 3.1.2 binding error

binding,glassfish

The solution was to compare the 2 ear files and ensure they contained the same jar files.

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

java,spring,hibernate,glassfish

Ok I found what was causing my SessionFactory init to fail: I had: @ManyToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="pk.fragment") private Set<AssetFragment> fragmentAssets = new HashSet<>(); Changed it to: @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="pk.fragment") private Set<AssetFragment> fragmentAssets = new HashSet<>(); Atleast it now depolys. will have to look in to manyToMany relations. Thanks for the help....

@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW) doesn't work

java,jpa,glassfish,ejb-3.0

deleteEmployee method is not wrapped into a new transaction because you are referencing method on this. What you can do is to inject reference to the facade itself and then call deleteEmployee method on it (it should be public). More or less something like this: @Stateless public class MyFacade {...

JavaEE - Cannot get rid of session

session,java-ee,glassfish,web.xml,java-security

I guess this is happening because you are using BASIC auth method in your application which doesn't require cookies, session identifier and login pages, rather uses standard HTTP headers. This means once user is authenticated, each request contains login info, so user is automatically logged in next time he access...

Reading an EAR's manifest

java,java-ee,glassfish,classloader,manifest

You need to locate where the ear file is and then get the manifest by: new java.util.jar.JarFile(file).getManifest(); ...

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

json,rest,glassfish,jackson,jersey-2.0

(Per comment from @peeskillet) I replaced this: <dependency> <groupId>org.glassfish.jersey.media</groupId> <artifactId>jersey-media-json-jackson</artifactId> <version>2.17</version> </dependency> with: <dependency> <groupId>com.fasterxml.jackson.jaxrs</groupId> <artifactId>jackson-jaxrs-json-provider</artifactId> <version>2.5.3</version> </dependency> and packages("com.fasterxml.jackson.jaxrs.base"); with:...

Hiding foreign entity classes from EclipseLink

java,jpa,glassfish,eclipselink

Okay, I've figured out what exactly happens. According to GlassFish Application Deployment Guide (C-13), the web module follows the standard class loader delegation model and delegates to its parent class loader first before looking in the local class loader. This is the default behavior which can be controlled with <class-loader>...

My Websocket takes forever to connect

java,websocket,glassfish,ipv6,tyrus

So the cause of the troubles is the initialization of an InitialContext by Tyrus in order to re-use a (scheduled) executor service if one is available. Normally this fails fast if none is available (and this is logged as a debug-message, see further on), but in this case it failed...

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

security,ssl,glassfish,ssl-certificate,glassfish-4.1

The problem is that the same certificate alias (s1as) is also used for the ORB IIOP listeners. You have to change it to your new alias. In the Glassfish Admin UI, navigate to server-config - ORB and change the certificate alias for the different listeners in their SSL tab. ...

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

java,linux,glassfish,glassfish-4

Have you tried restarting GlassFish? Could be that the server hasn't been restarted after upgrading the JRE (and therefore the old version could still be running in memory).

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

java,oauth,google-api,glassfish

Solved it by the answer on this post: Invalid grant when accessing Google API The problem was that the server's clock was not synchronized with NTP. That was it......

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

java,netbeans,ant,jar,glassfish

You don't want to place the dependencies you developed on your own inside the Glassfish lib folder. This may be sufficient for productive usage, but not for development. To do it right, you need an EAR. Inside the EAR, you can create a lib folder for your dependencies. The EAR...

Server Authentication Module forwarding in Glassfish

java,glassfish,jaas,jaspic,jsr196

Yes, you can do that in the validateRequest method. Here is a simple example: public AuthStatus validateRequest(MessageInfo messageInfo, Subject clientSubject, Subject serviceSubject) throws AuthException { // clientSubject.getPrincipals() returns the principals // check this set to know if the user is not logged in // if the user is not logged...

Unable to send binary message through websocket in tomcat, but works in glassfish. Fails in tomcat with IllegalArgumentException

java,websocket,glassfish,tomcat8,java-websocket

Looks like you need to check the buffer size of tomcat server configuration. The default buffer size for binary messages is 8192 bytes. http://tomcat.apache.org/tomcat-7.0-doc/web-socket-howto.html What is the value of "incomingAddressBook.toByteArray().length" ? Try the below in your web.xml., <context-param> <param-name>org.apache.tomcat.websocket.textBufferSize</param-name> <param-value>32768</param-value> </context-param> <context-param>...

How to resolve ClassNotFoundException for Throwable in Weblogic 12c

java-ee,glassfish,weblogic,classnotfoundexception,throwable

This is how it should be in web.xml: <error-page> <exception-type>java.lang.Throwable</exception-type> <location>/error.jsp</location> </error-page> ...

JAX-RS Resource not found in GlassFish Server

java,web-services,rest,glassfish,jax-rs

You're probably missing the JAX-RS application servlet. You can either define it in the web.xml or if you want to go xml-less, you can use a Application subclass. The easiest way IMO is just to use the Application subclass annotated with @ApplicationPath. A servlet will be created and the servlet...

How to check Glassfish4 server is overloaded?

jsp,java-ee,servlets,glassfish,servlet-filters

I write a Filter class. In Filter class, I check JVM memory status to redirect server busy page.

Simple JavaEE HTML GET/POST application

java,java-ee,intellij-idea,glassfish,jax-rs

You need to configure Jersey (the JAX-RS implementation in Glassfish) in your web.xml. You currently only have JSF configuration <servlet> <servlet-name>jersey-serlvet</servlet-name> <servlet-class>org.glassfish.jersey.servlet.ServletContainer</servlet-class> <init-param> <param-name>jersey.config.server.provider.packages</param-name> <param-value>the.package.where.your.resources.are</param-value> </init-param>...

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

java,json,glassfish

Ok. I checked JsonGeneratorImpl source code. And I have to say that I really need to close it. First of all, JsonGeneratorImpl receives buffer from BufferPoolImpl here: public final char[] take() { char[] t = (char[])getQueue().poll(); if (t == null) return new char[4096]; return t; } And when we call...

JAX-RS: Jersey + Genson = MessageBodyProviderNotFoundException

java,glassfish,jersey,jax-rs,genson

Are you using Jersey 2? If yes this is probably the reason why it does not work. Try with latest Genson release. It is supposed to also work out of the box with Jersey 2+. <dependency> <groupId>com.owlike</groupId> <artifactId>genson</artifactId> <version>1.2</version> </dependency> ...

Wrong file name in different servers

java,glassfish

Please try: java.net.URLEncoder.encode(distributionService.get(id).getTitle() + ".txt", "UTF-8") instead of BufferUtil.getEncoded(distributionService.get(id) .getTitle(), request) + ".txt"); ...

JDBC Connection Pool SSL Error PKIX building failed

java,postgresql,jdbc,glassfish,glassfish-4

Just to answer my own question, I was doing everything right. The only thing I missed was checking Postgres SSL certs were being read from the correct file (/etc/postgresql/9.4/main/postgresql.conf ). I can now Ping successfully...

Spring social /connect return 404

spring,spring-mvc,glassfish,spring-social

Just a guess, but do you happen to have any views (JSP, Thymeleaf, or otherwise) at "connect/{providerId}Connect" or "connect/{providerId}Connected"? Do you have a view at "connect/status" ? If not, then that's one possibility for the 404s. The controller method answering at the "/connect" path collects connection status information for all...