[MQ-346] jmsra.upgrade_check_failed WARNING on Glassfish startup Created: 22/Oct/13  Updated: 23/Oct/13  Resolved: 23/Oct/13

Status: Closed
Project: mq
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Andrew_Scully Assignee: Ed Bratt
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Glassfish 4.0


Issue Links:
Duplicate
duplicates GLASSFISH-20866 jmsra.upgrade_check_failed WARNING on... Open
Tags: glassfish4, jms, log, mq, ra, startup, warning

 Description   

During startup, the following entry is written to the log...

2013-10-22 15:27:12,442 WARNING glassfish 4.0 javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.jms.util _ThreadID=15;_ThreadName=WrapperSimpleAppMain; jmsra.upgrade_check_failed

...despite this, all of the JMS functionality seems to work fine.

This post...

https://forums.oracle.com/thread/1520247

...appears to suggest that the WARN level is inappropriate.



 Comments   
Comment by amyk [ 22/Oct/13 ]

This issue's synopsis says 'jmsra.upgrade_check_failed WARNING on Glassfish startup' which is a warning logged by GlassFish server (not MQ), whereas the post mentioned in the description in the following link

https://forums.oracle.com/thread/1520247

is about the benign warning '[C4036]: A broker error occurred. :[505] bad version user=guest, broker=localhost:7676(42589)'

Which warning this issue actually refers to ?

Comment by amyk [ 22/Oct/13 ]

The '[C4036]: ... bad version ..' warning log message is fixed in GlassFish MQ 4.5 (GlassFish 3.1).

Please file a GlassFish jira issue for the GlassFish server log warning message '.. jmsra.upgrade_check_failed .." at
https://java.net/jira/browse/GLASSFISH

Comment by Andrew_Scully [ 23/Oct/13 ]

I've raised https://java.net/jira/browse/GLASSFISH-20866.

This issue can now be closed.





[JERSEY-2491] REOPEN -GLassfish failed to inject CDI managed beans in an ExceptionMapper Created: 22/Apr/14  Updated: 10/Sep/15  Resolved: 23/Apr/14

Status: Closed
Project: jersey
Component/s: containers
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: hazem Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Glassfish 4


Attachments: Zip Archive glassfish4-test-master.zip    
Issue Links:
Duplicate
duplicates JERSEY-2393 GLassfish failed to inject CDI manage... Closed
Tags: cdi, glassfish4, hk2, incomplete, jersey

 Description   

I created a custom ExceptionMapper and I want to inject a CDI managed bean (singleton) into it

@Provider
public class MyExceptionMapper implements ExceptionMapper<Throwable> {
@Inject
private Manager myManager;

@Override
public Response toResponse(Throwable exception)

{ // My implementation }

}

I get the following exception when I access the application
org.glassfish.hk2.api.UnsatisfiedDependencyException: There was no object available for injection at Injectee(requiredType=Manager,parent=MyExceptionMapper,qu
alifiers={}),position=-1,optional=false,self=false,unqualified=null,1954647854)
at org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:74)
at org.jvnet.hk2.internal.ClazzCreator.resolve(ClazzCreator.java:191)
at org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:214)
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:311)
at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:448)
at org.jvnet.hk2.internal.SingletonContext.findOrCreate(SingletonContext.java:118)
at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2204)
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)
at org.glassfish.jersey.internal.inject.ProviderToService.apply(ProviderToService.java:57)
at org.glassfish.jersey.internal.inject.ProviderToService.apply(ProviderToService.java:53)
at com.google.common.collect.Iterators$8.transform(Iterators.java:860)
at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
at java.util.AbstractCollection.addAll(AbstractCollection.java:341)
at java.util.LinkedHashSet.<init>(LinkedHashSet.java:169)
at com.google.common.collect.Sets.newLinkedHashSet(Sets.java:292)
at org.glassfish.jersey.internal.inject.Providers.getClasses(Providers.java:336)
at org.glassfish.jersey.internal.inject.Providers.getAllProviders(Providers.java:323)
at org.glassfish.jersey.internal.inject.Providers.getAllProviders(Providers.java:213)
at org.glassfish.jersey.internal.ExceptionMapperFactory.<init>(ExceptionMapperFactory.java:158)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.glassfish.hk2.utilities.reflection.ReflectionHelper.makeMe(ReflectionHelper.java:1091)
at org.jvnet.hk2.internal.ClazzCreator.createMe(ClazzCreator.java:244)
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:319)
at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:448)



 Comments   
Comment by Jakub Podlesak [ 22/Apr/14 ]

I am sorry, but i do not see this file updated: https://github.com/hmashlah/glassfish4-test/blob/master/src/main/java/sample/gf4/exceptions/TestExceptionMapper.java

Comment by Jakub Podlesak [ 22/Apr/14 ]

The exception mapper itself must be made a CDI bean in order to have it CDI injected. I hope that clarifies.

Comment by Jakub Podlesak [ 22/Apr/14 ]

updated test case





[JERSEY-2393] GLassfish failed to inject CDI managed beans in an ExceptionMapper Created: 10/Feb/14  Updated: 03/Jun/16  Resolved: 03/Jun/16

Status: Closed
Project: jersey
Component/s: containers
Affects Version/s: None
Fix Version/s: 2.11

Type: Bug Priority: Major
Reporter: hazem Assignee: Stepan Vavra
Resolution: Fixed Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Glassfish 4


Issue Links:
Duplicate
is duplicated by JERSEY-2491 REOPEN -GLassfish failed to inject CD... Closed
Tags: cdi, glassfish4, hk2, incomplete, jersey

 Description   

I created a custom ExceptionMapper and I want to inject a CDI managed bean (singleton) into it

@Provider
public class MyExceptionMapper implements ExceptionMapper<Throwable> {
@Inject
private Manager myManager;

@Override
public Response toResponse(Throwable exception)

{ // My implementation }

}

I get the following exception when I access the application
org.glassfish.hk2.api.UnsatisfiedDependencyException: There was no object available for injection at Injectee(requiredType=Manager,parent=MyExceptionMapper,qu
alifiers={}),position=-1,optional=false,self=false,unqualified=null,1954647854)
at org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:74)
at org.jvnet.hk2.internal.ClazzCreator.resolve(ClazzCreator.java:191)
at org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:214)
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:311)
at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:448)
at org.jvnet.hk2.internal.SingletonContext.findOrCreate(SingletonContext.java:118)
at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2204)
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)
at org.glassfish.jersey.internal.inject.ProviderToService.apply(ProviderToService.java:57)
at org.glassfish.jersey.internal.inject.ProviderToService.apply(ProviderToService.java:53)
at com.google.common.collect.Iterators$8.transform(Iterators.java:860)
at com.google.common.collect.TransformedIterator.next(TransformedIterator.java:48)
at java.util.AbstractCollection.addAll(AbstractCollection.java:341)
at java.util.LinkedHashSet.<init>(LinkedHashSet.java:169)
at com.google.common.collect.Sets.newLinkedHashSet(Sets.java:292)
at org.glassfish.jersey.internal.inject.Providers.getClasses(Providers.java:336)
at org.glassfish.jersey.internal.inject.Providers.getAllProviders(Providers.java:323)
at org.glassfish.jersey.internal.inject.Providers.getAllProviders(Providers.java:213)
at org.glassfish.jersey.internal.ExceptionMapperFactory.<init>(ExceptionMapperFactory.java:158)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at org.glassfish.hk2.utilities.reflection.ReflectionHelper.makeMe(ReflectionHelper.java:1091)
at org.jvnet.hk2.internal.ClazzCreator.createMe(ClazzCreator.java:244)
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:319)
at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:448)



 Comments   
Comment by jwells [ 11/Feb/14 ]

I tend to think this is a Jersey issue rather than an hk2 issue, since the ServiceLocator here is Jersey's

Comment by Jakub Podlesak [ 12/Feb/14 ]

What if you make the exception mapper a CDI bean? E.g. if you go with:

@Provider
@ApplicationScoped
public class MyExceptionMapper implements ExceptionMapper<Throwable> {
@Inject
private Manager myManager;
...

Then your Manager instance should get injected all right.

Comment by Jakub Podlesak [ 12/Feb/14 ]

Please let me know how the above suggestion works for you.

Comment by hazem [ 12/Feb/14 ]

I tried the suggestion above and it did not help, I still get the same issue

Comment by adriaaaaan [ 12/Mar/14 ]

Are you sure? It works for me.

@Provider
@RequestScoped
public class SecurityExceptionMapper implements ExceptionMapper<AccessLocalException> {

@Inject @CurrentUser UserLogin currentUser;

@Override
public Response toResponse(AccessLocalException ex) {
if(currentUser!=null && !currentUser.getUserName().equals("ANONYMOUS"))

{ return Response.status(Response.Status.FORBIDDEN).entity(ex.getMessage()).build(); }

return Response.status(Response.Status.UNAUTHORIZED).entity(ex.getMessage()).build();
}
}

In this instance, adding requestscoped has injected the current user allowing this mapper to return forbidden.

Comment by hazem [ 12/Mar/14 ]

Is UserLogin your own class or is it part of JavaEE. If it is yours can you please elaborate on what kind of bean is it

Comment by Marek Potociar [ 26/Mar/14 ]

Please attach a simple web application that reproduces the problem on GF 4.x. (You can e.g. create a small project on github and then paste a link to the project here.)

Comment by Marek Potociar [ 26/Mar/14 ]

Marking as incomplete - waiting for a reproducer webapp to be provided by the issue filer.

Comment by hazem [ 26/Mar/14 ]

I created a sample project to reproduce this bug

https://github.com/hmashlah/glassfish4-test

Comment by Jakub Podlesak [ 22/Apr/14 ]

Just tried to update the exception mapper as suggested above:

...
/**
 * Created by mashlah on 26.03.14.
 */
@Provider
@javax.enterprise.context.ApplicationScoped
public class TestExceptionMapper implements ExceptionMapper<TestException> {


    // Using @Context does not help
    @Inject
    private TestService testService;
...

and the thing works for me just fine:

curl -i http://localhost:8080/glassfish4-test-master/sample/test/getEmpty
HTTP/1.1 200 OK
Server: GlassFish Server Open Source Edition  4.0.1
X-Powered-By: Servlet/3.1 JSP/2.3 (GlassFish Server Open Source Edition  4.0.1  Java/Oracle Corporation/1.7)
Date: Tue, 22 Apr 2014 14:07:06 GMT
Content-Length: 0

curl -i http://localhost:8080/glassfish4-test-master/sample/test/getException
HTTP/1.1 400 Bad Request
Server: GlassFish Server Open Source Edition  4.0.1
X-Powered-By: Servlet/3.1 JSP/2.3 (GlassFish Server Open Source Edition  4.0.1  Java/Oracle Corporation/1.7)
Content-Type: text/plain
Date: Tue, 22 Apr 2014 14:07:21 GMT
Connection: close
Content-Length: 16

Exception thrown
Comment by Jakub Podlesak [ 22/Apr/14 ]

Please feel free to re-open after updating the test case.

Comment by hazem [ 22/Apr/14 ]

The test case is updated

Comment by hazem [ 22/Apr/14 ]

I do not have permission to re-open this bug

Comment by Jakub Podlesak [ 23/Apr/14 ]

Re-opening so that the reporter has a chance to either: confirm the updated test case works for him or to clarify, why the update does not work for him.
Going to close this one as invalid if i do not hear any news as myself and one other user confirmed suggested test case update works just fine.

Comment by hazem [ 23/Apr/14 ]

The suggested solution works on glassfish 4.0.1 but does not work on glassfish 4.0

Comment by Marek Potociar [ 01/Sep/15 ]

Closing as fixed - we will not backport the fix to GF 4.0





[GLASSFISH-21050] Problem with classloader and casting using osgi gf-client-module to access remote EJB (RMI) from GF4. Created: 23/Apr/14  Updated: 23/Apr/14

Status: Open
Project: glassfish
Component/s: OSGi
Affects Version/s: 4.0
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: PashaTurok Assignee: Sanjeeb Sahoo
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Server:centos 6.4, 64, openjdk 7
Client:centos 6.4, 64, openjdk 7


Tags: ejb31, glassfish4, javaee, osgi, osgi-javaee

 Description   

I have server-client architecture. Server and client different machines in one local network. Both server and client are on osgi framework. For server it's hybrid EJB. There are three osgi bundles:for server,for client and shared. The copy of shared is both on server and on clients and contains LanguageDirBeanRemote and LanguageDirEntity. To get my bean I use the following code on osgi-client:

ClassLoader thatLoader = Thread.currentThread().getContextClassLoader();
Thread.currentThread().setContextClassLoader(getClass().getClassLoader());
try {
Properties jndiProps = new Properties();
jndiProps.put("java.naming.factory.initial", "com.sun.enterprise.naming.impl.SerialInitContextFactory");
jndiProps.put("java.naming.factory.url.pkgs", "com.sun.enterprise.naming");
jndiProps.put("java.naming.factory.state", "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl");
jndiProps.setProperty("org.omg.CORBA.ORBInitialHost", "x.x.x.x");
jndiProps.setProperty("org.omg.CORBA.ORBInitialPort", "3700");
InitialContext ctx = new InitialContext(jndiProps);
LanguageDirBeanRemote bean=(LanguageDirBeanRemote)ctx.lookup("java:global/...");
ArrayList<LanguageDirEntity> elements=bean.readDirectory();
System.out.println("HERE I GET THE ERROR:"+elements.get(0).getContent());
} finally {
Thread.currentThread().setContextClassLoader(thatLoader);
}

Here is the log:
java.lang.ClassCastException: com.test.cmn.shd.base.dir.language.LanguageDirEntity cannot be cast to com.test.cmn.shd.base.dir.language.LanguageDirEntity at com.test.cmn.dt.base.Activator.start(Activator.java:83) at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645) at org.apache.felix.framework.Felix.activateBundle(Felix.java:1977) at org.apache.felix.framework.Felix.startBundle(Felix.java:1895) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944) at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:931) at com.test.cmn.dt.loader.LoaderModel.startCoreModule(LoaderModel.java:149) at com.test.cmn.dt.loader.LoaderModel.access$100(LoaderModel.java:39) at com.test.cmn.dt.loader.LoaderModel$InstallAndStartModuleWorker.doInBackground(LoaderModel.java:79) at com.test.cmn.dt.loader.LoaderModel$InstallAndStartModuleWorker.doInBackground(LoaderModel.java:73) at javax.swing.SwingWorker$1.call(SwingWorker.java:296) at java.util.concurrent.FutureTask.run(FutureTask.java:262) at javax.swing.SwingWorker.run(SwingWorker.java:335) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) at java.lang.Thread.run(Thread.java:744)

The reason that I think it's the bug is that the following code works without any problems:
LanguageDirEntity[] elements=bean.readDirectoryAsArray();
We see, that using simple array, without ArrayList we get no errors. But when I try to use ArrayList or ArrayList<LanguageDirEntity> I get ClassCastException. I think the problem is somewhere in RMI when it loads classes.
This prblem I also described on stackoverflow. http://stackoverflow.com/questions/23174582/arraylist-classloader-issue-in-osgi-client-javaeeejb-server






[GLASSFISH-20990] getDecalredField("field").getAnnotations() return empty array Created: 19/Feb/14  Updated: 19/Feb/14  Resolved: 19/Feb/14

Status: Resolved
Project: glassfish
Component/s: classloader
Affects Version/s: 3.1.2.2, 4.0
Fix Version/s: None

Type: Bug Priority: Major
Reporter: winechess Assignee: Sanjeeb Sahoo
Resolution: Invalid Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu 13.04, GlassFish Server Open Source Edition 4.0 (build 89)


Tags: annotations, ejb, glassfish3, glassfish4

 Description   

Steps to reproduce (all projects are maven based, for usual projects result will be the same):

1. Create EJB project (Project1) with annotation @Test.
2. Create simple java project (Project2) and add Project1 as ejb dependency.
3. In Project2 create class Model and apply annotation @Test on it.
4. Create ear project (Project3) with ejb module Project3-ejb.
5. Add Project2 as a dependency to Project3-ejb.
6. Create timer in Project3-ejb and output TestModel.class.getAnnotations().length.
7. Clean, build and deploy Project3 to glassfish3 or 4.

Result: You will see 0 in server output
Expected result: 1

Note 1: if add Project1 as a jar dependency, in step 2, result will be 1.

Note 2: if deploy Project3 to jboss 7 or 8, result will be 1.



 Comments   
Comment by winechess [ 19/Feb/14 ]

Sorry, forgot to change title from "getDecalredField("field").getAnnotations() return empty array" to "Class.getAnnotations() return empty array"

Comment by Sanjeeb Sahoo [ 19/Feb/14 ]

I think you are making incorrect assumptions about class loading dependencies between various modules. Two ejb jars don't necessarily share the same class loader as per Java EE rules. Please refer to Java EE platform spec for more details.





[GLASSFISH-20909] Error (NPE) with WebSockets (GF4 in NB7.4) using Decoder for JSON object - removing decoder allows onMessage to Work Created: 27/Nov/13  Updated: 10/Dec/13  Resolved: 09/Dec/13

Status: Resolved
Project: glassfish
Component/s: web_socket
Affects Version/s: 4.0_b89_RC5
Fix Version/s: None

Type: Bug Priority: Major
Reporter: HecklerMark Assignee: Pavel Bucek
Resolution: Invalid Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 7, NB 7.4, GF 4.0b89.


Tags: decod, endpoint, glassfish4, websockets

 Description   

Ran into issue in normal project, so I created a "toy project" to isolate issue...but seeing the same results.

Created simple WebSockets app with @ServerEndpoint annotated class, Person (lastName, firstName), PersonEncoder, & PersonDecoder. App works fine without encoder/decoder designated in endpoint, but adding encoders= and decoders= to the @ServerEndpoint annotation causes an error on receipt of message:

SEVERE: java.lang.NullPointerException
at org.glassfish.tyrus.core.EndpointWrapper.findApplicableDecoders(EndpointWrapper.java:313)
at org.glassfish.tyrus.core.EndpointWrapper.onMessage(EndpointWrapper.java:495)
at org.glassfish.tyrus.server.TyrusEndpoint.onMessage(TyrusEndpoint.java:174)
at org.glassfish.tyrus.websockets.DefaultWebSocket.onMessage(DefaultWebSocket.java:156)
at org.glassfish.tyrus.websockets.frametypes.TextFrameType.respond(TextFrameType.java:66)
at org.glassfish.tyrus.websockets.DataFrame.respond(DataFrame.java:102)
at org.glassfish.tyrus.servlet.TyrusHttpUpgradeHandler.onDataAvailable(TyrusHttpUpgradeHandler.java:113)
at org.apache.catalina.connector.InputBuffer$ReadHandlerImpl.processDataAvailable(InputBuffer.java:488)
at org.apache.catalina.connector.InputBuffer$ReadHandlerImpl.onDataAvailable(InputBuffer.java:453)
at org.glassfish.grizzly.http.io.InputBuffer.append(InputBuffer.java:855)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:222)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
at java.lang.Thread.run(Thread.java:744)

I'm hoping this is something simple I'm overlooking, but if so, I'm consistently overlooking it.

Happy to upload the simple test project I created if it will help. To duplicate, I just let NB create a new webapp, added a Websocket Endpoint, & the Person and enc/decoder classes, filling in annotations & interfaces as simply as I could for testing. Please do email me for files and/or clarification, happy to fill in any details I may have inadvertently left out.



 Comments   
Comment by Pavel Bucek [ 27/Nov/13 ]

Hi,

can you please try with latest glassfish nightly build? Also test case would be nice (feel free to paste your endpoint and decoder here, I can do the rest).

Thanks!

Comment by Pavel Bucek [ 04/Dec/13 ]

ping

Comment by HecklerMark [ 04/Dec/13 ]

Hi Pavel,

Somehow I missed your replies, so sorry! I've looked for the nightly build, but apparently I'm looking in the wrong place, as the links I can locate only take it up to June 2013. Could you provide a link to more recent builds? Thanks!

Mark

P.S. - I'll post code shortly for you to verify with your configuration. Again, thanks!

Comment by HecklerMark [ 04/Dec/13 ]

I created a simple case to isolate the issue, yet it (still) doesn't seem happy - on my system, at least.

File 1 (PersonEndpoint.java):

package org.websocks;

import java.io.IOException;
import javax.websocket.EncodeException;
import javax.websocket.OnClose;
import javax.websocket.OnError;
import javax.websocket.OnMessage;
import javax.websocket.OnOpen;
import javax.websocket.Session;
import javax.websocket.server.ServerEndpoint;
import org.person.Person;

/**
 *
 * @author mheckler
 */
@ServerEndpoint(value="/endpoint", encoders={PersonEncoder.class}, decoders={PersonDecoder.class})
public class PersonEndpoint {

    @OnMessage
    public void onMessage(Person message, Session session) throws IOException, EncodeException {
        System.out.println("Received message: " + message.toString());
        
        // Echo the received message back to the client
        Person response = new Person();
        response.setLastName(message.getLastName());
        response.setFirstName(message.getFirstName());
        session.getBasicRemote().sendObject(response);
    }
    
    @OnClose
    public void onClose(Session session) {
        System.out.println("Closing websocket: " + session.getId());
    }

    @OnOpen
    public void onOpen(Session session) {
        System.out.println("Opening websocket: " + session.getId());
    }

    @OnError
    public void onError(Session session, Throwable t) {
        t.printStackTrace();
    }
    
}

File 2 (PersonDecoder.java):

package org.websocks;

import java.io.StringReader;
import javax.json.Json;
import javax.json.JsonObject;
import javax.websocket.DecodeException;
import javax.websocket.Decoder;
import javax.websocket.EndpointConfig;
import org.person.Person;

/**
 *
 * @author mheckler
 */
class PersonDecoder implements Decoder.Text<Person> {

    @Override
    public Person decode(String jsonMessage) throws DecodeException {
        System.out.println("PersonDecoder decode() method called.");
        JsonObject jsonObject = Json
            .createReader(new StringReader(jsonMessage)).readObject();
        Person person = new Person();
        person.setLastName(jsonObject.getString("lastName"));
        person.setFirstName(jsonObject.getString("firstName"));

        return person;
    }

    @Override
    public boolean willDecode(String jsonMessage) {
        System.out.println("PersonDecoder willDecode() method called.");
        try {
            // Check if incoming message is valid JSON
            Json.createReader(new StringReader(jsonMessage)).readObject();
            return true;
        } catch (Exception e) {
            return false;
        }
    }

    @Override
    public void init(EndpointConfig config) {
        System.out.println("PersonDecoder init() method called.");
    }

    @Override
    public void destroy() {
        System.out.println("PersonDecoder destroy() method called.");
    }
    
}
Comment by Pavel Bucek [ 04/Dec/13 ]

link to GF nightlies:

http://dlc.sun.com.edgesuite.net/glassfish/4.0.1/nightly/

(Thanks for the code, I will try to reproduce it tomorrow).

Comment by HecklerMark [ 06/Dec/13 ]

Hi Pavel,

I downloaded & ran the latest nightly build (Dec 5) and get the same results.

Please let me know what you find out from your end or if you need anything else from me to pinpoint further. Thanks so much!

Mark

Comment by Pavel Bucek [ 08/Dec/13 ]

can you post updated stack trace? I'm pretty sure that it is different from the original one.

Comment by Pavel Bucek [ 08/Dec/13 ]

just noticed - your decoder class (PersonDecoder) is not public? That definitely won't work..

Comment by Pavel Bucek [ 09/Dec/13 ]

I compared line numbers against Tyrus 1.0 tag and seems like my last comment is true. Your decoder is not public, so the instance cannot be created. Last version of Tyrus also prints out the exception which caused this (was fixed as part of different issue some time ago).

closing as invalid.

Comment by HecklerMark [ 09/Dec/13 ]

What the...???

I'm not sure when that happened, but - sorry about that.

Still seeing some oddness, but will isolate it and see where it leads. Thanks, Pavel.

Mark

Comment by Pavel Bucek [ 09/Dec/13 ]

no need to apologise The error message was far from being usable so it is/was a bug in some form.

Feel free to file another issue when you are done with your evaluation. You can use Tyrus issue tracker directly - it will be more visible for me that way. https://java.net/jira/browse/TYRUS

Comment by HecklerMark [ 10/Dec/13 ]

Thanks, Pavel (sheepish grin)...

I was also the "lucky recipient" of some malformed JSON coming in. Once we cleaned that up, everything seems to be operating as expected!

Thanks again for your help,
Mark





[GLASSFISH-20866] jmsra.upgrade_check_failed WARNING on Glassfish startup Created: 23/Oct/13  Updated: 23/Oct/13

Status: Open
Project: glassfish
Component/s: jms
Affects Version/s: 4.0
Fix Version/s: None

Type: Bug Priority: Trivial
Reporter: Andrew_Scully Assignee: David Zhao
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Glassfish 4.0 with embedded OpenMQ


Issue Links:
Duplicate
is duplicated by MQ-346 jmsra.upgrade_check_failed WARNING on... Closed
Tags: glassfish4, jms, log, mq, ra, startup, warning

 Description   

[Originally raised against MQ: https://java.net/jira/browse/MQ-346]

During startup, the following entry is written to the log...

2013-10-22 15:27:12,442 WARNING glassfish 4.0 javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.jms.util _ThreadID=15;_ThreadName=WrapperSimpleAppMain; jmsra.upgrade_check_failed

...despite this, all of the JMS functionality seems to work fine.

This post...

https://forums.oracle.com/thread/1520247

...appears to suggest that the WARN level is inappropriate.






[GLASSFISH-20822] org.glassfish.jersey.internal.util.Base64.encode(byte[]) method doesn't work properly - it throws ArrayIndexOutOfBoundsException Created: 24/Sep/13  Updated: 12/Jul/14

Status: Open
Project: glassfish
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Ruslan.Shchuchinov Assignee: michael.y.chen
Resolution: Unresolved Votes: 3
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Glassfish 4, JDK 1.7.0_40, Windows 7


Tags: base64, glassfish4

 Description   

An implementation of encode(byte[]) method is completely wrong.

89 public static byte[] encode(byte[] buffer) {
90 int ccount = buffer.length / 3;
91 int rest = buffer.length % 3;
92 byte[] result = new byte[(ccount + (rest > 0 ? 1 : 0)) * 4];
93
94 for (int i = 0; i < ccount; i++)

{ 95 result[i * 4] = CHAR_SET[(buffer[i * 3] >> 2) & 0xff]; 96 result[i * 4 + 1] = CHAR_SET[(((buffer[i * 3] & 0x03) << 4) | (buffer[i * 3 + 1] >> 4)) & 0xff]; 97 result[i * 4 + 2] = CHAR_SET[(((buffer[i * 3 + 1] & 0x0f) << 2) | (buffer[i * 3 + 2] >> 6)) & 0xff]; 98 result[i * 4 + 3] = CHAR_SET[buffer[i * 3 + 2] & 0x3f]; 99 }

100
101 int temp = 0;
102
103 if (rest > 0) {
104 if (rest == 2)

{ 105 result[ccount * 4 + 2] = CHAR_SET[((buffer[ccount * 3 + 1] & 0x0f) << 2) & 0xff]; 106 temp = buffer[ccount * 3 + 1] >> 4; 107 }

else

{ 108 result[ccount * 4 + 2] = CHAR_SET[CHAR_SET.length - 1]; 109 }

110 result[ccount * 4 + 3] = CHAR_SET[CHAR_SET.length - 1];
111 result[ccount * 4 + 1] = CHAR_SET[(((buffer[ccount * 3] & 0x03) << 4) | temp) & 0xff];
112 result[ccount * 4] = CHAR_SET[(buffer[ccount * 3] >> 2) & 0xff];
113 }
114
115 return result;
116 }

Line 95. The "CHAR_SET" array has 65 bytes length, thus the suitable bit mask for its indexes is "0x3F", not "0xFF".
Otherwise it will throw ArrayIndexOutOfBoundsException.
The smallest test that checks the bit masks is "Base64.encode(byte[]

{ 0xFF, 0xFF, 0xFF}

);" call.

I am not an expert in a bit-wise arithmetic, but I assume that lines 95-98 should be replaced with:
result[i * 4] = CHAR_SET[buffer[i * 3] >> 2 & 0b00111111];
result[i * 4 + 1] = CHAR_SET[buffer[i * 3] << 4 & 0b00110000 | buffer[i * 3 + 1] >> 4 & 0b00001111];
result[i * 4 + 2] = CHAR_SET[buffer[i * 3 + 1] << 2 & 0b00111100 | buffer[i * 3 + 2] >> 6 & 0b00000011];
result[i * 4 + 3] = CHAR_SET[buffer[i * 3 + 2] & 0b00111111];

The rest of the Base64.encode(byte[]) method (lines 105-112) also contains bugs, because it uses wrong bit masks - 0xFF.



 Comments   
Comment by hhund [ 12/Jul/14 ]

This issue is still present in jersey-common-2.10. And can be easily reproduced by executing:

import org.glassfish.jersey.internal.util.Base64;

public class Base64Test
{
public static void main(String[] args)

{ String string = Base64.encodeAsString("asdfö"); System.out.println(string); }

}

Please notice the German umlaut 'ö' in the encodeAsString Line.





[GLASSFISH-20794] GF4: Non-working injection of JAX-RS resoures into CDI interceptors Created: 04/Sep/13  Updated: 04/Apr/14

Status: Open
Project: glassfish
Component/s: jax-rs
Affects Version/s: 4.0_b89_RC5
Fix Version/s: None

Type: Bug Priority: Major
Reporter: replicant77 Assignee: Jakub Podlesak
Resolution: Unresolved Votes: 4
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Win 7 Pro 64Bit
GlassFish Server Open Source Edition 4.0 (build 89)
jdk1.7.0_21


Attachments: Zip Archive GLASSFISH-20794.zip    
Tags: cdi, glassfish4, interceptor, jax-rs, jersey

 Description   

We are currently evaluating glassfish 4 for migration of our enterprise projects from glassfish 3.1.2.2. We are making heavy use of interceptors for our jax-rs based rest services. In glassfish 3.1.2 injection of jax-rs based resources (e.g. @Context private HttpHeaders headers) into those interceptors worked fine. But with GF4 this doesn't work anymore.
Ways to reproduce:


@RequestScoped
@Path("test")
@Test
public class TestService {
@GET
@Produces(MediaType.TEXT_PLAIN)
public String greet()

{ return "Hello World"; }

}

@Test
@Interceptor
public class TestInterceptor {
@Context
private HttpHeaders headers;

@AroundInvoke
public Object intercept(InvocationContext ic) throws Exception

{ System.out.println("httpHeaders: " + headers); return ic.proceed(); }

}

@Inherited
@InterceptorBinding
@Target(

{ ElementType.METHOD, ElementType.TYPE }

)
@Retention(RetentionPolicy.RUNTIME)
public @interface Test {
}

beans.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/beans_1_0.xsd">
<interceptors>
<class>TestInterceptor</class>
</interceptors>
</beans>

On GF3.1.2 the output is something like:
INFO: httpHeaders: com.sun.jersey.spi.container.ContainerRequest@4e7cb67f

On GF4:
INFO: httpHeaders: null



 Comments   
Comment by obfischer [ 05/Sep/13 ]

Did you try to update to CDI 1.1? I also had CDI related issues when migrating my application to GF 4. It was needed to to update all beans.xml to CDI 1.1. At the end I ended with updating to GF 4.0.1-SNAPSHOT.

Comment by replicant77 [ 05/Sep/13 ]

I followed your advice and updated the beans.xml in the example (see below). But the problem stays the same: HttpHeaders stays null.


<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd"
version="1.1" bean-discovery-mode="all">
<interceptors>
<class>TestInterceptor</class>
</interceptors>
</beans>

Comment by replicant77 [ 05/Sep/13 ]

Note: i was still using 4.0_b89_RC5 for the updated beans.xml

Comment by TangYong [ 10/Sep/13 ]

I made an attachment based on the issue's description, and the issue can be re-produced using 4.0.1-b02.

[Steps]
1 mvn install
2 asadmin deploy ...
3 accessing "http://localhost:8080/glassfish-20794/webapi/test/"

You can see the following in server.log,
...
[2013-09-10T16:16:04.140+0900] [glassfish 4.0] [INFO] [] [javax.enterprise.system.tools.deployment.common] [tid: _ThreadID=54 _ThreadName=admin-listener(4)] [timeMillis: 1378797364140] [levelValue: 800] [[
visiting unvisited references]]

[2013-09-10T16:16:04.140+0900] [glassfish 4.0] [INFO] [] [javax.enterprise.system.tools.deployment.common] [tid: _ThreadID=54 _ThreadName=admin-listener(4)] [timeMillis: 1378797364140] [levelValue: 800] [[
visiting unvisited references]]

[2013-09-10T16:16:04.155+0900] [glassfish 4.0] [INFO] [] [javax.enterprise.system.tools.deployment.common] [tid: _ThreadID=54 _ThreadName=admin-listener(4)] [timeMillis: 1378797364155] [levelValue: 800] [[
visiting unvisited references]]

[2013-09-10T16:16:04.718+0900] [glassfish 4.0] [INFO] [] [org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer] [tid: _ThreadID=54 _ThreadName=admin-listener(4)] [timeMillis: 1378797364718] [levelValue: 800] [[
Registering the Jersey servlet application, named javax.ws.rs.core.Application, with the following root resource and provider classes: [class TestService]]]

[2013-09-10T16:16:04.968+0900] [glassfish 4.0] [INFO] [] [org.glassfish.jersey.server.ApplicationHandler] [tid: _ThreadID=54 _ThreadName=admin-listener(4)] [timeMillis: 1378797364968] [levelValue: 800] [[
Initiating Jersey application, version Jersey: 2.2 2013-08-14 08:51:58...]]

[2013-09-10T16:16:05.140+0900] [glassfish 4.0] [INFO] [AS-WEB-GLUE-00172] [javax.enterprise.web] [tid: _ThreadID=54 _ThreadName=admin-listener(4)] [timeMillis: 1378797365140] [levelValue: 800] [[
Loading application [glassfish-20794] at [/glassfish-20794]]]

[2013-09-10T16:16:05.155+0900] [glassfish 4.0] [INFO] [] [javax.enterprise.system.core] [tid: _ThreadID=54 _ThreadName=admin-listener(4)] [timeMillis: 1378797365155] [levelValue: 800] [[
glassfish-20794 was successfully deployed in 1,203 milliseconds.]]

[2013-09-10T16:16:26.749+0900] [glassfish 4.0] [INFO] [] [] [tid: _ThreadID=29 _ThreadName=Thread-7] [timeMillis: 1378797386749] [levelValue: 800] [[
httpHeaders: null]]
...

So,

1) pl. JJ firstly evaluates whether being a bug from CDI?
2) if not, forwarding to jax-rs comp to evaluate deeply.

Thanks
Tang

Comment by jjsnyder83 [ 10/Sep/13 ]

@Context is not an annotation processed by Weld nor the GF CDI integration. I looked at the call stack for when the interceptor is created and it is created by
org.jboss.weld.bean.ManagedBean#create

This create method calls the following code

T instance = getProducer().produce(creationalContext);

to create the interceptor and then

getProducer().inject(instance, creationalContext);

to do the injection. For this the getProducer() returns an instance of

org.glassfish.jersey.gf.cdi.CdiComponentProvider

I would expect this class to handle the injection of non-CDI annotations. I do not have this source code handy so I can't verify.

I think the Jersey folks should take a look and see if they're handling the @Context annotation correctly.

Comment by TangYong [ 10/Sep/13 ]

Thanks JJ's confirmation and forwards to JAX-RS Comp to evaluate deeply.

Comment by tcke83 [ 04/Apr/14 ]

Is there an easy work around to get the context? I have the same issue.





[GLASSFISH-20793] GF4 deployment error when having two web projects under one ear with equal managed bean names Created: 03/Sep/13  Updated: 06/Sep/13  Resolved: 06/Sep/13

Status: Resolved
Project: glassfish
Component/s: cdi
Affects Version/s: 4.0_b89_RC5
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: replicant77 Assignee: jjsnyder83
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Win 7 Pro 64Bit
GlassFish Server Open Source Edition 4.0 (build 89)
GlassFish 4.0.1 b04 09/03/2013
jdk1.7.0_21


Attachments: Zip Archive GLASSFISH-20793_demo.zip    
Tags: cdi, glassfish4, jsf, weld

 Description   

We are currently evaluating glassfish 4 for migration of our enterprise projects from glassfish 3.1.2.2. One problem we noticed is that now deployment fails with an ambiguity error message when having two web projects under one ear with equal managed bean names (see stacktrace below). In this case we created two simple jsf web projects contained in the same ear. Both wars contain a managed bean with same managed bean names ('greetingBean'). On GF3.x it works without problems.

@Named
@RequestScoped
public class GreetingBean {

public String getGreeting()

{ return "Hello from " + getClass().getName(); }

}

-------
org.glassfish.deployment.common.DeploymentException: CDI deployment failure:WELD-001414 Bean name is ambiguous. Name greetingBean resolves to beans [Managed Bean [class test.web2.GreetingBean] with qualifiers [@Default @Any @Named], Managed Bean [class test.web1.GreetingBean] with qualifiers [@Default @Any @Named]]
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:225)
at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:328)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:493)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001414 Bean name is ambiguous. Name greetingBean resolves to beans [Managed Bean [class test.web2.GreetingBean] with qualifiers [@Default @Any @Named], Managed Bean [class test.web1.GreetingBean] with qualifiers [@Default @Any @Named]]
at org.jboss.weld.bootstrap.Validator.validateBeanNames(Validator.java:639)
at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:488)
at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:536)
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:216)
... 36 more
-------



 Comments   
Comment by TangYong [ 03/Sep/13 ]

Component/s should be CDI.

Comment by Manfred Riem [ 03/Sep/13 ]

Reassigning to JJ as this looks like a CDI specific issue.

Comment by TangYong [ 03/Sep/13 ]

Change Component/s into CDI

Comment by TangYong [ 04/Sep/13 ]

I did a demo(attachment) to re-produce the issue.

PL. JJ confirms it.

Notice that the following,

1. Bean in different wars should be allowed to have the same EL name
https://issues.jboss.org/browse/CDI-188

2. Ambiguous name validation should not cross visibility boundaries
https://issues.jboss.org/browse/WELD-1065

From JBOSS Team's reply,
"
It is not portable to have multiple classes of the same name within the deployment. Weld currently does not support this..."

It seems that this issue is not still planned to be fix.

Thanks
Tang

Comment by TangYong [ 04/Sep/13 ]

New Confirmation is as following:

1. The issue can be re-produced using GlassFish 4.0.1 b04 09/03/2013

http://dlc.sun.com.edgesuite.net/glassfish/4.0.1/nightly/latest-glassfish.zip (b04 09/03/2013)

2. The issue does not happen using wildfly-8.0.0.Alpha4
"
15:01:23,451 INFO [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016002: Processing weld deployment eartwowars-ear.ear
15:01:23,498 INFO [org.hibernate.validator.internal.util.Version] (MSC service thread 1-1) HV000001: Hibernate Validator 5.0.1.Final
15:01:23,576 INFO [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016002: Processing weld deployment eartwowars-war1-1.0.0.war
15:01:23,576 INFO [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016002: Processing weld deployment eartwowars-war2-1.0.0.war
15:01:23,607 INFO [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016005: Starting Services for CDI deployment: eartwowars-ear.ear
15:01:23,638 INFO [org.jboss.weld.Version] (MSC service thread 1-2) WELD-000900 2.0.3 (Final)
15:01:23,732 INFO [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016008: Starting weld service for deployment eartwowars-ear.ear
15:01:24,513 INFO [org.wildfly.extension.undertow] (MSC service thread 1-4) JBAS018210: Register web context: /eartwowars-war1
15:01:24,513 INFO [org.wildfly.extension.undertow] (MSC service thread 1-3) JBAS018210: Register web context: /eartwowars-war2
15:01:24,670 INFO [org.jboss.as.server] (XNIO-1 task-3) JBAS018559: Deployed "eartwowars-ear.ear" (runtime-name : "eartwowars-ear.ear")"

3. GlassFish 4.0.1 b04 and wildfly-8.0.0.Alpha4 all uses weld-osgi-bundle 2.0.3.Final.

So, I can make an initial conclusion that maybe the issue is caused by GlassFish Weld Integration and I raised up Priority of the issue.

Comment by replicant77 [ 04/Sep/13 ]

Interesting to notice is that switching from cdi to jsf managed bean declarations resolves the issue. As we reference these beans in jsf pages, this is a better workaround for us than renaming the bean names.

@javax.faces.bean.ManagedBean
@javax.faces.bean.RequestScoped
//@javax.inject.Named
//@javax.enterprise.context.RequestScoped
public class GreetingBean {

public String getGreeting()

{ return "Hello from " + getClass().getName(); }

}

Comment by TangYong [ 04/Sep/13 ]

Java EE 7(or Higher) recommended using backing bean(using CDI concept) with JSF rather than ManagedBean. The ManagedBean has been outdated and although the workaround is valid for your current issue, It is hard to say that in the future, once GlassFish does not support ManagedBean, whether you will come back the scene again.

Backing to the issue, I am investigating it and this should belong to Bean visibility problem while building BDAs.

Thanks
Tang

Comment by TangYong [ 04/Sep/13 ]

JJ

The reason for the issue has been found as following,

For an ear with two wars, while deploying the ear, GlassFish Weld Integration created several Bean Managers corresponding to different BDAs. Among them, there is a Bean Manager liking AppBda_XXX-YYY which corresponds to the EAR BDA, and there are also two Bean Managers which correspond to the wars. The important point is that the EAR's Bean Manager's getAccessibleManagers() contains the wars's Bean Managers.

Then, while org.jboss.weld.bootstrap.Validator calls the following,

public void validateBeanNames(BeanManagerImpl beanManager) {
...
for (Bean<?> bean : beanManager.getAccessibleBeans())

{ ... }

getAccessibleBeans() will call org.jboss.weld.manager.BeanManagers.buildAccessibleClosure(...),

The buildAccessibleClosure(...) will obtain all contained Bean Managers related to current Bean Manager by using getAccessibleManagers().

So, war1 and war2's beans with the same name will be added Validator's "namedAccessibleBeans" as following,

for (Bean<?> bean : beanManager.getAccessibleBeans()) {
if (bean.getName() != null)

{ namedAccessibleBeans.put(bean.getName(), bean); }

}

And the exception happened.

Deeply, the issue should be related to Bean Manager's visibility. I think that we should not make war1 and war2's Bean Manager visible to EAR's Bean Manager.

Thanks
Tang

Comment by jjsnyder83 [ 04/Sep/13 ]

I also spoke with the JBoss guys and this should be valid. I will look at it shortly.

Comment by TangYong [ 05/Sep/13 ]

JJ

Fixing place has been confirmed as following,

Class: org.glassfish.weld.DeploymentImpl
Method: addAppBda()
Place to need to fix:
private void addAppBda() {
...
// make all bdas visible to the app Bda. But none have visibility to App Bda
for ( BeanDeploymentArchive oneBda : beanDeploymentArchives ) {
if ( ! oneBda.equals(appBda))

{ appBda.getBeanDeploymentArchives().add(oneBda); }

}
}

Whether can remove the above logic and make appBda not contain any child bda?

Thanks
Tang

Comment by TangYong [ 05/Sep/13 ]

I have made an fixing by removing the above logic, then , replaced the weld-integration bundle using self-built version on 4.0.1-b02. While deploying demo(attachment),

E:\NanjingJUG\glassfish-4.0.1-b02\glassfish4\glassfish\bin>asadmin deploy E:\NanjingJUG\GLASSFISH-20793\ear\target\eartwowars-ear.ear
Application deployed with name eartwowars-ear.
Command deploy executed successfully.

[server.log]
...
[2013-09-05T11:19:31.304+0900] [glassfish 4.0] [INFO] [AS-WEB-GLUE-00172] [javax.enterprise.web] [tid: _ThreadID=41 _ThreadName=admin-listener(2)] [timeMillis: 1378347571304] [levelValue: 800] [[
Loading application eartwowars-ear#eartwowars-war1-1.0.0.war at [/eartwowars-war1]]]

[2013-09-05T11:19:31.336+0900] [glassfish 4.0] [INFO] [AS-WEB-GLUE-00172] [javax.enterprise.web] [tid: _ThreadID=41 _ThreadName=admin-listener(2)] [timeMillis: 1378347571336] [levelValue: 800] [[
Loading application eartwowars-ear#eartwowars-war2-1.0.0.war at [/eartwowars-war2]]]

[2013-09-05T11:19:31.398+0900] [glassfish 4.0] [INFO] [] [javax.enterprise.system.core] [tid: _ThreadID=41 _ThreadName=admin-listener(2)] [timeMillis: 1378347571398] [levelValue: 800] [[
eartwowars-ear was successfully deployed in 4,171 milliseconds.]]

Pl. confirming the fix.

Thanks
Tang

Comment by jjsnyder83 [ 05/Sep/13 ]

I have been looking into the issue and tried the same change but it causes a tck failure. I have to remove the app bda completely and at the same time provide a fix for the tck failure. I should have something soon.

Comment by jjsnyder83 [ 05/Sep/13 ]

Ok, I have a fix that I will submit tomorrow.

Comment by jjsnyder83 [ 06/Sep/13 ]

Committed revision 62703





[GLASSFISH-20741] Unable to inject a managed bean into EJB Mobule Created: 05/Aug/13  Updated: 16/Apr/14  Resolved: 16/Apr/14

Status: Resolved
Project: glassfish
Component/s: cdi
Affects Version/s: 4.0_b89_RC5
Fix Version/s: None

Type: Bug Priority: Major
Reporter: krishnakodali Assignee: jjsnyder83
Resolution: Works as designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS: Mac OS x Mountain Loin and Server: Glassfish 4


Tags: CDI, glassfish4

 Description   

Application Server : Glassfish 4. I am not sure about the build.

I am trying to inject a bean from application client jar to EJB jar.

Application Server : Glassfish 4.0

created this class in EJB jar.

@Stateless
@LocalBean
@TransactionManagement(TransactionManagementType.CONTAINER)
public class TransactionAwareBean {

private Logger logger = Logger.getLogger("EJBBean");

@Resource(mappedName="jdbc/MySQLDataSource")
private DataSource datasource;

@Inject
@DbType
private DbUtil dbUtil;

}

Created a qualifier and the bean class in application client jar.

@Qualifier
@Retention(RUNTIME)
@Target(

{METHOD, PARAMETER, FIELD,TYPE}

)
public @interface DbType {

}

@Named
@DbType
public class DbUtil {

}

Finally created beans.xml in both jar's ...

But i am getting

[2013-07-28T23:27:44.238-0400] [glassfish 4.0] [SEVERE] [] [javax.enterprise.system.core] [tid: _ThreadID=36 _ThreadName=admin-listener(2)] [timeMillis: 1375068464238] [levelValue: 1000] [[
Exception while loading the app : CDI deployment failure:WELD-001408 Unsatisfied dependencies for type [DbUtil] with qualifiers [@DbType] at injection point [[BackedAnnotatedField] @DbType @Inject private com.ejb.transactions.TransactionAwareBean.dbUtil]
org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [DbUtil] with qualifiers [@DbType] at injection point [[BackedAnnotatedField] @DbType @Inject private com.ejb.transactions.TransactionAwareBean.dbUtil]
at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:403)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:325)
at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:177)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:208)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:519)
at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:505)
at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:480)
at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:536)
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:216)
at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:328)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:493)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:235)
at org.glassfish.admin.rest.utils.ResourceUtil.runCommand(ResourceUtil.java:257)
at org.glassfish.admin.rest.resources.TemplateListOfResource.createResource(TemplateListOfResource.java:134)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory$1.invoke(ResourceMethodInvocationHandlerFactory.java:81)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:125)
at org.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$ResponseOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:152)
at org.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:91)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:346)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:341)
at org.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:101)
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:224)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:271)
at org.glassfish.jersey.internal.Errors$1.call(Errors.java:267)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.process(Errors.java:267)
at org.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:317)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:198)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:946)
at org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:331)
at org.glassfish.admin.rest.adapter.RestAdapter$2.service(RestAdapter.java:318)
at org.glassfish.admin.rest.adapter.RestAdapter.service(RestAdapter.java:181)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
at java.lang.Thread.run(Thread.java:722)
]]



 Comments   
Comment by jjsnyder83 [ 16/Apr/14 ]

It appears that the client jar is not part of the application that is deployed to the server. That's why the exception is thrown because the bean in the client jar is not visible to the ejb when the ejb/application is deployed to the server.





[GLASSFISH-20732] java.lang.OutOfMemoryError: PermGen space error during re-deployment of EARs from IDE (Netbeans/Eclipse) Created: 30/Jul/13  Updated: 31/Aug/15

Status: Open
Project: glassfish
Component/s: None
Affects Version/s: 4.0_b89_RC5
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: nabizamani Assignee: michael.y.chen
Resolution: Unresolved Votes: 10
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Mac OS X, Glassfish 4 Build 89, Netbeans 7.3.1, Eclipse 4.3 (Kepler)


Tags: deployment, ear, glassfish4, outofmemory, permgen

 Description   

There seems to be a Memory Leak available in Glassfish 4 which becomes visible when you deploy ear files again and again. This error is also available in Glassfish 3. Working with ear projects does not make fun at all as long as the issue is not fixed. My productivity is during development is also decreased a lot!!!! Therefore I believe this issue is at least critical.

Please download the ear file from http://localhost:8080/download/tutorials/struts2/struts2-multi-module-demo.zip. It comes from my tutorial at http://www.nabisoft.com/tutorials/struts2/maven-struts-2-enterprise-application-based-on-java-ee-7-and-glassfish-4, so please check there for details about what you can find in the ear archive. Basically it is a Struts 2 project based on Java EE 7, Tiles, maven...

The bug can be reproduced in Eclipse and Netbeans, so I guess this is not an Eclipse nor a Netbeans issue. To reproduce the bug do the following in your Netbeans IDE (or Eclipse):

  1. Make sure to adapt the persistence.xml in the struts2-module-ejb module and make sure the corresponding JDBC resource is available on your Glassfish 4 (for details see the tutorial, which uses a PostgreSQL database).
  2. import the project into Netbeans
  3. deploy to your local Glassfish 4 server from within Netbeans and wait until deployment has finished
  4. go to MessageServiceBean.java (struts2-module-ejb module), change something (i.e. add an empty line somewhere)
  5. save the change to trigger a re-deployment
  6. wait until re-deployment has finished
  7. in your browser hit http://localhost:8080/service/message/ (I think this step helps to make the bug occur earlier than without this step)
  8. check the glassfish output in netbeans
  9. repeat steps 4-7 about 20-35 times (check glassfish output after each re-deployment).

I typically get this error after around 10-25 re-deployments. Please let me know if you can reproduce the issue, I am willing to help as much as I can!

Below you can see how the error looks like (by the way: after restarting Glassfish after the error the deployed application is not deployed anymore). Depending on when exactly theOutOfMemory error happens you will get a slightly different log or stack trace. In the past I have this error much faster with large ear projects, but my clients do not allow me to publish details...

EXAMPLE 1:

 
INFO: Loading application struts2-module-ear#struts2-module-service-1.0-SNAPSHOT.war at [/service]
WARNING: Unable to load class com.nabisoft.jaxrs.application.ApplicationConfig, reason: java.lang.ClassNotFoundException: com.nabisoft.jaxrs.application.ApplicationConfig
WARNING: Unable to load class com.nabisoft.jaxrs.application.ApplicationConfig, reason: java.lang.ClassNotFoundException: com.nabisoft.jaxrs.application.ApplicationConfig
WARNING: Unable to load class com.nabisoft.jaxrs.provider.MyJacksonJsonProvider, reason: java.lang.ClassNotFoundException: com.nabisoft.jaxrs.provider.MyJacksonJsonProvider
WARNING: Unable to load class com.nabisoft.tutorials.mavenstruts.service.MessageService, reason: java.lang.ClassNotFoundException: com.nabisoft.tutorials.mavenstruts.service.MessageService
WARNING: Unable to load class com.nabisoft.tutorials.mavenstruts.service.MessageService, reason: java.lang.ClassNotFoundException: com.nabisoft.tutorials.mavenstruts.service.MessageService
SEVERE: WebModule[/struts2-module-war]Exception starting filter struts2
java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at org.glassfish.web.loader.WebappClassLoader.findClass(WebappClassLoader.java:1183)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1728)
at org.glassfish.web.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1611)
at org.apache.struts2.dispatcher.ng.InitOperations.cleanup(InitOperations.java:114)
at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:69)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:131)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:5297)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5909)
at com.sun.enterprise.web.WebModule.start(WebModule.java:691)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1041)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:1024)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:747)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2278)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1924)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:139)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:537)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at org.glassfish.deployment.admin.ReDeployCommand.execute(ReDeployCommand.java:131)

WARNING: java.lang.OutOfMemoryError: PermGen space
java.lang.OutOfMemoryError: PermGen space
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2483)
at java.lang.Class.getConstructor0(Class.java:2793)
at java.lang.Class.newInstance(Class.java:345)
at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:399)
at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:396)
at java.security.AccessController.doPrivileged(Native Method)
at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:395)
at sun.reflect.MethodAccessorGenerator.generateSerializationConstructor(MethodAccessorGenerator.java:113)
at sun.reflect.ReflectionFactory.newConstructorForSerialization(ReflectionFactory.java:331)
at java.io.ObjectStreamClass.getSerializableConstructor(ObjectStreamClass.java:1376)
at java.io.ObjectStreamClass.access$1500(ObjectStreamClass.java:72)
at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:493)
at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:468)
at java.security.AccessController.doPrivileged(Native Method)
at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:468)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:365)
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:602)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1620)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1515)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
at org.apache.catalina.session.StandardManager.readSessions(StandardManager.java:550)
at com.sun.enterprise.web.WebModule.loadSessions(WebModule.java:1762)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2280)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1924)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:139)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)

SEVERE: Exception while invoking class com.sun.enterprise.web.WebApplication start method
java.lang.Exception: java.lang.OutOfMemoryError: PermGen space
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:168)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:537)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at org.glassfish.deployment.admin.ReDeployCommand.execute(ReDeployCommand.java:131)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
at java.lang.Thread.run(Thread.java:724)

SEVERE: Exception during lifecycle processing
java.lang.Exception: java.lang.OutOfMemoryError: PermGen space
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:168)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:537)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at org.glassfish.deployment.admin.ReDeployCommand.execute(ReDeployCommand.java:131)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
at java.lang.Thread.run(Thread.java:724)

SEVERE: Exception while loading the app
SEVERE: Ausnahme beim Deployment der Anwendung [struts2-module-ear]
SEVERE: Exception during lifecycle processing
java.lang.OutOfMemoryError: PermGen space
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2483)
at java.lang.Class.getConstructor0(Class.java:2793)
at java.lang.Class.newInstance(Class.java:345)
at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:399)
at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:396)
at java.security.AccessController.doPrivileged(Native Method)
at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:395)
at sun.reflect.MethodAccessorGenerator.generateSerializationConstructor(MethodAccessorGenerator.java:113)
at sun.reflect.ReflectionFactory.newConstructorForSerialization(ReflectionFactory.java:331)
at java.io.ObjectStreamClass.getSerializableConstructor(ObjectStreamClass.java:1376)
at java.io.ObjectStreamClass.access$1500(ObjectStreamClass.java:72)
at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:493)
at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:468)
at java.security.AccessController.doPrivileged(Native Method)
at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:468)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:365)
at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:602)
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1620)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1515)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1348)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
at org.apache.catalina.session.StandardManager.readSessions(StandardManager.java:550)
at com.sun.enterprise.web.WebModule.loadSessions(WebModule.java:1762)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2280)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1924)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:139)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)

SEVERE: PermGen space
 

EXAMPLE 2:

 
WARNING: PER01000: Got SQLException executing statement "CREATE TABLE MESSAGES (ID SERIAL NOT NULL, CREATEDON TIMESTAMP NOT NULL, MESSAGE VARCHAR(64) NOT NULL, PRIMARY KEY (ID))": org.postgresql.util.PSQLException: ERROR: relation "messages" already exists
INFO: EJB5181:Portable JNDI names for EJB MessageServiceBean: [java:global/struts2-module-ear/struts2-module-ejb/MessageServiceBean, java:global/struts2-module-ear/struts2-module-ejb/MessageServiceBean!com.nabisoft.tutorials.mavenstruts.ejb.MessageServiceBean]
INFO: EJB5181:Portable JNDI names for EJB MessageService: [java:global/struts2-module-ear/struts2-module-service-1.0-SNAPSHOT/MessageService, java:global/struts2-module-ear/struts2-module-service-1.0-SNAPSHOT/MessageService!com.nabisoft.tutorials.mavenstruts.service.MessageService]
WARNING: java.lang.OutOfMemoryError: PermGen space
java.lang.OutOfMemoryError: PermGen space
at sun.misc.Unsafe.defineClass(Native Method)
at sun.reflect.ClassDefiner.defineClass(ClassDefiner.java:63)
at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:399)
at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:396)
at java.security.AccessController.doPrivileged(Native Method)
at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:395)
at sun.reflect.MethodAccessorGenerator.generateConstructor(MethodAccessorGenerator.java:94)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:48)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
at java.lang.reflect.Proxy.newInstance(Proxy.java:748)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:739)
at org.glassfish.external.statistics.impl.CountStatisticImpl.<init>(CountStatisticImpl.java:55)
at org.glassfish.external.statistics.impl.CountStatisticImpl.<init>(CountStatisticImpl.java:69)
at org.glassfish.web.admin.monitor.ServletInstanceStatsProvider.<init>(ServletInstanceStatsProvider.java:78)
at org.glassfish.web.admin.monitor.WebStatsProviderBootstrap.registerApplicationStatsProviders(WebStatsProviderBootstrap.java:167)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2275)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1924)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:139)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:537)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at org.glassfish.deployment.admin.ReDeployCommand.execute(ReDeployCommand.java:131)

SEVERE: Exception while invoking class com.sun.enterprise.web.WebApplication start method
java.lang.Exception: java.lang.OutOfMemoryError: PermGen space
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:168)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:537)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at org.glassfish.deployment.admin.ReDeployCommand.execute(ReDeployCommand.java:131)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
at java.lang.Thread.run(Thread.java:724)

SEVERE: Exception during lifecycle processing
java.lang.Exception: java.lang.OutOfMemoryError: PermGen space
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:168)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:537)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at org.glassfish.deployment.admin.ReDeployCommand.execute(ReDeployCommand.java:131)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.v3.admin.AdminAdapter.doCommand(AdminAdapter.java:534)
at com.sun.enterprise.v3.admin.AdminAdapter.onMissingResource(AdminAdapter.java:224)
at org.glassfish.grizzly.http.server.StaticHttpHandler.service(StaticHttpHandler.java:297)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
at java.lang.Thread.run(Thread.java:724)

SEVERE: Exception while loading the app
SEVERE: Undeployment failed for context /service
SEVERE: Undeployment failed for context /struts2-module-war
SEVERE: Exception while loading the app : java.lang.OutOfMemoryError: PermGen space
 



 Comments   
Comment by nabizamani [ 30/Jul/13 ]

My fault, the correct url for downloading the ear file is http://www.nabisoft.com/download/tutorials/struts2/struts2-multi-module-demo.zip

Unfortunately, I have no permission to attach the ear file to this ticket and I have no permission to edit my previous post (for correcting the url...)

Comment by nabizamani [ 25/Nov/13 ]

Can anyone reproduce this issue? I would be happy to help you reproducing the issue.

ps
I did not add all the external references above which seem to be spam! Can someone please remove them??

Comment by mauritzlovgren [ 05/Dec/13 ]

Also seeing this issue when redeploying artifacts to Glassfish a few times.

Getting this during undeploy:

[2013-12-05T18:24:38.309+0100] [glassfish 4.0] [SEVERE] [] [javax.enterprise.web.util] The web application [/crm] created a ThreadLocal with key of type [org.glassfish.pfl.dynamic.codegen.impl.CurrentClassLoader$1] (value [org.glassfish.pfl.dynamic.codegen.impl.CurrentClassLoader$1@742a8d28]) and a value of type [org.glassfish.web.loader.WebappClassLoader] (value [WebappClassLoader (delegate=true; repositories=WEB-INF/classes/)]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

The amount of classes loaded in PermGen increases after each redeploy and never gets collected (even during Full GC), so seems there is a leak somewhere here.

We use PrimeFaces 4.0.4 on GlassFish 4.0 b89. The issue is present whether deployment is performed through IDE (Eclipse / IntelliJ / NetBeans) or through asadmin / admin GUI.

Comment by atrajano [ 31/Aug/15 ]

Also affects 4.1





[GLASSFISH-20638] Java EE 7 JMS definitions on GlassFish 4 are not created Created: 16/Jun/13  Updated: 20/Nov/14  Resolved: 17/Jun/13

Status: Resolved
Project: glassfish
Component/s: jms
Affects Version/s: 4.0_b89_RC5
Fix Version/s: None

Type: Bug Priority: Major
Reporter: biemond Assignee: David Zhao
Resolution: Invalid Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

mac osx


Tags: glassfish4, jms

 Description   

Hi,

this does not do anything , I had to create these jms artifacts manually in the admin console.

@JMSConnectionFactoryDefinition(
name = "MyConnectionFactory2",
maxPoolSize = 30,
minPoolSize = 20,
properties = {
"addressList=mq://localhost:7676",
"reconnectEnabled=true"
})
@JMSDestinationDefinition(
name = "DemoQueue2",
interfaceName = "javax.jms.Queue",
destinationName="DemoQueue2",
description="My Demo Queue")



 Comments   
Comment by David Zhao [ 17/Jun/13 ]

biemond,

Can you elaborate what do you mean 'this does not do anything'?

According to EE7 spec EE.5.18.5, the JMS Connection Factory and Destination resources may be defined in any of the JNDI namespaces described in Section EE.5.2.2, "Application Component Environment Namespaces".

for example, the name should be declared with namespaces:

java:comp
java:module
java:app
java:global

By default, if environment entries declared without namespace, those will be created in the java:comp/env namespace.

So if you have the following definition, you can look it up from JNDI by "java:comp/env/MyConnectionFactory2".

@JMSConnectionFactoryDefinition(
name = "MyConnectionFactory2",
maxPoolSize = 30,
minPoolSize = 20,
properties =

{ "addressList=mq://localhost:7676", "reconnectEnabled=true" }

)

BTW, please note that resources created by annotations will not show up in the admin console, they are only available in JNDI at runtime.

Comment by biemond [ 17/Jun/13 ]

Hi,

I resolved it. When you use this "MyConnectionFactory2" as name , you can't find it in the java:comp, java:module, java:app, java:global jndi tree

@JMSConnectionFactoryDefinition(
name = "MyConnectionFactory2",
maxPoolSize = 30,
minPoolSize = 20,
properties =

{ "addressList=mq://localhost:7676", "reconnectEnabled=true" }

)

So change it to

@JMSConnectionFactoryDefinition(
name = "java:global/jms/MyConnectionFactory2",
maxPoolSize = 30,
minPoolSize = 20,
properties =

{ "addressList=mq://localhost:7676", "reconnectEnabled=true" }

)

and do a lookup

@Inject
@JMSConnectionFactory("java:global/jms/MyConnectionFactory2")
JMSContext context

So keep them in sync ( definition and inject) and never use without java:global or java:app etc.

Thanks Edwin





[GLASSFISH-20637] Java EE 7 CDI issues on GlassFish 4 Created: 16/Jun/13  Updated: 11/May/15  Resolved: 11/May/15

Status: Closed
Project: glassfish
Component/s: cdi
Affects Version/s: 4.0_b89_RC5
Fix Version/s: None

Type: Bug Priority: Major
Reporter: biemond Assignee: phil.zampino
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

mac osx


Tags: 4_0_1-approved, cdi, glassfish4, jsf2_2

 Description   

Hi,

Got some CDI issues on the latest GlassFish version

First in JSF2.2 the flowDefinition of flows does not work , I needed to use the faces-config.xml and that works perfectly

my example
@Named("flow1")
public class Flow1 implements Serializable {

private static final long serialVersionUID = -1L;

@Produces @FlowDefinition
public Flow buildMyFlow(@FlowBuilderParameter FlowBuilder flowBuilder)

{ System.out.println("flowdef"); String flowId = "flow1"; flowBuilder.id("", flowId); flowBuilder.viewNode(flowId, "/flow1/" + flowId + ".xhtml").markAsStartNode(); return flowBuilder.getFlow(); }

}

Also in the websockets and do an inject of session bean and does not do anything , also listen to an CDI event inside does not work

@ServerEndpoint("/mywebsocket")
public class MyWebSocket implements Serializable {

@Inject
JmsSessionBean jmsBean;

public void onJMSMessage(@Observes @CDIJmsEvent Message msg) {
System.out.println("Got JMS Message at WebSocket!");
try {
for (Session s : sessions)

{ s.getBasicRemote().sendText("message from JMS: " + msg.getBody(String.class)); }

} catch (IOException | JMSException ex)

{ ex.printStackTrace(); }

}

Inside a managed bean Inject and the CDI events works perfectly



 Comments   
Comment by Darious3 [ 17/Jun/13 ]

Flow example with formatting:

@Named("flow1")
public class Flow1 implements Serializable {

    private static final long serialVersionUID = -1L;

    @Produces @FlowDefinition
    public Flow buildMyFlow(@FlowBuilderParameter FlowBuilder flowBuilder) { 
       
        String flowId = "flow1"; 
        flowBuilder.id("", flowId); 
        flowBuilder.viewNode(flowId, "/flow1/" + flowId + ".xhtml").markAsStartNode(); 

        return flowBuilder.getFlow();
    }
}

WebSocket with formatting

@ServerEndpoint("/mywebsocket")
public class MyWebSocket implements Serializable {

    @Inject
    JmsSessionBean jmsBean;

    public void onJMSMessage(@Observes @CDIJmsEvent Message msg) {
        try {
            for (Session session : sessions) {
                session.getBasicRemote().sendText("message from JMS: " + msg.getBody(String.class));
            }
        } catch (IOException | JMSException ex) {
            ex.printStackTrace();
        }
    }
}
Comment by jjsnyder83 [ 17/Jun/13 ]

I believe the WebSocket issue is a duplicte of : https://java.net/jira/browse/GLASSFISH-20371.

For the JSF issue can you provide more information on what the expected results are?

Comment by biemond [ 17/Jun/13 ]

Hi,

here is my netbeans projects on glassfish 4 https://github.com/biemond/JavaEE7

I defined some JSF 2.2 flows in
https://github.com/biemond/JavaEE7/tree/master/WebApp7EE/WebApp7EE-war/web/flow1

When I add this flow definition in the faces-config.xml it works fine
https://github.com/biemond/JavaEE7/blob/master/WebApp7EE/WebApp7EE-war/web/WEB-INF/faces-config.xml

but when I try to do the same in this class with the help of CDI
@Produces @FlowDefinition
public Flow defineFlow(@FlowBuilderParameter FlowBuilder flowBuilder)
in java class
https://github.com/biemond/JavaEE7/blob/master/WebApp7EE/WebApp7EE-war/src/java/nl/amis/web/flow/Flow1.java

It does not do anything ( don't see any CDI error ) and the page /flow1.xhtml can not be found.

Thanks

Comment by jjsnyder83 [ 20/Apr/15 ]

Is this still an issue?





[GLASSFISH-20576] Internal Server Error on JSON REST web service returning array Created: 23/May/13  Updated: 21/Dec/15

Status: Open
Project: glassfish
Component/s: jax-rs
Affects Version/s: 4.0_b89_RC5
Fix Version/s: 4.1.1

Type: Bug Priority: Major
Reporter: Peter Salomonsen Assignee: Marek Potociar
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

glassfish-4.0-b90-05_22_2013, jdk1.7


Tags: glassfish4, jersey, json, rest

 Description   

The following REST web service causes internal server error (and no stack trace in server.log). Returning an empty array works, but as soon as there are elements in the array - it does not.

@GET
@Produces("application/json")
public Object[] getArray() {
return new Object[]

{"Test"}

;
}



 Comments   
Comment by Marek Potociar [ 28/May/13 ]

Targeting for GF 4.0.1, Re-assigning to dev eng. for evaluation.

Comment by Michal Gajdos [ 11/Jun/13 ]

Which Json provider from Jersey are you using? Have you configured one? Thanks.

Comment by Peter Salomonsen [ 11/Jun/13 ]

I haven't configured anything - no web.xml at all. Just application config class like this:

@javax.ws.rs.ApplicationPath("webresources")
public class ApplicationConfig extends Application {

}

And the REST service class:

@Path("generic")
public class GenericResource {

@Context
private UriInfo context;

public GenericResource() {
}

@GET
@Produces("application/json")
public Object[] getArray() {
return new Object[]

{"Test"}

;
}
}

That's all.

Comment by Michal Gajdos [ 13/Jun/13 ]

The easiest way would be registering JacksonFeature (make sure you have jersey-media-json-jackson on your classpath) in your ApplicationConfig. Something like:

public Set<Class<?>> getClasses() {
    return new HashSet<Class<?>>() {{ add(GenericResource.class); add(JacksonFeature.class); }};
}
Comment by Peter Salomonsen [ 13/Jun/13 ]

org.glassfish.jersey.jackson.JacksonFeature works as you propose. MoxyJsonFeature gives the server error, and JettisonFeature says it cannot find a MessageBodyWriter. Is MoxyJsonFeature the default? Shouldn't this also be able to handle arrays?





[GLASSFISH-20534] @Inject not working within JAX-RS @Provider Created: 15/May/13  Updated: 19/Sep/14  Resolved: 14/Aug/13

Status: Resolved
Project: glassfish
Component/s: embedded
Affects Version/s: 4.0
Fix Version/s: 4.1

Type: Bug Priority: Major
Reporter: buddypine Assignee: Marek Potociar
Resolution: Invalid Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Glassfish embedded 4.0


Tags: embedded, glassfish4, jax-rs, jersey

 Description   

Using https://maven.java.net/content/groups/promoted/org/glassfish/main/extras/glassfish-embedded-all/4.0/
Injection of stateless EJB into JAX-RS @Provider fails, same EJB injected into regular servlet works fine within the same app.

@Stateless
public class AuthService {}

@Provider
public class HmacAuthFilter implements ContainerRequestFilter, ContainerResponseFilter {
@Inject
private AuthService authService;
...
}

monospaced
MultiException stack 1 of 3
org.glassfish.hk2.api.UnsatisfiedDependencyException: There was no object available for injection at Injectee(requiredType=AuthService,parent=HmacAuthFilter,qualifiers={}),position=-1,optional=false,self=false,unqualified=null,1462515663)
at org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:74)
at org.jvnet.hk2.internal.ClazzCreator.resolve(ClazzCreator.java:191)
at org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:214)
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:311)
at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:448)
at org.jvnet.hk2.internal.SingletonContext.findOrCreate(SingletonContext.java:118)
at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2204)
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)
at org.glassfish.jersey.internal.inject.Providers.getAllRankedProviders(Providers.java:234)
at org.glassfish.jersey.server.ApplicationHandler.getProcessingProviders(ApplicationHandler.java:568)
at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:393)
at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:157)
at org.glassfish.jersey.server.ApplicationHandler$3.run(ApplicationHandler.java:280)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:289)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:286)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:286)
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:277)
at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:262)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:167)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:349)
at javax.servlet.GenericServlet.init(GenericServlet.java:244)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1583)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:1225)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:237)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
at java.lang.Thread.run(Thread.java:722)
MultiException stack 2 of 3
java.lang.IllegalArgumentException: While attempting to resolve the dependencies of io.scrub.http.HmacAuthFilter errors were found
at org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:226)
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:311)
at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:448)
at org.jvnet.hk2.internal.SingletonContext.findOrCreate(SingletonContext.java:118)
at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2204)
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)
at org.glassfish.jersey.internal.inject.Providers.getAllRankedProviders(Providers.java:234)
at org.glassfish.jersey.server.ApplicationHandler.getProcessingProviders(ApplicationHandler.java:568)
at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:393)
at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:157)
at org.glassfish.jersey.server.ApplicationHandler$3.run(ApplicationHandler.java:280)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:289)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:286)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:286)
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:277)
at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:262)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:167)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:349)
at javax.servlet.GenericServlet.init(GenericServlet.java:244)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1583)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:1225)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:237)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
at java.lang.Thread.run(Thread.java:722)
MultiException stack 3 of 3
java.lang.IllegalStateException: Unable to perform operation: resolve on io.scrub.http.HmacAuthFilter
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:340)
at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:448)
at org.jvnet.hk2.internal.SingletonContext.findOrCreate(SingletonContext.java:118)
at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2204)
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)
at org.glassfish.jersey.internal.inject.Providers.getAllRankedProviders(Providers.java:234)
at org.glassfish.jersey.server.ApplicationHandler.getProcessingProviders(ApplicationHandler.java:568)
at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:393)
at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:157)
at org.glassfish.jersey.server.ApplicationHandler$3.run(ApplicationHandler.java:280)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:289)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:286)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:286)
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:277)
at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:262)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:167)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:349)
at javax.servlet.GenericServlet.init(GenericServlet.java:244)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1583)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:1225)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:237)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:160)
at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:99)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:174)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:357)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
at java.lang.Thread.run(Thread.java:722)
monospaced



 Comments   
Comment by Wasomumba [ 17/Jun/13 ]

This happens also in a "normal" (non-embedded) V4.0.1-b01 with @Singleton or @ApplicationScoped.

Comment by Marek Potociar [ 14/Aug/13 ]

JAX-RS 2.0 does not support injection of EJBs into JAX-RS components (providers, resources). As such, this is not a bug and I'm closing it as invalid. I have opened a RFE in Jersey to implement support for this instead: JERSEY-2040

At the moment, you can try to enable CDI and migrate your JAX-RS provider to a CDI-managed component. That way you may be able to get EJBs injected into the JAX-RS providers via CDI.





[GLASSFISH-20482] Unable to read from HttpServletRequest.getInputStream when there are session beans in the web app Created: 07/May/13  Updated: 08/May/13  Resolved: 08/May/13

Status: Closed
Project: glassfish
Component/s: None
Affects Version/s: 4.0_b87_RC3
Fix Version/s: None

Type: Bug Priority: Blocker
Reporter: Peter Salomonsen Assignee: Shing Wai Chan
Resolution: Works as designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Mac OSX, JDK 1.7.0_21, Glassfish 4.0_b88_2013-05-06


Tags: ejb, glassfish4, web

 Description   

Have tested with and without the patch from GLASSFISH-20449. Simple test case:

Servlet.processRequest:

System.out.println(request.getInputStream().available());

Client:

HttpURLConnection uc = (HttpURLConnection) new URL("http://localhost:8080/WebApplication3/NewServlet").openConnection();
uc.setDoOutput(true);

OutputStream os = uc.getOutputStream();
os.write("Test\r\n".getBytes());
os.flush();

What happens is that normally the servlet will print 6 to the console - but if you add an EJB session bean to the app it prints 0. Trying to read from the servlet input stream causes EOFException.

GLASSFISH-20449 is about taglibs and session beans, and this seems similar - however the patch I tried for the taglib bug did not fix this problem.



 Comments   
Comment by Shing Wai Chan [ 07/May/13 ]

I do not see the above code in the test case for GLASSFISH-20449. Can you attach a test case here?

Comment by Peter Salomonsen [ 07/May/13 ]

I've sent a netbeans test case project to your email. The test case project contains a main class ServletClientMain that you should run after deploying the web app. This will create an URLConnection to the servlet and write some bytes to it. In return the server will respond the number of bytes in the input stream - and you will see that this is zero when the session bean is present and 8 if you remove the stateless annotation of the session bean (SessionBean.java).

Comment by Shing Wai Chan [ 08/May/13 ]

In order to consume the data in server side, one should use POST. We should add the following line in ServletClientMain.java:

    uc.setRequestMethod("POST");

In my local environment, I notice that the value of #available is 0, independent of presence of EJBs. And in another environment, we get the correct value. The reason is that HttpURLConnection sends the headers and payload in two chunk which may arrives with latency. If the payload is delay (or the server is fast enough) while IO layer process the data, then we get a zero payload in this case.

In JDK 7 javadoc of InputStream#available, we have:

Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next invocation of a method for this input stream. The next invocation might be the same thread or another thread. A single read or skip of this many bytes will not block, but may read or skip fewer bytes.

Note that while some implementations of InputStream will return the total number of bytes in the stream, many will not. It is never correct to use the return value of this method to allocate a buffer intended to hold all data in this stream.

Since this is an estimate value, it is not a bug.

Comment by Peter Salomonsen [ 08/May/13 ]

I see that I probably misguided you when using .available() in the test case. You're right when you say this is an estimate, and the test case proves no bug in itself.

But the original cause for reporting this wasn't that available() showed zero in the presence of session beans - it was that I was not able to read from the input stream at all. I've modified my testcase to show this - I've added "POST" as you said (which I also had in my original app where I first discovered this) - and the servlet now tries to read from the stream.

You see that in the presence of the session bean, there is no data to read from the stream - while when removing it - you can read the text submitted from the client.

Sorry for the confusion I made here - and I hope that you can reopen the issue so that I don't have to post it again. (I've sent you the updated test case by email)

Comment by Shing Wai Chan [ 08/May/13 ]

There is an issue in the given test case.
In ServletClientMain.java, the content-type is not specified. In this case, the HttpURLConnection will have a default content-type: Content-type: application/x-www-form-urlencoded.
In this case, the payload is read as parameter. Hence, there will be no data to read through request.getInputStream().read().

But if we specify a content-type in ServletClientMain.java as follows:

uc.setRequestProperty("Content-type", "text/plain; charset=utf-8");

Then you can read the data as expected.
So, this is a test case issue.

Comment by Peter Salomonsen [ 08/May/13 ]

OK I see this now - it has never been a requirement in earlier versions - so I thought it was a bug. Thanks for clarifying the issue.





[GLASSFISH-20479] JPA 2.1: select where mystr<>'' also returns zero-length strings Created: 06/May/13  Updated: 09/May/13  Resolved: 09/May/13

Status: Resolved
Project: glassfish
Component/s: entity-persistence
Affects Version/s: 4.0_b87_RC3
Fix Version/s: 4.0_b88_RC4

Type: Bug Priority: Critical
Reporter: Peter Salomonsen Assignee: Mitesh Meswani
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

JDK 1.7.0_21, Glassfish 4.0_b88 (2013-05-05), JavaDB or MySQL


Tags: glassfish4, jpa, persistence

 Description   

Creating a JPA query searching for strings that are not empty - example:

select e from NewEntity e where e.name<>''

This also returns the empty strings where e.name = '' which is incorrect. This does not happen with earlier JPA/Eclipselink versions.

I can provide a test case if necessary.



 Comments   
Comment by Peter Salomonsen [ 07/May/13 ]

Simple test case:

EntityManager em = Persistence.createEntityManagerFactory("JPA21testPU").createEntityManager();
em.getTransaction().begin();
NewEntity ent = new NewEntity();
ent.setName("Test");
em.persist(ent);
ent = new NewEntity();
ent.setName("");
em.persist(ent);
em.getTransaction().commit();
List<NewEntity> neList = em.createQuery("select e from NewEntity e where e.name<>''").getResultList();
if(neList.size()!=1)

{ System.out.println("BUG: Should only return one entity - but returned: "+neList.size()); }

for(NewEntity ne : neList)

{ System.out.println(ne.toString()+" name = '"+ne.getName()+"'"); }

em.close();

Comment by Mitesh Meswani [ 09/May/13 ]

Fixed with integration of EclipseLink 2.5.0-RC2





Generated at Tue Jun 28 20:10:11 UTC 2016 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.