[GLASSFISH-21352] asadmin set-web-env-entry has no effect on the appliaction Created: 17/Apr/15  Updated: 17/Apr/15

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

Type: Bug Priority: Major
Reporter: xerx593 Assignee: Joe Di Pol
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Win8 (x64) , (Oracle-)JDK 1.8.0_45, GlassFish Server Open Source Edition 4.1 (build 13)



 Description   

After successful execution of "set-web-env-entry" and validation via "list-web-env-entry", this EJB code still consumes/delivers the orignal (web.xml) value:

final InitialContext context = new InitialContext();
final Context env = (Context) context.lookup("java:comp/env");
System.out.println("MSG: " + env.lookup("aMessage"));

..this brings also no improvement:

@Ressource(name="aMessage")
String aMessage;
...
System.out.println("MSG: " + aMessage);

This is the original post from SO, please show us the correct solution... or confirm/fix the bug.






[GLASSFISH-21347] Undeploy shows successful messages, but application is still as deployed Created: 10/Apr/15  Updated: 17/Apr/15

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

Type: Bug Priority: Major
Reporter: LeoInside Assignee: Hong Zhang
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Solaris 10 x86
GlassFish Server Open Source Edition 3.1.2.2 (build 5)



 Description   

The application is still shown after asadmin undeploy run successfully:

#/opt/glassfish3/glassfish/bin/asadmin --port 50500 --user admin --host masterservice undeploy pss
Enter admin password for user "admin">
Command undeploy executed successfully.

  1. /opt/glassfish3/glassfish/bin/asadmin --port 50500 --user admin --host masterservice list-applications
    Enter admin password for user "admin">
    RestCM-ear-1.1.1 <ear, ejb, web>
    SoapAuthorityService <ear, ejb>
    SoapNotificationIRP <ear, ejb, webservices>
    SoapBulkCMIRP <ear, ejb, webservices>
    SoapBasicCMIRP <ear, ejb, webservices>
    pms_compApplication <ejb, webservices>
    nms_shm <ear, ejb, web, connector>
    pmTrace_WebServices <ejb, webservices>
    pss <ear, web, ejb>
    com.ericsson.oss.common.alarm.manager.webapp <web>
    Command list-applications executed successfully.

===================================================
However, the application directory has been removed by the command from "./domains/domain1/applications" and "./domains/domain1/applications/__internal" directories..



 Comments   
Comment by enoefay [ 17/Apr/15 ]

Hi Hong,

Is there any update on this issue ..? What's the latest analysis ..?

Kind Regards,
Noel





[GLASSFISH-21350] Glassfish 4.1 won't start on OS X 10.10.3 Created: 17/Apr/15  Updated: 17/Apr/15

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

Type: Bug Priority: Blocker
Reporter: hadrabap Assignee: Chris Kasso
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Mac OS X 10.10.3



 Description   

After upgrade to 10.10.3 and applying all security updates and patches, Glassfish won't start:

Petrs-MacBook-Pro:bin petr$ ./asadmin start-domain domain1 
JVM failed to start: com.sun.enterprise.admin.launcher.GFLauncherException: The server exited prematurely with exit code 1.
Before it died, it produced the following output:


Command start-domain failed.

When running in verbose mode everything works just fine:

./asadmin start-domain --verbose domain1

Everything works just fine except JMX connector which is unable to bind to my "public" IP address hence JMX does not work at all. The workaround is to set JMX connector to listen just on localhost instead of on all interfaces (0.0.0.0).

What's the difference between starting domain in normal and verbose way?

Related issues:

An attempt to start Glassfish from NetBeans leads to JVM crash dump.



 Comments   
Comment by hadrabap [ 17/Apr/15 ]

I've found that the problem seems to be in the usage of launchctl bsexec which requires root privileges. When I change that to nohup everything works fine. I made a patch which is against https://svn.java.net/svn/glassfish~svn/trunk/main/ revision 63845 and is located at https://java.net/attachments/lists/glassfish/users/2015-04/13/GFLauncher.patch.





[GLASSFISH-21351] Memory leak when injecting Instance<T> Created: 17/Apr/15  Updated: 17/Apr/15

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

Type: Bug Priority: Major
Reporter: baztian Assignee: jjsnyder83
Resolution: Unresolved Votes: 0
Labels: memory-leak
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Injecting a Instance<T> causes a memory leak.

I'm having a few "MeasurementCollectors" in my code. Via a EJB Timer I'm iterating over all of them every second.

@Inject
private Instance<MeasurementCollector> dataCollectors;
...
for (MeasurementCollector collector : dataCollectors) {
    collectMeasure(collector, snapshot);
}

After a couple of minutes I'm getting an OutOfMemory Error.

Analysing the heap dump in MAT gives me the following "Problem Suspect"

One instance of "org.jboss.weld.context.CreationalContextImpl" loaded by "org.apache.felix.framework.BundleWiringImpl$BundleClassLoaderJava5 @ 0xe1bdbc08" occupies 352.836.128 (85,94%) bytes. The memory is accumulated in one instance of "java.lang.Object[]" loaded by "<system class loader>".

Keywords
java.lang.Object[]
org.jboss.weld.context.CreationalContextImpl
org.apache.felix.framework.BundleWiringImpl$BundleClassLoaderJava5 @ 0xe1bdbc08

I've found this issue that seems to match my problem. But it is marked as fixed long ago. Looks like a regression.

Glassfish 4.0 does not suffer from this problem!

My current work around is directly inject the beans and avoid Instance<T>. In my case I need to specify a @Inject for every MeasurementCollector I have.

Unfortunately I didn't manage to set up a minimalistic example yet. I will attach my attempt to this issue.



 Comments   
Comment by baztian [ 17/Apr/15 ]

Unfortunately I can't attach files. Anyway here is the code that unfortunately does not reproduce the problem yet:


package leak;

import java.util.logging.Level;
import java.util.logging.Logger;

import javax.ejb.Schedule;
import javax.ejb.Singleton;
import javax.ejb.Startup;
import javax.enterprise.inject.Instance;
import javax.inject.Inject;

@Startup
@Singleton
public class Scheduler {

    private static final Logger logger = Logger.getLogger(Scheduler.class.getName());

    @Inject
    Instance<MyInstance> myInstances;


    @Schedule (second = "*/1", minute = "*", hour = "*", persistent = false)
    public void doItForAllInstances() {
        for (MyInstance myInstance : myInstances) {
            logger.log(Level.INFO, "doIt for instance {0}", myInstance);
            myInstance.doIt();
        }
    }
}

package leak;

public interface MyInstance {

    public void doIt();
}

package leak;

public class MyInstanceImplOne implements MyInstance {

    private final byte[] oneMegabyte = new byte[1024 * 1024];


    @Override
    public void doIt() {
        // do nothing.
    }

}
beans.xml
<?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"
       bean-discovery-mode="all">
</beans>
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>leak</groupId>
    <artifactId>weld-instance-leak</artifactId>
    <version>leak-SNAPSHOT</version>
    <packaging>war</packaging>
    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <properties>
        <maven.compiler.source>1.7</maven.compiler.source>
        <maven.compiler.target>1.7</maven.compiler.target>
        <failOnMissingWebXml>false</failOnMissingWebXml>
    </properties>
</project>




[GLASSFISH-12942] Mac: restart fails for instance started with start-instance Created: 10/Aug/10  Updated: 17/Apr/15  Resolved: 29/Oct/10

Status: Resolved
Project: glassfish
Component/s: admin
Affects Version/s: 3.1
Fix Version/s: 3.1_ms07

Type: Bug Priority: Major
Reporter: easarina Assignee: Joe Di Pol
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: Mac System 9.0
Platform: Sun


Issue Links:
Related
is related to GLASSFISH-21349 GlassFish 4 does not start on OS X 10... Open
is related to GLASSFISH-21113 GlassFish 4 does not start on OS X 10.10 Resolved
Issuezilla Id: 12,942

 Description   

Build 15 08/10. Mac: Darwin asqe-xserver-1.sfbay.sun.com 9.8.0 Darwin Kernel
Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.4~1/RELEASE_I386 i386

Executed from DAS machine against a remote machine such commands:

asadmin create-node-ssh --nodehost asqe-xserver-2.sfbay.sun.com
asqe-xserver-2.sfbay.sun.com

Command create-node-ssh executed successfully.

sadmin create-instance --node asqe-xserver-2.sfbay.sun.com in3
Port Assignments for server instance in3: 
JMX_SYSTEM_CONNECTOR_PORT=28688
JMS_PROVIDER_PORT=27678
ASADMIN_LISTENER_PORT=24850
HTTP_LISTENER_PORT=28082
IIOP_LISTENER_PORT=23702
IIOP_SSL_LISTENER_PORT=23822
HTTP_SSL_LISTENER_PORT=28183
IIOP_SSL_MUTUALAUTH_PORT=23922

Command create-instance executed successfully

asadmin start-instance in3

Command start-instance executed successfully.

asadmin restart-instance in3
The instance, in3, was restarted.  !!!! 
Waiting for Instance Status Implementation -- There is no way of knowing for
sure yet.  Dont file bugs until after August 16 2010 !!!trying to

Command restart-instance executed successfully.

But really the instance was not started, see messages from server.log bellow.
But if the same instance stop/start several times, it would be restarted
successfully. But, I've reproduced this issue many times, never would be
restarted after first start. I did not see this issue on Linux and Solaris.

==========================================================

[#|2010-08-10T11:53:06.381-0700|INFO|glassfish3.1|javax.enterprise.system.tools.admin.com.sun.enterprise.v3.admin.cluster|_ThreadID=15;_ThreadName=Thread-1;|Server
restart initiated|#]

[#|2010-08-10T11:53:06.485-0700|INFO|glassfish3.1|org.jvnet.hk2.osgiadapter|_ThreadID=15;_ThreadName=Thread-1;|Stopping
com.sun.enterprise.v3.server.AppServerStartup@2a7d2796|#]

[#|2010-08-10T11:53:15.934-0700|INFO|glassfish3.1|javax.enterprise.system.tools.admin.org.glassfish.server|_ThreadID=15;_ThreadName=Thread-1;|JMXStartupService:
Stopped JMXConnectorServer:
service:jmx:rmi://asqe-xserver-2.SFBay.Sun.COM:28688/jndi/rmi://asqe-xserver-2.SFBay.Sun.COM:28688/jmxrmi|#]

[#|2010-08-10T11:53:15.937-0700|INFO|glassfish3.1|javax.enterprise.system.tools.admin.org.glassfish.server|_ThreadID=15;_ThreadName=Thread-1;|JMXStartupService
and JMXConnectors have been shut down.|#]

[#|2010-08-10T11:53:15.937-0700|INFO|glassfish3.1|javax.enterprise.system.core.com.sun.enterprise.v3.server|_ThreadID=15;_ThreadName=Thread-1;|Shutdown
procedure finished|#]



 Comments   
Comment by Byron Nevins [ 10/Aug/10 ]

I have no access to a MAc. Can you assign to someone that does? Or get me a Mac?

Comment by Byron Nevins [ 28/Sep/10 ]

I have no Mac. Reassign to Tom for distribution to a Mac owner.

Comment by Joe Di Pol [ 08/Oct/10 ]

I have reproduced this. My setup:

DAS running on Solaris. Instance running on Mac.

If the instance on the Mac is started by running the start-instance remote
command, then running the restart-instance remote command will bring the
instance down instead of restarting it.

If the instance on the Mac is started by running start-local-instance directly
on the Mac, then running restart-instance via the DAS works as expected.

This works fine for instances on Linux or Solaris, so the problem does appear to
be unique to the Mac.

Running start-instance/stop-instance/start-instance/stop-instance works fine.
It's just restart that is having trouble.

Comment by Joe Di Pol [ 08/Oct/10 ]

Latest update: in the failed case the instance is getting to JavaClassRunner
which creates a command line that looks valid (and I have verified it works when
run manually on the command line):

"/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java" "-cp"
"/Users/dipol/glassfish3/glassfish/modules/admin-cli.jar" "-DAS_RESTART=true"
"com.sun.enterprise.admin.cli.AsadminMain" "--host" "sidewinder" "--port" "4848"
"--secure=false" "--terse=false" "--echo=false" "--interactive=false"
"start-local-instance" "--verbose=false" "--debug=true" "--nosync=false"
"--node" "n1" "i1"

This is then handed off to ProcessBuilder:

        ProcessBuilder pb = new ProcessBuilder(cmdline);
        Process p = pb.start();

But after the pb.start() the exit status in Process is "1". So it appears as
though the command is executing but then encountering and error. Next step is to
capture the stderr/out from the command and see if there is anything useful.

Comment by Joe Di Pol [ 11/Oct/10 ]

The newly (re)started instance is getting an UnkownHostException when it
attempts to synchronize with the DAS. For some reason the restarted instance
can't resolve the DAS hostname – which it had no problem resolving at instance
startup (and an UnknownHostException during synchronization will cause an
instance to not start up). Here is the exception stack trace:

Got exception: org.glassfish.api.admin.CommandException: No remote server named
sidewinder. Is that the correct host name?
com.sun.enterprise.admin.remote.RemoteAdminCommand.doHttpCommand(RemoteAdminCommand.java:621)
com.sun.enterprise.admin.remote.RemoteAdminCommand.fetchCommandModel(RemoteAdminCommand.java:853)
com.sun.enterprise.admin.remote.RemoteAdminCommand.getCommandModel(RemoteAdminCommand.java:259)
com.sun.enterprise.admin.cli.remote.RemoteCommand.prepare(RemoteCommand.java:295)
com.sun.enterprise.admin.cli.CLICommand.execute(CLICommand.java:240)
com.sun.enterprise.admin.cli.remote.RemoteCommand.executeAndReturnOutput(RemoteCommand.java:383)
com.sun.enterprise.admin.cli.cluster.SynchronizeInstanceCommand.synchronizeFiles(SynchronizeInstanceCommand.java:302)
com.sun.enterprise.admin.cli.cluster.SynchronizeInstanceCommand.synchronizeInstance(SynchronizeInstanceCommand.java:147)
com.sun.enterprise.admin.cli.cluster.StartLocalInstanceCommand.executeCommand(StartLocalInstanceCommand.java:124)
com.sun.enterprise.admin.cli.CLICommand.execute(CLICommand.java:262)
com.sun.enterprise.admin.cli.AsadminMain.executeCommand(AsadminMain.java:284)
com.sun.enterprise.admin.cli.AsadminMain.main(AsadminMain.java:223)

cause: java.net.UnknownHostException: sidewinder
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:432)
java.net.Socket.connect(Socket.java:529)
java.net.Socket.connect(Socket.java:478)
sun.net.NetworkClient.doConnect(NetworkClient.java:163)
sun.net.www.http.HttpClient.openServer(HttpClient.java:394)
sun.net.www.http.HttpClient.openServer(HttpClient.java:529)
sun.net.www.http.HttpClient.<init>(HttpClient.java:233)
sun.net.www.http.HttpClient.New(HttpClient.java:306)
sun.net.www.http.HttpClient.New(HttpClient.java:323)
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:860)
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:801)
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:726)
com.sun.enterprise.admin.remote.RemoteAdminCommand$2.doCommand(RemoteAdminCommand.java:859)
com.sun.enterprise.admin.remote.RemoteAdminCommand.doHttpCommand(RemoteAdminCommand.java:556)
com.sun.enterprise.admin.remote.RemoteAdminCommand.fetchCommandModel(RemoteAdminCommand.java:853)
com.sun.enterprise.admin.remote.RemoteAdminCommand.getCommandModel(RemoteAdminCommand.java:259)
com.sun.enterprise.admin.cli.remote.RemoteCommand.prepare(RemoteCommand.java:295)
com.sun.enterprise.admin.cli.CLICommand.execute(CLICommand.java:240)
com.sun.enterprise.admin.cli.remote.RemoteCommand.executeAndReturnOutput(RemoteCommand.java:383)
com.sun.enterprise.admin.cli.cluster.SynchronizeInstanceCommand.synchronizeFiles(SynchronizeInstanceCommand.java:302)
com.sun.enterprise.admin.cli.cluster.SynchronizeInstanceCommand.synchronizeInstance(SynchronizeInstanceCommand.java:147)
com.sun.enterprise.admin.cli.cluster.StartLocalInstanceCommand.executeCommand(StartLocalInstanceCommand.java:124)
com.sun.enterprise.admin.cli.CLICommand.execute(CLICommand.java:262)
com.sun.enterprise.admin.cli.AsadminMain.executeCommand(AsadminMain.java:284)
com.sun.enterprise.admin.cli.AsadminMain.main(AsadminMain.java:223)

Comment by Joe Di Pol [ 21/Oct/10 ]

I've verified that the restarted instance in the failure case gets an
UnknownHostException when doing:

addr = InetAddress.getByName(host);

I then compared the system properties between the failing case (instance started
via start-instance over SSH, then restarted) and the working case (instance
started locally via start-local-instance, then restarted). There are some
differences, and the one that jumps out is that in the failing case the
user.name property is set to "?".

diff working.systemprops failing.systemprops
3c3
< WALL_CLOCK_START:1287703107052
---
> WALL_CLOCK_START:1287702744900
11d10
< ftp.nonProxyHosts:local|*.local|169.254/16|*.169.254/16
13d11
< http.nonProxyHosts:local|*.local|169.254/16|*.169.254/16
21c19
< java.io.tmpdir:/var/folders/2K/2KLZjdblGxKJ03qWNa3H6E++41E/-Tmp-/
---
> java.io.tmpdir:/tmp
47d44
< socksNonProxyHosts:local|*.local|169.254/16|*.169.254/16
58c55
< user.country:US
---
> user.country:
62c59
< user.name:dipol
---
> user.name:?
Comment by Joe Di Pol [ 22/Oct/10 ]

Observations from today's investigation:

o If you ssh to the Mac and run start-local-instance, and stay logged in over
SSH then all is well. You can restart the instance multiple times. But as soon
as you log out of SSH, then the restarted instance fails to look up the DAS
hostname as described in this bug.

o I reproduced the problem with a smaller program that invokes itself in the
same way that GlassFish does. I compared the environment (System.getenv()) of a
"good" JVM and a "bad" JVM (when the hostname lookup fails) and saw no
significant differences.

o I looked in the JDK source to see on unix how the JDK determines the user.name
property since this shows up as "?" in the failing case. On Unix it calls
getpwuid(getuid()), and if this returns null then it sets it to "?". So in the
failing case the JVM process has trouble looking up users.

o On the Mac if I add an entry for "dipol" to /etc/passwd then the failing case
correctly sets the user.name property, but it still can't find the host. Adding
the host to /etc/hosts did not help.

o On the Mac user and host lookup are handled by the DirectoryService daemon, so
I turned on Debug for the DirectoryService daemon. In the failing case it looks
like the DirectoryService is never getting called. I see lots of traffic when
the instance is first started, but nothing when it is restarted.

So it looks like, for some reason the restarted instance that fails can't
contact the Mac's DirectoryService to look up things like users and hosts.
Next step is to try to find some system log files that may give an indication
of what error is occurring.

Comment by Joe Di Pol [ 25/Oct/10 ]

I've reproduced the problem running this shell script (see below). This seems to
confirm that a child process that is created after the ssh connection is closed
is unable to use the Mac Directory Service to look up host names. I have not
found anything useful in system logs. Note for the ping(1) command used in the
script I can work around the problem by adding the host name to /etc/hosts –
ping must fall back to that if it can't use the Mac Directory. But that doesn't
seem to work for Java's InetAddress.getByName().

Moving this to ms07 since it won't be fixed for ms06. The next step may be to
write a small native program that calls the Mac Directory Service API to see
what error is being generated in the failing case. Running a dtrace like truss
script on ping did not reveal anything useful.

# Test script that pings a host, then forks itself
# Used to demonstrate ssh/DirectoryService issue on Mac OS X
#
# Example run:
#
# scp myping.sh 10.132.178.117:/tmp/myping.sh
# ssh 10.132.178.117 /tmp/myping.sh sidewinder 5 
#
# Output is saved in /tmp/mytrace on remote system
# Run the remote system is a Mac the first ping works, but then after
# the ssh shell returns subsequent pings fail with "unknown host"

cmd=$0

_nfork=0
_logfile=/tmp/mytrace
_hostname=

if [ $# -lt 2 ]; then
    echo "Usage: myping.sh <hostname> <number_of_times_to_fork>"
    exit 1
fi

_hostname=$1
_nfork=$2

echo "$_nfork $$  ====================" >> $_logfile
ping -c 1 $_hostname >> $_logfile  2>&1

if [ $_nfork -gt 0 ]; then
    sleep 2
    _nfork=`expr $_nfork - 1`
    # The /dev/null redirects is how we get ssh to return immediately.
    # See http://www.openssh.org/faq.html#3.10
    $cmd $_hostname $_nfork </dev/null >/dev/null 2>&1  &
    exit
fi
Comment by Joe Di Pol [ 29/Oct/10 ]
Author: jfdipol
Date: 2010-10-29 18:25:01+0000
New Revision: 42302

Modified:
  
trunk/v3/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFLauncher.java

Log:
When we start/restart an instance on the Mac, run the JVM in the Mac OS
global bootstrap namespace using the StartupItemContext utility. This 
prevents the process from loosing its namespace context when an SSH  
session ends (or user logs out).
This fixes: 12942: Mac: restart fails for instance started with start-instance 

Modified:
trunk/v3/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFLauncher.java
Url:
https://glassfish-svn.dev.java.net/source/browse/glassfish-svn/trunk/v3/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFLauncher.java?view=diff&rev=42302&p1=trunk/v3/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFLauncher.java&p2=trunk/v3/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFLauncher.java&r1=42301&r2=42302
==============================================================================
---
trunk/v3/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFLauncher.java
(original)
+++
trunk/v3/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFLauncher.java
2010-10-29 18:25:01+0000
@@ -358,7 +358,17 @@
             return;
         }
 
-        List<String> cmds = getCommandLine();
+        List<String> cmds = null;
+        if (OS.isDarwin()) {
+            // On MacOS we need to start long running process with
+            // StartupItemContext. See IT 12942
+            cmds = new ArrayList<String>();
+            cmds.add("/usr/libexec/StartupItemContext");
+            cmds.addAll(getCommandLine());
+        } else {
+            cmds = getCommandLine();
+        }
+
         ProcessBuilder pb = new ProcessBuilder(cmds);




[GLASSFISH-21113] GlassFish 4 does not start on OS X 10.10 Created: 30/Jun/14  Updated: 17/Apr/15  Resolved: 11/Aug/14

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

Type: Bug Priority: Minor
Reporter: reza_rahman Assignee: Joe Di Pol
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Mac OS X 10.10


Issue Links:
Cloners
is cloned by GLASSFISH-21349 GlassFish 4 does not start on OS X 10... Open
Related
is related to GLASSFISH-12942 Mac: restart fails for instance start... Resolved
Tags: 4_0_1-mustfix, fishcat

 Description   

It appears GlassFish 4 and 4.0.1 nightly build from Jun 16 does not start on Mac OS X 10.10.

bin/asadmin start-domain domain1 produces:

JVM failed to start: java.io.IOException: Cannot run program "/usr/libexec/StartupItemContext" (in directory "/Applications/glassfish4/glassfish/domains/domain1/config"): error=2, No such file or directory

Command start-domain failed.

This bug was reported to me by Joonas Lehtinen (joonas at vaadin dot com).



 Comments   
Comment by Romain Grécourt [ 01/Jul/14 ]

I don't see a nightly from june 16. According to http://dlc.sun.com.edgesuite.net/glassfish/4.0.1/nightly/latest-glassfish.zip, the latest is from June 7.

Don't have OSX 10.10 available to try out, but it be nice to provide JDK version information.

Comment by reza_rahman [ 01/Jul/14 ]

Unfortunately I don't have a Mac either. Hopefully somebody else will run into this and help us debug it?

Comment by David Delabassee [ 01/Jul/14 ]

Given that OS X 10.10 will be released after GF 4.0.1, we can lower the priority.
How GF 4.0.1 run on 10.10 is something to track.

Comment by Joe Di Pol [ 01/Jul/14 ]

GFLauncher.java uses /usr/libexec/StartupItemContext on the Mac. See issue GLASSFISH-12942.

According to the error message it looks like this was not found on the 10.10 build that the submitter was using. So we need to find out if Apple is removing this interface from 10.10 and if so what replaces it.

Comment by David Delabassee [ 18/Jul/14 ]
  • OS X 10.10
  • JDK 8u20ea (prior SE8 versions can't be installed on 10.10)
  • GF401b9

GF can start in verbose mode (asadmin start-domain --verbose domain1) but 'simple' start-domain fails!
in Verbose mode "cmds.add("/usr/libexec/StartupItemContext");" is skipped (cf. main/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFLauncher.java)

--8<--
bin/asadmin start-domain domain1
JVM failed to start: java.io.IOException: Cannot run program "/usr/libexec/StartupItemContext" (in directory "/Users/david/work/glassfish4/glassfish/domains/domain1/config"): error=2, No such file or directory
Command start-domain failed.
--8<--

Comment by Joe Di Pol [ 19/Jul/14 ]

See GLASSFISH-12942 on why "/usr/libexec/StartupItemContext" was used
See GLASSFISH-15118 on why it is not used with the --verbose option

For reference, on MacOS 10.9 StartupItemContext is a shell script that does this:

#!/bin/sh
unset LAUNCHD_SOCKET
exec launchctl bsexec / "$@"

The question is: why did Apple remove this from 10.10? Is that launchctl command still valid on 10.10? Is it safe for us to run it directly?

If the launchctl command is still valid on 10.10, then maybe we can just run it directly.

Comment by Joe Di Pol [ 11/Aug/14 ]

r63522
We now run the launchctl command directly instead of using /usr/libexec/StartupItemContext. The submitter has confirmed that with this change GlassFish starts on 10.10.





[GLASSFISH-21349] GlassFish 4 does not start on OS X 10.10.3 Created: 17/Apr/15  Updated: 17/Apr/15

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

Type: Bug Priority: Minor
Reporter: hadrabap Assignee: Joe Di Pol
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Mac OS X 10.10


Issue Links:
Cloners
clones GLASSFISH-21113 GlassFish 4 does not start on OS X 10.10 Resolved
Related
is related to GLASSFISH-12942 Mac: restart fails for instance start... Resolved
Tags: 4_0_1-mustfix, fishcat

 Description   

It appears GlassFish 4 and 4.0.1 nightly build from Jun 16 does not start on Mac OS X 10.10.

bin/asadmin start-domain domain1 produces:

JVM failed to start: java.io.IOException: Cannot run program "/usr/libexec/StartupItemContext" (in directory "/Applications/glassfish4/glassfish/domains/domain1/config"): error=2, No such file or directory

Command start-domain failed.

This bug was reported to me by Joonas Lehtinen (joonas at vaadin dot com).






[GLASSFISH-21079] org.jboss.weld.ejb.api.SessionObjectReference#getBusinessObject now supports remote interfaces Created: 02/Jun/14  Updated: 17/Apr/15

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

Type: Bug Priority: Major
Reporter: jjsnyder83 Assignee: amy.yang
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File 19280581-fb7f-4e5c-a2b5-9d3d818e579a.war     Java Archive File test-source.jar    
Tags: 4_0_1-mustfix

 Description   

For cdi 1.2 org.jboss.weld.ejb.api.SessionObjectReference#getBusinessObject now supports remote interfaces. Previously it just supported local interfaces.

The test is causing SessionObjectReferenceImpl#getBusinessObject to be called with an ejb's remote interface. This in turn is calling into EjbContainerServicesImpl#getBusinessObject with what appears to be the correct ejb reference and the remote interface as paramters. But this method is not finding the ejb for the specified remote interface and so an exception is thrown from line 108:

throw new IllegalStateException("Unable to convert ejbRef for ejb " +

The ejb in question is the Spitz ejb (source attached) which has both a local and remote interface defined for it.

To reproduce the exception deploy the attached war and then execute this url:

http://localhost:8080/19280581-fb7f-4e5c-a2b5-9d3d818e579a/ArquillianServletRunner?className=org.jboss.cdi.tck.tests.event.observer.resolve.enterprise.ResolveEnterpriseEventObserverTest&methodName=testObserverMethodOnEnterpriseBeanIsBusinessMethodOrStatic






[GLASSFISH-21207] Disabling CDI using beans.xml does not work for WAR inside of EAR Created: 19/Sep/14  Updated: 16/Apr/15  Resolved: 16/Apr/15

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

Type: Bug Priority: Critical
Reporter: mkarg Assignee: jjsnyder83
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

There is a fix contained in GF 4.1 for GLASSFISH-21027 which solves the problem that beans.xml contained inside of EJB-JAR which is part of EAR effectively does not disable CDI for that EJB-JAR. Now it seems as if that fix does really only work for EJB-JAR but not for WAR: The same problem still occurs in GF 4.1 when putting the attached beans.xml into WEB-INF folder of WAR contained in EAR: CDI still is enabled in that case, hence the following text is shown when trying to deploy:

[code]
remote failure: Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: com.google.common.util.concurrent.UncheckedExecutionException: org.jboss.weld.exceptions.IllegalStateException: WELD-001328: Unable
to identify the correct BeanManager. The calling class org.jboss.weld.servlet.WeldInitialListener is not placed in bean archive. Please see server.log for more details.
Command deploy failed.
[code]

The good news is that despite the solved EJB-JAR case described in GLASSFISH-21027, in the current WAR case described here there is functional workaround: --property implicitCdiEnabled=false provided with asadmin deploy command effectively does switch off CDI for the WAR contained in the EAR!



 Comments   
Comment by mkarg [ 19/Sep/14 ]

JIRA doesn't allows me to attach beans.xml file, so I post content here:

[code:xml]
<?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"
bean-discovery-mode="none" />
[code:xml]

Comment by mkarg [ 13/Oct/14 ]

It would cheer me up if the GlassFish Team would confirm that it is planned to fix this for 4.0.2. In the end, the same bug was fixed already for EJB-JARs so I assume the solution should not be too hard to apply on WARs also.

Comment by jjsnyder83 [ 16/Apr/15 ]

I just tested this with a war that has

<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://xmlns.jcp.org/xml/ns/javaee" bean-discovery-mode="none" version="1.1"/>

Cdi is not enabled for this war.





[GLASSFISH-21326] deployment of a EJB with a CDI injection from a different jar fail Created: 12/Mar/15  Updated: 16/Apr/15

Status: Open
Project: glassfish
Component/s: cdi, ejb_container
Affects Version/s: 4.1
Fix Version/s: None

Type: Bug Priority: Blocker
Reporter: tiran1984 Assignee: jjsnyder83
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

i try to deploy a application with a EJB which make a CDI injection from a different jar. But the deployment fails.

A simple CDI injection in the same jar works

I get these exception:

Exception during lifecycle processing
org.glassfish.deployment.common.DeploymentException: CDI deployment failure:WELD-001408: Unsatisfied dependencies for type CDIOutOfEJB with qualifiers @Default
at injection point [BackedAnnotatedField] @Inject private com.ducktail.ejb.EJBImpl.outofEJB
at com.ducktail.ejb.EJBImpl.outofEJB(EJBImpl.java:0)

The deployment of the same ear on wildfly works



 Comments   
Comment by jjsnyder83 [ 24/Mar/15 ]

Please provide a reproducible test case.

Comment by tiran1984 [ 24/Mar/15 ]

How can i attach my project?

Comment by jjsnyder83 [ 16/Apr/15 ]

You can mail it to me: j.j.snyder@oracle.com





[GLASSFISH-21339] Upgrade to Weld 2.2.10.SP1 Created: 26/Mar/15  Updated: 16/Apr/15  Resolved: 16/Apr/15

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

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


 Description   

According to JBoss there is a regression in 2.2.10.Final which causes any integrator configuration expressed using the BootstrapConfiguration API to be ignored by Weld. It's tracked by WELD-1904. GF uses this API to suppress concurrent bootstrap of Weld. This configuration option will be ignored with 2.2.10.Final.



 Comments   
Comment by jjsnyder83 [ 16/Apr/15 ]

Committed revision 63848.





[GLASSFISH-21310] Broken links in about.html Created: 22/Feb/15  Updated: 16/Apr/15  Resolved: 16/Apr/15

Status: Resolved
Project: glassfish
Component/s: None
Affects Version/s: 4.1
Fix Version/s: 4.2

Type: Bug Priority: Trivial
Reporter: Anthony Ve Assignee: Shaifali Kansal
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: javaee_ri_fix

 Description   

The file about.html (in glassfish4\glassfish\docs) contains 3 broken links at the bottom:

Your First Cup: An Introduction to the Java EE Platform
should link to https://docs.oracle.com/javaee/7/firstcup/index.html

The Java EE Tutorial
should link to https://docs.oracle.com/javaee/7/tutorial/index.html

Java™ Platform, Enterprise Edition (Java EE) API online documentation (only in SDK bundle)
should have href="../../docs/api/index.html"



 Comments   
Comment by Shaifali Kansal [ 10/Apr/15 ]

The first two links are indeed broken in the about.html.

But for the third link the information given in the about.html is that the "../../docs/api/index.html" link to the Java EE API online documentation is valid only if you obtained GlassFish Server through the Java EE SDK. It does work for SDK bundle.
Otherwise the link- "http://docs.oracle.com/javaee/7/api/" is provided for other cases in the documentation.

Comment by Anthony Ve [ 10/Apr/15 ]

I'm unable to reproduce: for me the third link doesn't work, even with the SDK bundle.

Exact steps for what I did:

The correct URL should be "file:///C:/Dev/glassfish4/docs/api/index.html". Currently, the href attribute of the link is "api/index.html", but the api (and tutorial and first cup) are in the top-level docs directory. Which is why I believe the href attribute must be changed to "../../docs/api/index.html".

Also please note that the link that is provided for other cases currently refers to "http://download.oracle.com/javaee/7/api/", while it should refer to "http://docs.oracle.com/javaee/7/api/". This should also be changed.

Comment by Shaifali Kansal [ 16/Apr/15 ]

This issue has been resolved for all four broken links.

Sending basedocs/src/main/resources/glassfish/docs/about.html
Transmitting file data .
Committed revision 63847.





[GLASSFISH-21153] static copyright.html is missing from doc-root Created: 01/Aug/14  Updated: 16/Apr/15  Resolved: 16/Apr/15

Status: Resolved
Project: glassfish
Component/s: docs
Affects Version/s: 4.1_b10, 4.1
Fix Version/s: 4.1, 4.2

Type: Bug Priority: Major
Reporter: Romain Grécourt Assignee: Shaifali Kansal
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Blocks
blocks GLASSFISH-21122 4.0.1: Update default index.html and ... Open
Tags: 4_0_1-review, javaee_ri_fix

 Description   

When going to the doc-root index: http://localhost:8080, there is a link in the footer called "legal notice", which points to http://localhost:8080/copyright.html but does not exist.



 Comments   
Comment by Shaifali Kansal [ 16/Apr/15 ]

This issue has been resolved.

Sending basedocs/src/main/resources/glassfish/lib/templates/docroot/index.html
Transmitting file data .
Committed revision 63846.





[GLASSFISH-21343] Glassfish fails to start on OSX 10.10.3 Created: 02/Apr/15  Updated: 16/Apr/15

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

Type: Bug Priority: Major
Reporter: gamussa Assignee: Joe Di Pol
Resolution: Unresolved Votes: 5
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Glassfish fails to start on OSX 10.10.3 (there is no such problem with previous version).

./asadmin start-domain domain1

JVM failed to start: com.sun.enterprise.admin.launcher.GFLauncherException: The server exited prematurely with exit code 1.
Before it died, it produced the following output:

Command start-domain failed.

Investigation showed, that command launchctl bsexec / that Glassfish uses on mac throws error

This subcommand requires root privileges: bsexec

Apparently, starting from 10.10.3 bsexec requires root privileges.

Posible workarounds

  • sudo ./asadmin start-domain domain1
  • ./asadmin start-domain domain1 --verbose=true


 Comments   
Comment by emreavsar [ 09/Apr/15 ]

Having the same issue here, worked with the /usr/libexec/StartupItemContext file until now. After the update (10.10.3) from this morning, this does not work anymore.

cat /usr/libexec/StartupItemContext
#!/bin/sh
unset LAUNCHD_SOCKET
exec launchctl bsexec / "$@"

Env:

  • Mac OS X (10.10.3)
  • GlassFish Server Open Source Edition 3.1.2 (build 23)
Comment by simon.schlachter [ 09/Apr/15 ]

Another workaround:
Changing the content of /usr/libexec/StartupItemContext to the following content, restores a working GF for me:

#!/bin/sh
unset LAUNCHD_SOCKET
$@
Comment by emreavsar [ 09/Apr/15 ]

Great! simon.schlachter's answer worked for me.

Comment by gamussa [ 09/Apr/15 ]

Just FYI, Apple removed StartupItemContext from 10.10 (Glassfish fixed this https://java.net/jira/browse/GLASSFISH-21113). Glassfish launcher has this commands hardcoded https://java.net/projects/glassfish/sources/svn/content/trunk/main/nucleus/admin/launcher/src/main/java/com/sun/enterprise/admin/launcher/GFLauncher.java?rev=63819 (line around 448).
So this workaround will work only if you create StartupItemContext.
Another drawback of this workaround is that Glassfish shuts down once you close terminal session.

Comment by simon.schlachter [ 09/Apr/15 ]

@gamussa: You're reight about the "Glassfish shuts down once you close terminal session". This is, however, not a problem on our side, since we use OSX not for production, but during development.

Comment by pbelbin [ 10/Apr/15 ]

the suggestions may be ok for glassfish 3.x which use the StartupItemContext, but, for 4.1, which does not use that, it appears these ideas are a bust. 10.10.3 appears not to have StartupItemContext.

glassfish 4.1 does not rely on StartupItemContext being present, thus, nothing relying on StartupItemContext works.

Comment by gamussa [ 10/Apr/15 ]

StartupItemContext file content was hardcoded in GFLauncher code (link above). GL 4.x will fail to start on 10.10.3 (specifically, it was released yesterday) because bsexec requires admin permissions two run.

Comment by yfain [ 15/Apr/15 ]

If GlassFish is configured in Eclipse it starts fine from there.

To start it from IntelliJ IDEA you need to edit Run configuration and change the Startup line to something like this:
/Users/yourUserName/glassfish4/glassfish/bin/asadmin start-domain --verbose

(the description of this bug suggests similar line as a workaround, but it didn't work for me until I removed domain1 from the start line).

Comment by Joe Di Pol [ 16/Apr/15 ]

To summarize:

In GlassFish 4.0 "/usr/libexec/StartupItemContext" was used to start GlassFish. For details as to why see GLASSFISH-12942

In MacOS 10.10 Apple removed StartupItemContext, so GlassFish 4.1 stopped using it and did 'launchctl bsexec' directly. For details see GLASSFISH-21113

And in 10.10.3 that fails because, apparently, bsexec now requires root privileges.

We will investigate fixing this in an upcoming GlassFish update.





[GLASSFISH-21316] Log Viewer inconsistencies Created: 26/Feb/15  Updated: 13/Apr/15  Resolved: 13/Apr/15

Status: Resolved
Project: glassfish
Component/s: admin_gui, logging
Affects Version/s: 4.0
Fix Version/s: 4.2

Type: Bug Priority: Major
Reporter: beppeben Assignee: Shaifali Kansal
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu 14.04


Tags: javaee_ri_fix

 Description   

This is about the Log Viewer in the Admin console (accessed through server-->View Log Files). When selecting the file "server.log", I get a list of logs in a table with Record Number, Log Level, Message, etc... In the Message field you can click on a link called "details" which brings you to the full stack trace of warnings for example. The problem is that sometimes clicking on this link brings you to a completely different log entry with respect to the one you clicked. Sometimes the record number is right but the message is the wrong one, other times both are wrong. For example, I click for details for the log entry n. 29, which automatically issues a request for
common/logViewer/logEntryDetail.jsf?instanceName=server&logLevel=INFO&logFile=server.log&recNumber=29
but I get log entry details for record 19, which also shows a wrong message!
The problem seems to disappear when I rotate logs and I access the file server.log_2015-SomeDate instead of server.log. And it should only be related to the way logs are queried, since I checked and the server.log file doesn't show any issues.
I'm using Glassfish 4.0.1 (build 8).






[GLASSFISH-21348] Clustering and GMS broken Created: 10/Apr/15  Updated: 10/Apr/15

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

Type: Bug Priority: Major
Reporter: Manfred Riem Assignee: Joe Di Pol
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Java Source File FlashClusterIT.java     Java Source File FlashMessagesIT.java     Java Source File FlashViewParamIT.java     Java Source File Issue2862IT.java     Java Source File Issue2973IT.java     Java Source File KeepMessagesIT.java     File test-cluster-servlet25-flash-basic.war    
Issue Links:
Blocks
blocks JAVASERVERFACES-3721 Investigate why com.sun.faces.test.cl... Open

 Description   

As part of the Mojarra testbed we run some cluster tests. It appears with GF 4.1 this particular test WAR is not working entirely correctly.



 Comments   
Comment by Manfred Riem [ 10/Apr/15 ]

Deployable WAR + HtmlUnit tests





[GLASSFISH-21346] Glassfish 4.1 fails to start on OSX 10.10.3 Created: 09/Apr/15  Updated: 10/Apr/15

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

Type: Bug Priority: Major
Reporter: pbelbin Assignee: Chris Kasso
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Mac OSX 10.10.3



 Description   

launchctl dsexec now appears to require root priveliges to be used.

so, asadmin from cmd line does not work when it comes to starting.

interactive workaround: use the --verbose option when starting/stopping the domain. but, this means that the command never finishes (which makes it inappropriate for scripting)



 Comments   
Comment by pbelbin [ 10/Apr/15 ]

Just an observation: even though the asadmin from the command line fails, NetBeans is able to start glassfish. hmmmm. what's different about how NetBeans is starting glassfish?

Comment by gamussa [ 10/Apr/15 ]

related issue https://java.net/jira/browse/GLASSFISH-21343





[GLASSFISH-20932] Error occurs when default-web-module is set. Created: 17/Dec/13  Updated: 10/Apr/15

Status: In Progress
Project: glassfish
Component/s: web_container
Affects Version/s: 4.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: xianwu Assignee: Arindam Bandyopadhyay
Resolution: Unresolved Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS
Windows 7 Enterprise (Service Pack 1)

JDK
java version "1.7.0_11"
Java(TM) SE Runtime Environment (build 1.7.0_11-b21) Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

GlassFish build: glassfish-4.0.1-b02-07_22_2013


Tags: javaee_ri_fix

 Description   

Reproducible operational steps:

1) deploy a web application e.g. HelloServlet.war
asadmin deploy c:\tmp\HelloServlet.war
Application deployed with name HelloServlet.
Command deploy executed successfully.

2) set default-web-module to HelloServlet
asadmin set server.http-service.virtual-server.server.default-web-module=HelloServlet
server.http-service.virtual-server.server.default-web-module=HelloServlet
Command set executed successfully.

3) set http-listener-1.http.max-post-size-bytes
asadmin set server.network-config.protocols.protocol.http-listener-1.http.max-post-size-bytes=2000
server.network-config.protocols.protocol.http-listener-1.http.max-post-size-bytes=2000
Command set executed successfully.

4) error occurs in server.log

[2013-12-17T16:29:08.916+1100] [glassfish 4.0] [SEVERE] [AS-WEB-GLUE-00115] [javax.enterprise.web] [tid: _ThreadID=145 _ThreadName=pool-50-thread-1] [timeMillis: 1387258148916] [levelValue: 1000] [[
Exception processing HttpService configuration change
org.apache.catalina.LifecycleException: java.lang.Exception: No context matching /HelloServlet deployed on virtual server server
at com.sun.enterprise.web.WebContainer.updateDefaultWebModule(WebContainer.java:2340)
at com.sun.enterprise.web.WebContainer.updateHost(WebContainer.java:3157)
at com.sun.enterprise.web.reconfig.WebConfigListener$1.changed(WebConfigListener.java:156)
at org.jvnet.hk2.config.ConfigSupport.sortAndDispatch(ConfigSupport.java:331)
at com.sun.enterprise.web.reconfig.WebConfigListener.changed(WebConfigListener.java:132)
at org.jvnet.hk2.config.Transactions$ConfigListenerJob.process(Transactions.java:400)
at org.jvnet.hk2.config.Transactions$ConfigListenerJob.process(Transactions.java:390)
at org.jvnet.hk2.config.Transactions$ConfigListenerNotifier$1$1.call(Transactions.java:280)
at org.jvnet.hk2.config.Transactions$ConfigListenerNotifier$1$1.call(Transactions.java:278)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.lang.Exception: No context matching /HelloServlet deployed on virtual server server
at org.glassfish.grizzly.http.server.util.Mapper.addDefaultContext(Mapper.java:791)
at org.glassfish.grizzly.http.server.util.Mapper.setDefaultContextPath(Mapper.java:755)
at com.sun.enterprise.web.WebContainer.updateDefaultWebModule(WebContainer.java:2332)
... 13 more
]]

5) get http-listener-1.http.max-post-size-bytes
asadmin get server.network-config.protocols.protocol.http-listener-1.http.max-post-size-bytes
server.network-config.protocols.protocol.http-listener-1.http.max-post-size-bytes=2000
Command get executed successfully.



 Comments   
Comment by jifeng [ 13/Jan/14 ]

Hi
Shing Wai Chan
xianwu

After a few investigation about the source, I found the exact precise place where the failure happens:

org.glassfish.grizzly.http.server.util.Mapper
private void addDefaultContext(Host host, String defaultContextPath)
            throws Exception {

        boolean defaultContextFound = false;

        Context[] contexts = host.contextList.contexts;

        if (contexts != null) {
            for (Context context1 : contexts) {
                if (context1.name.equals(defaultContextPath)) {
                    host.defaultContexts[0] = context1;
                    defaultContextFound = true;
                    break;
                }
            }
        }

        if (!defaultContextFound) {
            throw new Exception("No context matching " + defaultContextPath
                                + " deployed on virtual server "
                                + host.name);★
        }
    }

I have debuged the 'Mapper' class and found the [context.name] object has never been valued。

The [context.name] object's initialization processing as follows:

package com.sun.enterprise.v3.services.impl.ContainerMapper
private final static String ROOT = "";★
protected void configureMapper() {
    ......
    try {
    ....
         mapper.addContext(defaultHostName, ROOT★,
                    new ContextRootInfo(this, null),
                    new String[]{"index.html", "index.htm"}, null);
    ....
        } finally {
            mapperLock.writeLock().unlock();
        }
}

org.glassfish.grizzly.http.server.util.Mapper
public void addContext
            (String hostName, String path★, Object context,
            String[] welcomeResources, NamingContext resources,
            List<AlternateDocBase> alternateDocBases) {
    ......
    newContext.name = path;★//the [context.name] object's 
                             //value always equals to ""
    ......
 }
Comment by jifeng [ 24/Jan/14 ]

Hi
Shing Wai Chan
xianwu

I modify the following code, it works fine,could you please confirm it and give me some suggestions?

package com.sun.enterprise.v3.services.impl.ContainerMapper
@@ -69,6 +69,8 @@
 import org.glassfish.grizzly.http.util.MimeType;
 import org.glassfish.internal.grizzly.ContextMapper;
 import org.glassfish.kernel.KernelLoggerInfo;
+import com.sun.enterprise.config.serverbeans.ConfigBeansUtilities;
+import com.sun.enterprise.config.serverbeans.VirtualServer;
 
 /**
  * Container's mapper which maps {@link ByteBuffer} bytes representation to an  {@link HttpHandler}, {@link
@@ -148,7 +150,7 @@
         try {
             mapper.setDefaultHostName(defaultHostName);
             mapper.addHost(defaultHostName, new String[]{}, null);
-            mapper.addContext(defaultHostName, ROOT,
+            mapper.addContext(defaultHostName, getContextRoot(),
                     new ContextRootInfo(this, null),
                     new String[]{"index.html", "index.htm"}, null);
             // Container deployed have the right to override the default setting.
@@ -157,7 +159,29 @@
             mapperLock.writeLock().unlock();
         }
     }
-
+    
+    private String getContextRoot() {
+        String defaultWebModule = null;
+        String contextRoot = null;
+        Collection<VirtualServer> list = grizzlyService.getHabitat().getAllServices(VirtualServer.class);
+        ConfigBeansUtilities cbu = grizzlyService.getHabitat().getService(ConfigBeansUtilities.class);
+        for (VirtualServer virtualServer : list) {
+            if (virtualServer.getId().equals(defaultHostName)) {
+                defaultWebModule = virtualServer.getDefaultWebModule();
+                if (cbu == null) {
+                    contextRoot = null;
+                }
+                else {
+                    if (defaultWebModule != null) {
+                        contextRoot = cbu.getContextRoot(defaultWebModule);
+                    }
+                }
+                break;
+            }
+        }
+        return contextRoot == null ?ROOT:contextRoot;
+    }
+   
Comment by oleksiys [ 17/May/14 ]

IMO ContainerMapper has nothing to do with the problem. I think the problem occurs because WebContainer tries to set default web module even before this module is registered/deployed in the Mapper. The registration sequence has to be fixed in WebContainer.

Comment by bradvido [ 12/Feb/15 ]

I have this problem as well in 4.1.
I have a virtual server set up with a default web module defined. Whenever I update the settings for the network-listener that the virtual server uses, I get the same error. Moreover, the server becomes unresponsive and starts returning zero-length responses for all HTTP requests. Only a restart fixes it.





[GLASSFISH-20842] X-Forwarded-Proto not honored by glassfish 4.0 Created: 02/Oct/13  Updated: 09/Apr/15  Resolved: 09/Apr/15

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 4.0
Fix Version/s: 4.2

Type: Bug Priority: Major
Reporter: marcos_sakamoto Assignee: Arindam Bandyopadhyay
Resolution: Fixed Votes: 8
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux and Windows


Issue Links:
Relates
relates to GLASSFISH-18685 X-Forwarded-Proto not honored by glas... Resolved
Tags: javaee_ri_fix, payara, ssl-offload

 Description   

I'm using a NginX server as a SSL terminating proxy and set the following HTTP headers:

Host: <NginX host>
X-Forwarded-Proto: https

In Glassfish I set the following property:

asadmin set server.network-config.protocols.protocol.http-listener-1.http.scheme-mapping=X-Forwarded-Proto

Glassfish ignores the X-Forwarded-Proto and uses HTTP to build HttpServletRequest.getRequestURL() or evaluate HttpServletRequest.getScheme() and HttpServletRequest.isSecure()

I've tested on both Glassfish 3.1.2.2 and Glassfish 4.0 and on Glassfish 3.1.2.2 works like a charm!
But it's not working on Glassfish 4.0! Seems a regression? (Similar issue https://java.net/jira/browse/GLASSFISH-18685)



 Comments   
Comment by frederickkaempfer [ 06/Oct/14 ]

The issue still exists on Glassfish 4.1. Probably the patch in GLASSFISH-18685 was never ported to the 4.x branch.

Comment by juliohm1978 [ 06/Oct/14 ]

I can't express how disappointing that is. We were waiting for 4.1 hoping this would be fixed in the official release

Comment by smillidge-c2b2 [ 07/Oct/14 ]

If you have the patch available I can see if we can get it into a Payara build and upstream into a later GlassFish

Comment by notabenem [ 25/Nov/14 ]

I really need this patched in GF4.1 / payara. After a long-long search, I have finally found the patch needed (hopefully).
It was committed against Grizzly 1.9.50 and likely backported to 1.9.46 (based on the zips attached to GLASSFISH-18685).

The ticket in question with the corresponding commits is the following: GRIZZLY-1281
Commits: 6b35876, 42089bc and 58ce8c4
Note, it was committed against 1.9.50. Apparently (according to GIT), these fixes were not applied to branch 2.2.x (and thus neither to 2.3.x)

PS: I created a patch (created from those commits), but can't upload it here.

Comment by smillidge-c2b2 [ 25/Nov/14 ]

I've created this to see if we can help out and test this https://github.com/payara/Payara/issues/75

Comment by notabenem [ 26/Nov/14 ]

One more thing: I noticed the fix(es) for GRIZZLY-1281 were also included in the main trunk. Commits: e54698c and ed7de1e.
According to the git log, these commits made their ways to the 'master' branch, but never into the '2.3.x' branch from which the Glassfish 4.1 branch was forked.
BTW: not sure how the 2.3.x branch was kept up to date. The first commit in this branch after 8/6/2012 (commit e54698c) is from 3/6/2013 (a year later, commit: 09d8c82) and even that commit was not a squashed commit of all changes from master. Strange. Seems like a completely isolated branch from master

Comment by smillidge-c2b2 [ 26/Nov/14 ]

I would also suggest you raise the issue within the Grizzly project as the fix needs to go into Grizzly rather than GlassFish.

Comment by notabenem [ 26/Nov/14 ]

Check out the Payara issue linked above for the pull-request to have this solved. I also have a patched nucleus-grizzly-all.jar, but can't attach it here.
The related GRIZZLY issue is GRIZZLY-1720

Comment by Arindam Bandyopadhyay [ 27/Mar/15 ]

Hi Oleksiy,
I saw your git comment that GRIZZLY-1720 is merged on 2.3.x and glassfishv41. So whether the issue will be still reproduce-able in GF trunk/main?
Please note that I have noticed that the patch for GRIZZLY-1720 is not there in grizzly-http-server-2.3.15-gfa.jar (which is coming from maven central ).grizzly-http-server-2.3.15-gfa.jar is using by both GF 4.1 and GF trunk/main.

Comment by Arindam Bandyopadhyay [ 02/Apr/15 ]

As per Oleksiy --> GRIZZLY-1720 haven't been fixed on GF trunk yet. It will be fixed with the next Grizzly integration.

Comment by Arindam Bandyopadhyay [ 08/Apr/15 ]

Grizzly 2.3.19 is integrated with GF trunk/main.
Committed revision 63835

Comment by Arindam Bandyopadhyay [ 09/Apr/15 ]

Fixed in trunk/main
Sending nucleus/grizzly/config/src/main/java/org/glassfish/grizzly/config/GenericGrizzlyListener.java
Transmitting file data .
Committed revision 63837.





[GLASSFISH-21295] Some EE7 APIs missing during JSP compilation Created: 03/Feb/15  Updated: 08/Apr/15

Status: In Progress
Project: glassfish
Component/s: web_container
Affects Version/s: 4.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: emailnbw Assignee: Shaifali Kansal
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Glassfish 4.1 full zip, RHEL 7.0, Oracle 1.7.0_71 JDK


Tags: glassfish, jsp

 Description   

I have a web application (single war) which includes a few JSPs. This web app worked fine under Glassfish 3.1.2.x and GF would compile the JSPs just fine.

When Glassfish 4.1 attempts to compile these same JSPs I get a bunch of errors because it can't locate javax.jax-rs API classes. This never happened in Glassfish 3.1.2.x. It appears that the contents of the default-web.xml have changed related to how the JSP servlet is configured. Specifically the APIs listed in the system-jar-includes no longer included javax.jaxrs as they once did. Instead it now includes jersey-mvc-jsp.jar. This seems like a regression.



 Comments   
Comment by Shaifali Kansal [ 08/Apr/15 ]

Can you please provide this particular war file here?





[GLASSFISH-21345] Unable to capture Schema for table Aliases using com.sun.jdo.api.persistence.mapping.ejb.CaptureSchema Created: 07/Apr/15  Updated: 07/Apr/15

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

Type: Bug Priority: Blocker
Reporter: subbajava Assignee: Joe Di Pol
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

GlassFish V3, datbase DB2, EJB CMP 2.X



 Description   

Hi Team,

We are working on deploying EJB CMP 2.x into GlassFish server, so we are trying to generate dbschema using CaptureSchema utility.
We are using DB2 database and we have aliases for every table. When we run CaptureSchema, dbschema is generating meta data for only tables but not considering the table aliases. We tried to change the CaptureSchema.java code to pass Table Type as Alias also, but there was no luck.

Can someone please guide us in using CaptureSchema tool with table Aliases.

Thanks,
Subba






[GLASSFISH-21249] Possible error in UnifiedX509KeyManager Created: 05/Nov/14  Updated: 07/Apr/15

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

Type: Bug Priority: Major
Reporter: afev Assignee: Nithya Ramakrishnan
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 7 SP 1 (x64)



 Description   

Hello.

I use a JSSE provider which implements X509KeyManager with getServerAliases and getClientAliases methods. These methods make different things.
I am trying to use the provider with glassfish 4. When starts up, Glassfish creates a manager with type of J2EEKeyManager and my key manager inside. After that the web-server uses getClientAliases.

Following piece of code is from http://grepcode.com/file/repo1.maven.org/maven2/org.glassfish.security/s...
public String[] getServerAliases(String keyType, Principal[] issuers) {
137 ArrayList serverAliases = new ArrayList();
138 for (int i = 0; i < mgrs.length; i++) {
139 String[] serAliases = mgrs[i].getClientAliases(keyType, issuers);
140 if (serAliases != null && serAliases.length > 0) {
141 for (int j = 0; j < serAliases.length; j++)

{ 142 serverAliases.add(serAliases[j]); 143 }

144 }
145 }
146
147 return (serverAliases.size() == 0) ? null :
148 (String[])serverAliases.toArray(new String[serverAliases.size()]);
149 }

I have not found the source code of glassfish 4, but it looks like this possible error exists in glassfish 4.

I think that it is the reason of my problem - glassfish uses getClientAliases instead of desirable getServerAliases.
Is it so? Otherwise, can somebody explain why getServerAliases uses getClientAliases?

Thanks.



 Comments   
Comment by afev [ 05/Nov/14 ]

Valid link to the source code: http://grepcode.com/file/repo1.maven.org/maven2/org.glassfish.security/ssl-impl/3.1.1/com/sun/enterprise/security/ssl/manager/UnifiedX509KeyManager.java#UnifiedX509KeyManager

Comment by smillidge-c2b2 [ 15/Nov/14 ]

I suspect this is a bug. Have you tried fixing it, rebuilding the module and see if it then works correctly with your provider?

Comment by afev [ 16/Nov/14 ]

I will try to rebuild and check the module using the source code from https://java.net/projects/glassfish/sources/svn/show/trunk.

Comment by afev [ 18/Nov/14 ]

I chose another way. I extracted UnifiedX509KeyManager from ssl-impl.jar of glassfish 4, fixed getServerAliases() there, and then I put the class with fixed method back to the jar. After that I restarted the server, and it selected an expected server certificate (with "server authentication" policy, not "client authentication" as it was).
It is exactly a bug.

Comment by smillidge-c2b2 [ 12/Jan/15 ]

We have incorporated this fix into Payara. I'd be grateful if you could check that this fixes your problem by testing it with your SSL provider in your environment by downloading the latest build from here http://www.payara.co/upstream_builds

The Payara commit reference is here; https://github.com/payara/Payara/commit/705848f320d538d34ad164d8bfd8d73342208d4c

Comment by afev [ 14/Jan/15 ]

Thank you. I will check it.

Comment by afev [ 07/Apr/15 ]

I have checked the fix, now key mananger selects an expected certificate. The problem resolved.





[GLASSFISH-21028] CLONE -Deployment from Web Console: temporary files are not deleted Created: 02/Apr/14  Updated: 07/Apr/15  Resolved: 07/Apr/15

Status: Resolved
Project: glassfish
Component/s: admin_gui
Affects Version/s: 9.1peur2
Fix Version/s: 4.2

Type: Bug Priority: Blocker
Reporter: T-Gergely Assignee: mukesh.kumawat
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issuezilla Id: 7,180
Tags: javaee_ri_fix, review-blk

 Description   

When anything (war or ear) is deployed from the web console, a temporary file of
the archive is not deleted. It never happens if the same archive is deployed
with command line or remotely from NetBeans IDE.

This is quite a problem, because in this case application server must be
periodically cleaned manually, especially if deployment is very frequent and
applications are not so small.

Example:
Original file: Foo.war
Deployed on server: /tmp/Foo28436.war



 Comments   
Comment by T-Gergely [ 02/Apr/14 ]

The same issue is still present in GlassFish Server Open Source Edition 4.0 (build 89).

Comment by mukesh.kumawat [ 07/Apr/15 ]

Committed in trunk/main.
Committed revision 63833.





[GLASSFISH-20908] create-domain command does not accept template parameter Created: 22/Nov/13  Updated: 06/Apr/15

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

Type: Bug Priority: Major
Reporter: hmashlah Assignee: martin.mares
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu 13.04



 Description   

create-domain command is not accepting a template parameter as described in the administration-guide.
The command "./asadmin create-domain --portbase 15100 --template template.xml domain2-test" is failing with message
"Invalid --template value template.xml, option accepts only jar file location."



 Comments   
Comment by deepakpn [ 24/Jan/14 ]

I am facing the same issue, any updates on when this will be fix? Is there any work-around?

Comment by CarloMo [ 13/Nov/14 ]

I'm also encountering this problem in Glassfish 4.1. Is there no way to use a custom template to create a domain in this version?

Comment by jtcacct [ 02/Apr/15 ]

Would be nice to get an update regarding this issue. My team also uses this feature. This seems to be completely broken in 4.1.

Comment by jtcacct [ 06/Apr/15 ]

Hey guys, I think I figured this out.

Check out the following directory: /opt/glassfish/glassfish/common/templates/gf

In that directory there are two jars: appserver-domain.jar and nucleus-domain.jar. Within those jars there is the standard/typical directories that reside within the domain directory. For my use case I was able to extract the contents of nucleus-domain.jar, make the same changes that were in my old template XML file to the config/domain.xml file, re-jar up the contents, and use the resulting jar file as the --template cmd line option argument. This worked.

Why this is not documented anywhere and I am the first person explaining on to do this on this ticket almost 2 years later is beyond me. I think it is safe to assume that this Jira instance is no longer being monitored by Oracle. Hopefully this post helps someone else out there through search engines.





[GLASSFISH-21337] java.util.ConcurrentModificationException on Multitenant enviroment Created: 25/Mar/15  Updated: 05/Apr/15

Status: Open
Project: glassfish
Component/s: entity-persistence
Affects Version/s: 4.0, 4.1
Fix Version/s: None

Type: Bug Priority: Blocker
Reporter: dyego Assignee: Srini
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows , JDK 8, 4GB of ram, persistence.xml:

<persistence-unit name="My-ejbPU" transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>jdbc/mybase</jta-data-source>
<exclude-unlisted-classes>false</exclude-unlisted-classes>
<shared-cache-mode>NONE</shared-cache-mode>
<validation-mode>NONE</validation-mode>
<properties>
<property name="javax.persistence.validation.group.pre-persist" value="javax.validation.groups.Default"/>
<property name="javax.persistence.validation.group.pre-update" value="javax.validation.groups.Default"/>
<property name="hibernate.validator.autoregister_listeners" value="false"/>
<property name="eclipselink.logging.level.sql" value="FINE"/>
<property name="eclipselink.logging.parameters" value="true"/>
<property name="eclipselink.multitenant.tenants-share-cache" value="true"/>
<property name="eclipselink.multitenant.tenants-share-emf" value="true"/>
<property name="eclipselink.target-database" value="MySQL"/>
<property name="eclipselink.cache.shared.default" value="true"/>
</properties>
</persistence-unit>



 Description   

On Multitenant TABLE_SUFIX enviroment, if you create a servlet to read image from database (for example) and your page CALL this servlet many times in one page (a gallary for example) the simultaneos call of jpa from a servlet you will recive :

Advertência: javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean
at com.sun.ejb.containers.EJBContainerTransactionManager.checkExceptionClientTx(EJBContainerTransactionManager.java:662)
at com.sun.ejb.containers.EJBContainerTransactionManager.postInvokeTx(EJBContainerTransactionManager.java:507)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4566)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2074)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2044)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:220)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
at com.sun.proxy.$Proxy246.getStorages(Unknown Source)
at myservice.service.filestorage._EJB31_GeneratedFileStorageRepositoryIntf__Bean_.getStorages(Unknown Source)
at myservice.service.filestorage.FileStorageService.getFile(FileStorageService.java:175)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1081)
at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1153)
at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:4786)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:656)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
at myservice.service.log.LogInterceptor.classInterceptor(LogInterceptor.java:101)
at sun.reflect.GeneratedMethodAccessor94.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
at myservice.service.log.ContextInterceptor.classInterceptor(ContextInterceptor.java:43)
at sun.reflect.GeneratedMethodAccessor93.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
at myservice.interceptor.ServiceRegionalizeInterceptor.intercept(ServiceRegionalizeInterceptor.java:60)
at sun.reflect.GeneratedMethodAccessor92.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:46)
at org.jboss.weld.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
at sun.reflect.GeneratedMethodAccessor91.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:140)
at sun.reflect.GeneratedMethodAccessor90.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:369)
at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:4758)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4746)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:212)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
at com.sun.proxy.$Proxy351.getFile(Unknown Source)
at myservice.service.filestorage._EJB31_GeneratedFileStorageServiceIntf__Bean_.getFile(Unknown Source)
at myservice.control.imagegallery.ImageGalleryServlet.processRequest(ImageGalleryServlet.java:50)
at myservice.control.imagegallery.ImageGalleryServlet.doGet(ImageGalleryServlet.java:111)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:344)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at myservice.servlet.TenantFilter.doFilter(TenantFilter.java:62)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at myservice.servlet.NavigationHistoryFilter.doFilter(NavigationHistoryFilter.java:73)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316)
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.core.StandardPipeline.doInvoke(StandardPipeline.java:734)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:673)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:412)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextNode(HashMap.java:1429)
at java.util.HashMap$KeyIterator.next(HashMap.java:1453)
at org.eclipse.persistence.descriptors.ClassDescriptor.notifyReferencingDescriptorsOfIsolation(ClassDescriptor.java:3921)
at org.eclipse.persistence.descriptors.CachePolicy.postInitialize(CachePolicy.java:177)
at org.eclipse.persistence.descriptors.ClassDescriptor.postInitialize(ClassDescriptor.java:3909)
at org.eclipse.persistence.internal.sessions.AbstractSession.updateTablePerTenantDescriptors(AbstractSession.java:1401)
at org.eclipse.persistence.sessions.server.ClientSession.<init>(ClientSession.java:136)
at org.eclipse.persistence.internal.sessions.IsolatedClientSession.<init>(IsolatedClientSession.java:38)
at org.eclipse.persistence.sessions.server.ServerSession.acquireClientSession(ServerSession.java:386)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.getActivePersistenceContext(EntityManagerImpl.java:1933)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.getActiveSession(EntityManagerImpl.java:1232)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.getActiveSessionIfExists(EntityManagerImpl.java:1247)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.<init>(EJBQueryImpl.java:102)
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.<init>(EJBQueryImpl.java:86)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createQuery(EntityManagerImpl.java:1603)
at com.sun.enterprise.container.common.impl.EntityManagerWrapper.createQuery(EntityManagerWrapper.java:456)
at myservice.service.LinkEntityManager.createQuery(LinkEntityManager.java:165)
at myservice.service.base.BaseRepository.getList(BaseRepository.java:73)
at myservice.service.filestorage.FileStorageRepository.getStorages(FileStorageRepository.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1081)
at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1153)
at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:4786)
at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:656)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
at myservice.service.log.LogInterceptor.classInterceptor(LogInterceptor.java:101)
at sun.reflect.GeneratedMethodAccessor94.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
at myservice.service.log.ContextInterceptor.classInterceptor(ContextInterceptor.java:43)
at sun.reflect.GeneratedMethodAccessor93.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
at myservice.interceptor.ServiceRegionalizeInterceptor.intercept(ServiceRegionalizeInterceptor.java:60)
at sun.reflect.GeneratedMethodAccessor92.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:46)
at org.jboss.weld.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:52)
at sun.reflect.GeneratedMethodAccessor91.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:608)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.doCall(SystemInterceptorProxy.java:163)
at com.sun.ejb.containers.interceptors.SystemInterceptorProxy.aroundInvoke(SystemInterceptorProxy.java:140)
at sun.reflect.GeneratedMethodAccessor90.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:483)
at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:369)
at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:4758)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4746)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:212)
... 99 more



 Comments   
Comment by dyego [ 03/Apr/15 ]

This is a wclipselink BUG please close

Comment by Romain Grécourt [ 03/Apr/15 ]

can you share a link to the bug ?

Comment by dyego [ 05/Apr/15 ]

https://bugs.eclipse.org/bugs/show_bug.cgi?id=463737

Very strange e important bug for multi tenant users





[GLASSFISH-21159] X-PoweredBy sent even when disabled in the console Created: 07/Aug/14  Updated: 05/Apr/15

Status: In Progress
Project: glassfish
Component/s: web_container
Affects Version/s: 4.0
Fix Version/s: None

Type: Bug Priority: Major
Reporter: smillidge-c2b2 Assignee: Arindam Bandyopadhyay
Resolution: Unresolved Votes: 0
Labels: FishCat
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

All


Tags: javaee_ri_fix, review-blk

 Description   

When x-PoweredBy is disabled in the Admin console if a web application uses JSP the header is still set with the value JSP/2.3. This can be disabled by the web application developer by modifying the web.xml to add
<init-param>
<param-name>xpoweredBy</param-name>
<param-value>false</param-value>
</init-param>

however I think the administration option should be relied upon not relying on developers.

Steps to reproduce;

Disable X-PoweredBy in the administration console for the http-listener
Deploy a web application that uses JSP
Access the webapplication and check the headers sent to the browser
X-PoweredBy is present



 Comments   
Comment by smillidge-c2b2 [ 07/Aug/14 ]

We have fixed this is our version of GlassFish by adding the method below to the class com.sun.enterprise.v3.services.impl.GlassfishNetworkListener in the nucleus kernel module.This method checks the response before sending to the browser and if the X-PoweredBy header has been set by another subsystem during request processing it is stripped from the response thereby honouring the setting in the administration console.

// override to check whether x-Powered By has been added by something else
@Override
protected void onInitialLineEncoded(HttpHeader httpHeader, FilterChainContext ctx) {

if (xPoweredBy == null && httpHeader.containsHeader(Header.XPoweredBy))

{ httpHeader.getHeaders().removeHeader(Header.XPoweredBy); }

}

Comment by Arindam Bandyopadhyay [ 25/Mar/15 ]

I analysed the root cause of the bug and found out that $

{com.sun.aas.instanceRoot}

/config/default-web.xml is responsible for the issue. The default value in default-web.xml for jsp is the following

<servlet>
<servlet-name>jsp</servlet-name>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>xpoweredBy</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
.....
.......
So even if x-PoweredBy is disabled in the Admin console it is true in the default-web.xml. Now as per GF documentation "You can use the default-web.xml file to define features such as filters and security constraints that apply to all web applications."
As a result we are we are getting X-PoweredBy headers when X-PoweredBy is disabled in admin console. If you make xpoweredBy parameter false in the default-web.xml and disable it in the admin console you will get no X-PoweredBy header in the response.

Comment by Arindam Bandyopadhyay [ 25/Mar/15 ]

I observed that default-web.xml setting always overrides the admin console setting.Please find bellow the GF behaviour in the combination of admin console and default-web.xml when we deploy jsp files.

Default-web admin-console Headers displayed
TRUE FALSE X-PoweredBy header displayed . Value is "JSP/2.3"
TRUE TRUE X-PoweredBy header displayed . Value is "JSP/2.3"
FALSE FALSE X-PoweredBy header is not displayed.
FALSE TRUE X-PoweredBy header displayed . Value is "Servlet/3.1 JSP/2.3 (GlassFish Server Open Source Edition 4.1 Java/Oracle Corporation/1.7)"

Please note that if we make defalut-web.xml false and admin console true then only we are getting the X-PoweredBy header value from GlassfishNetworkListener.java class. Otherwise in all the cases defalut-web.xml overrides the X-PoweredBy header set by admin console.
We can fix the issue by setting the default value of xpoweredBy false in default-web.xml(/appserver/admin/template/src/main/resources/config/default-web.xml) .But before that we need to make sure if this is working as per design.

Hi Shing Wai Chan,

Could you let us know if this a bug or it's working as per design.





[GLASSFISH-21251] Create Managed Executor Service: longrunningtasks property is not working. Created: 11/Nov/14  Updated: 05/Apr/15  Resolved: 05/Apr/15

Status: Resolved
Project: glassfish
Component/s: command_line_interface, concurrency, configuration
Affects Version/s: 4.1
Fix Version/s: 4.2

Type: Bug Priority: Minor
Reporter: a.accioly Assignee: Arindam Bandyopadhyay
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: javaee_ri_fix, payara, review-blk

 Description   

When creating a new managed executor service --longrunningtasks=true has no effect.

How to reproduce:

1. Create a new managed executor service:

./asadmin create-managed-executor-service --maximumpoolsize=20 --taskqueuecapacity=5000 --longrunningtasks=true concurrent/myJobExecutor

2. Check that long-running-tasks=false:

./asadmin get resources.managed-executor-service.concurrent/myJobExecutor.long-running-tasks

Workaround:

Change the property manually:

./asadmin set resources.managed-executor-service.concurrent/myJobExecutor.long-running-tasks=true

Related to: Glassfish set max number of concurrent Batch Jobs



 Comments   
Comment by smillidge-c2b2 [ 15/Nov/14 ]

This is fixed in Payara commit https://github.com/payara/Payara/commit/ffb866c8d886d8b89e1c652c75b7b2ba75ed8980 feel free to pull the commit to resolve the issue. It will be resolved in Payara 4.1.151.

Comment by a.accioly [ 17/Nov/14 ]

Hello. It works! Also, as a Brazilian I loved the Application Server Name "Payara"!.
Would you mind to attach the mentioned patch to this issue (assuming that you are not a GlassFish commiter yourself)?

Comment by smillidge-c2b2 [ 17/Nov/14 ]

I can't add attachments as I don't have the permissions. I could cut and paste the patch file but it often doesn't work right due to the Jira formatting

Comment by a.accioly [ 17/Nov/14 ]

You can handle formatting wtih {code} blocks - check out Jira Advanced Formatting. But it looks like the GlassFish way of doing things is mailing the patch to a maintainer (check out How to Contribute to GlassFish). Let me know if I can help with anything else (I loved the initiative; and would be very glad if Payara grows strong; count me in for help)

Comment by smillidge-c2b2 [ 17/Nov/14 ]
patch
Subject: [PATCH] Fixed missing
 managedExecutorService.setLongRunningTasks(longRunningTasks);

This ensures the commandline property longrunningtasks is propagated correctly when creating a new ManagedExecutorService
---
 .../glassfish/concurrent/admin/ManagedExecutorServiceBaseManager.java    | 1 +
 1 file changed, 1 insertion(+)

diff --git a/appserver/concurrent/concurrent-impl/src/main/java/org/glassfish/concurrent/admin/ManagedExecutorServiceBaseManager.java b/appserver/concurrent/concurrent-impl/src/main/java/org/glassfish/concurrent/admin/ManagedExecutorServiceBaseManager.java
index b8fc656..fdc83e8 100644
--- a/appserver/concurrent/concurrent-impl/src/main/java/org/glassfish/concurrent/admin/ManagedExecutorServiceBaseManager.java
+++ b/appserver/concurrent/concurrent-impl/src/main/java/org/glassfish/concurrent/admin/ManagedExecutorServiceBaseManager.java
@@ -200,6 +200,7 @@ public abstract class ManagedExecutorServiceBaseManager implements ResourceManag
         managedExecutorService.setKeepAliveSeconds(keepAliveSeconds);
         managedExecutorService.setThreadLifetimeSeconds(threadLifetimeSeconds);
         managedExecutorService.setEnabled(enabled);
+        managedExecutorService.setLongRunningTasks(longRunningTasks);
         if (properties != null) {
             for ( Map.Entry e : properties.entrySet()) {
                 Property prop = managedExecutorService.createChild(Property.class);
-- 
1.9.1
Comment by prasads [ 02/Apr/15 ]

Waiting for review from Martin Mares

Comment by Arindam Bandyopadhyay [ 05/Apr/15 ]

Fixed in trunk/main.
Committed revision 63831.





[GLASSFISH-21344] Failed to obtain/create connection from connection pool [ RAMessagePool_omsrvs ]. Reason : In-use connections equal max-pool-size and expired max-wait-time. Cannot allocate more connections Created: 04/Apr/15  Updated: 04/Apr/15

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

Type: Bug Priority: Major
Reporter: vinodkumarbolla Assignee: Joe Di Pol
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Hi,

We are using glassfishv2. Maximum connection pool size is 32.
I have taken the Heap dump on the process and analyzed and found that all 32 JDBC connections were hold by java.util.Timer thread. But i am not able find the exact Thread of my Application.
Could some one please help/support me to overcome this issue.
Let me know if you need any information.

Thanks,
Vinod






[GLASSFISH-20670] Performance problem in getInitParameter and getInitParameterNames() of org.apache.catalina.core.ApplicationContext (glassfish version), which are called very often by JSF frameworks Created: 28/Jun/13  Updated: 03/Apr/15  Resolved: 13/May/14

Status: Resolved
Project: glassfish
Component/s: performance, web_container
Affects Version/s: 3.1.2.2, 4.0_b89_RC5
Fix Version/s: 4.1_b08

Type: Bug Priority: Major
Reporter: lsxx Assignee: Scott Oaks
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: 4_0_1-review

 Description   

During performance tests (multiple parallel threads) of our enterprise application we discovered that 62% of time is spent in org.apache.catalina.core.ApplicationContext.mergeParameters.

      • Background:
        The calls to this method have origin in JSF stack - there are calls to context.getExternalContext().getInitParameter() from
        javax.faces.component.UIComponent.pushComponentToEL
        javax.faces.component.UIComponent.popComponentFromEL
        In default JSF implementation provided with glassfish the value for UIComponent.HONOR_CURRENT_COMPONENT_ATTRIBUTES_PARAM_NAME is obtained (without caching) for each call withing these methods.
      • Source of problem:
        The mergeParameters, which is internally called from getInitParameter and getInitParameterNames(), is synchronized.
        I analysed source of this class and believe that synchronization in this area could be improved.
        The problem was discovered during tests with glassfish 3.1.1.2, but it seems that other versions including trunk are affected as well.
      • Suggested solution:
        The problem seems to be easy to fix.

This is the original body for mergeParameters:
private synchronized void mergeParameters() {
if (parametersMerged)

{ return; }

[...]

parametersMerged = true;
}

As:
- this is the only synchronized method and there no "synchronized (this)" in this class
- the field parametersMerged is assigned a value only in mergeParameters (last line) and at initialization (private volatile boolean parametersMerged = false
- after the first execution of mergeParameters the field parametersMerged will never be assigned any value (especially false) and other calls to mergeParameters are waste of time.
- the field parametersMerged is volatile
the problem could be successfully solved by moving the synchronization to inside of the method and double checking the initial condition:

private void mergeParameters() {
if (parametersMerged) { return; }

synchronized(this){
if (parametersMerged)

{ return; }

[...]

parametersMerged = true;
}
}



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

Sending src/main/java/org/apache/catalina/core/ApplicationContext.java
Transmitting file data .
Committed revision 63266.

Comment by lsxx [ 08/Aug/14 ]

The bug is not fixed - the introduced change has no effect as long the method mergeParameters is still synchronized.
Adding "sychnronized(this)"-block within synchronized method has no effect.

Comment by Sergiy_Rezvan [ 26/Feb/15 ]

I have had the same problem. This bug can be fixed by using the double-checked locking pattern.
It looks like:
org.apache.catalina.ApplicationContext

public class ApplicationContext implements ServletContext {
....
private volatile Object lockObject = new Object();
....
private void mergeParameters()
{
if (!this.parametersMerged) {
synchronized (this.lockObject) {
if (!this.parametersMerged) {
for (String name : this.context.findParameters())

{ this.parameters.put(name, this.context.findParameter(name)); }

List<ApplicationParameter> params = this.context.findApplicationParameters();
Iterator<ApplicationParameter> i = params.iterator();
while (i.hasNext())
{
ApplicationParameter param = (ApplicationParameter)i.next();
if (param.getOverride())
{
if (this.parameters.get(param.getName()) == null)

{ this.parameters.put(param.getName(), param.getValue()); }

}
else

{ this.parameters.put(param.getName(), param.getValue()); }

}
this.parametersMerged = true;
}
}
}
}

Could you please check this approach and give me feedback that everything is okay?
I have tested it and now I don't have this problem, but I want to be sure that it is correct.

Comment by Yury_Morozov [ 02/Mar/15 ]

The bug hasn't been fixed in any version, the method mergeParameters is still synchronized and blocks all threads.
Solution above fixes the problem. Please, include this in your next release.

Comment by Shing Wai Chan [ 03/Apr/15 ]

Tomcat 7 has a different fix on this issue by moving the merging parameters logic into the beginning of the life cycle.
Sending org/apache/catalina/core/ApplicationContext.java
Sending org/apache/catalina/core/StandardContext.java
Transmitting file data ..
Committed revision 63827.





[GLASSFISH-21017] In 'asadmin change-master-password', entry of password less than 6 chars results in Exception and then domain-passwords file is corrupt and have to reinstall Created: 25/Mar/14  Updated: 02/Apr/15  Resolved: 02/Apr/15

Status: Resolved
Project: glassfish
Component/s: admin
Affects Version/s: 3.1.2.2
Fix Version/s: 4.2

Type: Bug Priority: Minor
Reporter: everettrj Assignee: Vinay Vishal
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 7


Issue Links:
Relates
relates to GLASSFISH-21282 In 'asadmin change-master-password', ... Open
Tags: javaee_ri_fix, payara

 Description   

1. Called 'asadmin change-master-password --savemasterpassword=true <domain_name>'
2. Entered 'changeit' as existing password
3. Entered a new password of less than 6 characters (and then again)
4. Got:
keytool error: java.lang.Exception: Too many failures - try later
Enter keystore password: New keystore password: Password is too short - must be at least 6 characters
New keystore password: Password is too short - must be at least 6 characters
New keystore password: Password is too short - must be at least 6 characters

5. Repeated change-master-password, but with longer length new password
6. Got:
Keystore was tampered with, or password was incorrect
Command change-master-password failed.
7. Cannot get out of this situation - have to either restore a saved domain-passwords file (if one was preserved) or else reinstall GlassFish.



 Comments   
Comment by WilsonCheng [ 31/Dec/14 ]

In the execution of the change-master-password command, will use the Java keytool.exe to Change the password on the keystore.
this password must be at least 6 characters long.But the GF change-master-password command, do not check the password length.

The execute process of change-master-password commands are as follows:

1:Read current master password from the console, and use this code to load the cacerts.jks file
LocalServerCommand#loadAndVerifyKeystore() 220
cacerts.jks files in windows platform position:
C:\glassfish\glassfish4\glassfish\domains\domain1\config\cacerts.jks

2:The use of current master password, load domain-passwords file
PasswordAdapter() 158
The domain-passwords file in the windows platform position:
C:\glassfish\glassfish4\glassfish\domains\domain1\config\domain-passwords

3:The new password is entered into the domain-passwords file
RepositoryManager#changePasswordAliasKeystorePassword() 633

4:Use keytool.exe, enter the new password is written keystore.jks
ProcessExecutor#execute() 288
Here will use ProcessImpl to call keytool.exe,Command string as follows:
[C:/Java/jdk1.7/bin/keytool.exe, -storepasswd, -keystore, C:\glassfish\glassfish4\glassfish\domains\domain1\config\keystore.jks]
According to keytool.exe official document, when used "-storepasswd" options, the new password must be at least 6 characters long.

Solaris and Linux:
http://docs.oracle.com/javase/1.5.0/docs/tooldocs/solaris/keytool.html

windows:
http://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/keytool.html

When the new password entered by the user is less than 6, in the third step will be written to the domain-passwords file with the new password.
But then, in the fourth step, can not use this new password written keystore.jks.
GF will throw an exception in the fourth step, the termination of the execution for change-master-password commands.
At this time, domain-passwords is using the new password, but keystore.jks still use the old password,
When the user to execute change-master-password commands, no matter what the password input, will not be the password checking first and second step.

------------------

revise plan:
ChangeMasterPasswordCommandDAS#executeCommand() 120
Increase the verify password length, if less than 6 characters will throw an exception.

Comment by WilsonCheng [ 31/Dec/14 ]

ChangeMasterPasswordCommandDAS.java.patch

ChangeMasterPasswordCommandDAS.java
Index: ChangeMasterPasswordCommandDAS.java
===================================================================
--- ChangeMasterPasswordCommandDAS.java	(revision 63724)
+++ ChangeMasterPasswordCommandDAS.java	(working copy)
@@ -117,6 +117,8 @@
                     strings.get("new.mp.again"), true);
             if (nmp == null)
                 throw new CommandException(strings.get("no.console"));
+            if (nmp.length() < 6)
+                throw new CommandException(strings.get("incorrect.mp.length"));
             domainConfig.put(DomainConfig.K_MASTER_PASSWORD, mp);
             domainConfig.put(DomainConfig.K_NEW_MASTER_PASSWORD, nmp);
             domainConfig.put(DomainConfig.K_SAVE_MASTER_PASSWORD, savemp);

LocalStrings.properties.patch

LocalStrings.properties
Index: LocalStrings.properties
===================================================================
--- LocalStrings.properties	(revision 63724)
+++ LocalStrings.properties	(working copy)
@@ -131,6 +131,7 @@
 new.mp.again=Enter the new master password again
 both.domaindir.nodedir.not.allowed=You cannot specify both domaindir and nodedir together. \
 You can use one or the other.
+incorrect.mp.length=password must be at least 6 characters long.
 ################################
 serviceUser_wrong_os=The serviceuser parameter is only supported on Linux.
 create.service.badServiceName=Windows requires that the service name contain only \
Comment by zhouronghui [ 31/Dec/14 ]

It looks good. By the way, would you please check if the master-password can be changed ONLY by the change-master-password sub-command? eg. On GUI can NOT change the master-password?

Comment by jifeng [ 05/Jan/15 ]

Hi
WilsonCheng

I think The first letter of the new additional message should be capitalized.What do you think?
just like this:
incorrect.mp.length=Password must be at least 6 characters long.

Comment by Vinay Vishal [ 02/Apr/15 ]

Fix merged in Glassfish svn trunk.
Sending nucleus/admin/server-mgmt/src/main/java/com/sun/enterprise/admin/servermgmt/cli/ChangeMasterPasswordCommandDAS.java
Sending nucleus/admin/server-mgmt/src/main/java/com/sun/enterprise/admin/servermgmt/cli/LocalStrings.properties
Transmitting file data ..
Committed revision 63825.





[GLASSFISH-18926] correct a text in glassfish admin console (considering that Created: 20/Jul/12  Updated: 02/Apr/15  Resolved: 02/Apr/15

Status: Resolved
Project: glassfish
Component/s: None
Affects Version/s: 3.1.1_b05
Fix Version/s: 4.2

Type: Bug Priority: Minor
Reporter: mladenadamovic Assignee: Shaifali Kansal
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: 4 hours
Time Spent: Not Specified
Original Estimate: 4 hours
Environment:

all


Tags: admin-gui, javaee_ri_fix

 Description   

I'd like to bring you to your attention the fishy value
Network Listeners -> http-listener-1 of 250 max connections.

The text near max connections states: Maximum number of connections in
keep-alive mode
but it is actually according to Oracle.com documentation at the
website http://docs.oracle.com/cd/E19879-01/820-4343/abefr/index.html
"Max Connections controls the number of requests that a particular
client can make over a keep-alive connection. "

So glassfish console text "Maximum number of connections in keep-alive
mode" seems incorrect, it shall be written "Maximum number of requests
per connection in keep-alive mode", which is different. Perhaps
someone can check in the source code what does that value actually do
and change the description in admin console and online doc so it's not
ambiguous?



 Comments   
Comment by Shaifali Kansal [ 02/Apr/15 ]

Fixed in revision 63821.





[GLASSFISH-21255] Improved view of Complete Message field in Log Entry Detail Created: 14/Nov/14  Updated: 02/Apr/15  Resolved: 27/Mar/15

Status: Resolved
Project: glassfish
Component/s: admin_gui
Affects Version/s: 4.1
Fix Version/s: 4.2

Type: Improvement Priority: Major
Reporter: Anthony Ve Assignee: Shaifali Kansal
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: javaee_ri_fix

 Description   

When showing a Log Entry Detail (i.e. "details" in the Log Viewer), I would like the Complete Message field to wrap its contents in a <pre> tag. This would preserve whitespace (notably newlines) & allow stack traces to be more easily analyzed.



 Comments   
Comment by Shaifali Kansal [ 02/Apr/15 ]

Fixed in revision 63815.





[GLASSFISH-21179] Console Admin typo Created: 02/Sep/14  Updated: 02/Apr/15  Resolved: 27/Mar/15

Status: Resolved
Project: glassfish
Component/s: admin_gui
Affects Version/s: 4.1
Fix Version/s: 4.2

Type: Improvement Priority: Trivial
Reporter: David Delabassee Assignee: Shaifali Kansal
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Not Applicable


Tags: javaee_ri_fix

 Description   

The 1st tab of "Domain is "Domain Attributes Tab", should be "Domain Attributes" instead



 Comments   
Comment by doobrie [ 12/Feb/15 ]

I've created a patch for this issue.

Thanks.

Index: appserver/admingui/common/src/main/resources/appServer/domainTabs.inc
===================================================================
— appserver/admingui/common/src/main/resources/appServer/domainTabs.inc (revision 63769)
+++ appserver/admingui/common/src/main/resources/appServer/domainTabs.inc (working copy)
@@ -2,7 +2,7 @@

DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.

  • Copyright (c) 2010-2012 Oracle and/or its affiliates. All rights reserved.
    + Copyright (c) 2010-2015 Oracle and/or its affiliates. All rights reserved.

The contents of this file are subject to the terms of either the GNU
General Public License Version 2 only ("GPL") or the Common Development
@@ -43,7 +43,7 @@
<!-- appServer/domainTabs.jsf -->

<sun:tabSet id="domainTabs" immediate="true" selected="#

{sessionScope.domainTabs}

">

  • <sun:tab id="domainAttrs" immediate="true" text="$resource {i18n.headings.DomainAttributesTab}" toolTip="$resource{i18n.headings.DomainAttributesTab}

    ">
    + <sun:tab id="domainAttrs" immediate="true" text="$resource

    {i18n.headings.DomainAttributes}

    " toolTip="$resource

    {i18n.headings.DomainAttributesTab}

    ">
    <!command
    setSessionAttribute(key="domainTabs" value="domainAttrs");
    gf.redirect(page="#

    {request.contextPath}

    /common/appServer/serverInstDomainAttrs.jsf");

Comment by Shaifali Kansal [ 02/Apr/15 ]

Fixed in revision 63804.





[GLASSFISH-21334] JDK 9 - quicklook tests are broken Created: 19/Mar/15  Updated: 02/Apr/15

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

Type: Bug Priority: Major
Reporter: Arindam Bandyopadhyay Assignee: Arindam Bandyopadhyay
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

ALL


Tags: javaee_ri_fix, jdk9-int

 Description   

I am getting the following exception when I am running the quicklook test in JDK9

Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (default-test) on project quicklook: Execution default-test of goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run failed: Plugin org.apache.maven.plugins:maven-antrun-plugin:1.7 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools-jar:jar:1 at specified path /usr/lib/jvm/jdk1.9.0/../lib/tools.jar

In the pom.xml of quicklook project we have the following plugin

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.7</version>

maven-antrun-plugin internally uses tools.jar which is removed in JDK 9 as part of JEPS220.



 Comments   
Comment by Arindam Bandyopadhyay [ 19/Mar/15 ]

The related maven issue is https://jira.codehaus.org/browse/MNG-5732





[GLASSFISH-21236] Glassfish 4.1 won't start with JDK 9 build Created: 15/Oct/14  Updated: 02/Apr/15  Resolved: 10/Mar/15

Status: Resolved
Project: glassfish
Component/s: None
Affects Version/s: 4.1
Fix Version/s: 4.2

Type: Bug Priority: Major
Reporter: alan.bateman Assignee: Arindam Bandyopadhyay
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Dependency
depends on GLASSFISH-21321 JDK9 - Need to update felix.jar Closed
Related
is related to GLASSFISH-21317 Glassfish 4.1 is giving NullPointerEx... Resolved
is related to GLASSFISH-21318 JDK 9 - Removal of ext dir and endors... In Progress
Tags: javaee_ri_fix, jdk9-int

 Description   

It's not currently possible to start Glassfish 4.1 on JDK 9 builds. To start with then domain.xml still lists the MaxPermSize option, this has been removed in JDK 9. After that we get the following error (note that osgi.properties has jre-1.9 defined, this was missing in Glassfish 4.0).

com.sun.enterprise.module.ResolveError: Failed to start OSGiModuleImpl:: Bundle = [org.glassfish.main.admin.rest-service [182]], State = [NEW]
at org.jvnet.hk2.osgiadapter.OSGiModuleImpl.start(OSGiModuleImpl.java:218)
at org.jvnet.hk2.osgiadapter.OsgiPopulatorPostProcessor$1.loadClass(OsgiPopulatorPostProcessor.java:77)
at org.jvnet.hk2.internal.ServiceLocatorImpl.loadClass(ServiceLocatorImpl.java:2058)
at org.jvnet.hk2.internal.ServiceLocatorImpl.reifyDescriptor(ServiceLocatorImpl.java:413)
at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2223)
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:105)
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:87)
at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:1162)
at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:1147)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.osgi.framework.BundleException: Unresolved constraint in bundle org.glassfish.main.admin.rest-service [182]: Unable to resolve 182.0: missing requirement [182.0] osgi.wiring.package; (&(osgi.wiring.package=javax.ws.rs)(version>=2.0.0)(!(version>=3.0.0))) [caused by: Unable to resolve 200.0: missing requirement [200.0] osgi.ee; (&(osgi.ee=JavaSE)(version=1.6))]
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3974)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2037)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)
at org.jvnet.hk2.osgiadapter.OSGiModuleImpl.start(OSGiModuleImpl.java:210)
... 11 more



 Comments   
Comment by alan.bateman [ 15/Oct/14 ]

See also GLASSFISH-21158 for an issue starting Glassfish 4.0 on JDK 9.

Comment by AntonIvanov [ 23/Oct/14 ]

I guess the linked issue should be GLASSFISH-21158

Comment by Arindam Bandyopadhyay [ 25/Feb/15 ]

Basic Analysis --->
In order to reproduce the issue we need to delete 3 JVM options from domain.xml.
<jvm-options>-XX:MaxPermSize=192m</jvm-options>
<jvm-options>-Djava.endorsed.dirs=$

{com.sun.aas.installRoot}/modules/endorsed${path.separator}${com.sun.aas.installRoot}

/lib/endorsed</jvm-options>
<jvm-options>-Djava.ext.dirs=$

{com.sun.aas.javaRoot}/lib/ext${path.separator}${com.sun.aas.javaRoot}

/jre/lib/ext$

{path.separator}

$

{com.sun.aas.instanceRoot}

/lib/ext</jvm-options>
The reason behind this is as per JEP 220 JDK 9 deleted the above 3 jvm option. If we keep those 3 JVM option jvm will not start up.
When we run glassfish with JDK 9 after deleting the above 3 JVM options we are getting the following two exceptions

Exception 1 --->

Exception occurred while satisfying optional package dependencies
java.lang.NullPointerException
at java.util.StringTokenizer.<init>(StringTokenizer.java:199)
at java.util.StringTokenizer.<init>(StringTokenizer.java:221)
at
org.glassfish.deployment.common.InstalledLibrariesResolver.initializeInstalledLibRegistryForExtDirs(InstalledLibrariesResolver.java:140)
at
org.glassfish.deployment.common.InstalledLibrariesResolver.initializeInstalledLibRegistry(InstalledLibrariesResolver.java:131)
at
com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:163)
at
org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:329)
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:377)
at
org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:471)
at
org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:227)
at
org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:84)
at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2064)
at
org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:105)
at
org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:87)
at
org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:1223)
at
org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:1154)
at
org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$UpOneLevel.run(CurrentTaskFuture.java:754)
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

#]

Exception 2 --->

com.sun.enterprise.module.ResolveError: Failed to start OSGiModuleImpl:: Bundle = [org.glassfish.main.admin.rest-service [182]], State = [NEW]
at org.jvnet.hk2.osgiadapter.OSGiModuleImpl.start(OSGiModuleImpl.java:218)
at org.jvnet.hk2.osgiadapter.OsgiPopulatorPostProcessor$1.loadClass(OsgiPopulatorPostProcessor.java:77)
at org.jvnet.hk2.internal.ServiceLocatorImpl.loadClass(ServiceLocatorImpl.java:2058)
at org.jvnet.hk2.internal.ServiceLocatorImpl.reifyDescriptor(ServiceLocatorImpl.java:413)
at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2223)
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:105)
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:87)
at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:1162)
at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:1147)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.osgi.framework.BundleException: Unresolved constraint in bundle org.glassfish.main.admin.rest-service [182]: Unable to resolve 182.0: missing requirement [182.0] osgi.wiring.package; (&(osgi.wiring.package=javax.ws.rs)(version>=2.0.0)(!(version>=3.0.0))) [caused by: Unable to resolve 200.0: missing requirement [200.0] osgi.ee; (&(osgi.ee=JavaSE)(version=1.6))]
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3974)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2037)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)
at org.jvnet.hk2.osgiadapter.OSGiModuleImpl.start(OSGiModuleImpl.java:210)

Root cause For exception 1 --->

In JDK 9 system property java.ext.dirs is deleted.In glassfish code we used system property java.ext.dirs . As a result we are getting null pointer exception.
However this exception does not prevent the glassfish server to start up.
We are working to fix it.

Root Cause for Exception 2 --->

The exception 2 is a apache felix issue . Glassfish uses apache felix as a OSGI container.Felix default.property does not define eecap-1.9 .default.property file under felix.jar should contain the following entry
eecap-1.9= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9"
This entry is needed to resolve the Require-Capability osgi.ee if we run using JDK 9.
I have patched the jar and replaced the glassfish $

{com.sun.aas.installRoot}

/osgi/felix/bin/felix.jar to test this fix in my local environment. With this fix the server successfully starts up.
I have logged a felix issue FELIX-4808 .
We can have a work around to add the modified felix.jar in glassfish local /private repositoty .

Comment by Romain Grécourt [ 25/Feb/15 ]

can this property be defined under glassfish4/glassfish/config/osgi.properties ?

Comment by alan.bateman [ 25/Feb/15 ]

The MaxPermSize option is for JDK 7 and older, it was obsoleted in JDK 8 and is slated to cease being accepted in JDK 9.

It would be useful to know what Glassfish is/was doing with java.ext.dirs. For java.endorsed.dirs then it would be useful to know which components are in this specified directories. Is it mostly JAX-*? We expect a better mechanism for provide upgraded versions of EE APIs later in JDK 9.

Comment by Arindam Bandyopadhyay [ 25/Feb/15 ]

Hi Romain,
I tried to define the property under glassfish4/glassfish/config/osgi.properties . However that does not solve the issue . We are getting the same exception and server is not starting up .

Comment by Arindam Bandyopadhyay [ 26/Feb/15 ]

External directory usage in glassfish ---->

As per my understanding glassfish is checking whether the optional packages have all their internal dependencies resolved . In order to do that it is getting the list of ext directories using System.getProperty("java.ext.dirs") and checking whether the optional packages have all their internal dependencies resolved.
However my observation is even if we don't supply the list of external directory(that is, if System.getProperty("java.ext.dirs") is resolved to null) glassfish is successfully starting up.I have tested this behaviour for JDK7 , JDK 8 and JDK 9.So even if we don't supply the list of ext directory as JVM option , glassfish is successfully starting up.

Endorsed directory usage in glassfish ---->

The following componets are in

{com.sun.aas.installRoot}

/modules/endorsed directory
1.javax.annotation-api.jar
2.jaxb-api.jar
3.webservices-api-osgi.jar

the list of endorsed packages are
endorsed-standard-packages=\
javax.annotation, \
javax.xml.bind, \
javax.xml.bind.annotation, \
javax.xml.bind.annotation.adapters, \
javax.xml.bind.attachment, \
javax.xml.bind.helpers, \
javax.xml.bind.util, \
javax.jws, \
javax.jws.soap, \
javax.xml.ws, \
javax.xml.ws.handler, \
javax.xml.ws.handler.soap, \
javax.xml.ws.http, \
javax.xml.ws.soap, \
javax.xml.ws.spi, \
javax.xml.ws.wsaddressing

My observation is that glassfish is successfully resolving the list of endorsed components even if we remove the JVM option Djava.endorsed.dirs from domain.xml.Glassfish is resolving the endorsed componets from glassfish4/glassfish/config/osgi.properties file.So even if JVM option Djava.endorsed.dirs is resolved to null , glassfish is successfully starting up. I have tested this behaviour for JDK7 , JDK 8 and JDK 9.

Romain ,
Could you validate my understanding.

Comment by Romain Grécourt [ 26/Feb/15 ]

This property (enforsed-standard-packages) seems to be only used by some acc/jws code (JWSAppClientContainerMain).

Currently the differences between endorsed jars / jdks should be very small. Removing endorsed dirs may not prevent GF from starting-up.

Comment by Arindam Bandyopadhyay [ 06/Mar/15 ]

Roman,
Previously I tried to add the following in the glassfish4/glassfish/config/osgi.properties.
--------------------------------------
eecap-1.9= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9"
----------------------------------------
It didn't fix the issue. Now I tried to add the following entry in glassfish4/glassfish/config/osgi.properties.
--------------------------------------------
org.osgi.framework.system.capabilities= \
${eecap-${java.specification.version}}

eecap-1.9= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9"
eecap-1.8= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8"
eecap-1.7= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7"
eecap-1.6= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6"
eecap-1.5= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5"
eecap-1.4= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4"
eecap-1.3= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1", \
osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3"
eecap-1.2= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1", \
osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2"
-------------------------------------------
It successfully fix the issue.
I am going to update the main/nucleus/osgi-platforms/felix/src/main/resources/config/osgi.properties file to incorporate the change .
Thanks Romain for all your help.

Comment by Arindam Bandyopadhyay [ 09/Mar/15 ]

As suggested by Sahoo we don't support GF on JDK version < 1.7 I am removing entries starting with eecap-1.6. The updated entries in glassfish4/glassfish/config/osgi.properties would be
----------------------------------------------------------
org.osgi.framework.system.capabilities= \
${eecap-${java.specification.version}}

eecap-1.9= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9"
eecap-1.8= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8"
eecap-1.7= osgi.ee; osgi.ee="OSGi/Minimum"; version:List<Version>="1.0,1.1,1.2", \
osgi.ee; osgi.ee="JavaSE"; version:List<Version>="1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7"

Comment by Arindam Bandyopadhyay [ 10/Mar/15 ]

Committed in trunk/main.Committed in revision 63790.





[GLASSFISH-21318] JDK 9 - Removal of ext dir and endorsed dir jvm option from domain.xml Created: 26/Feb/15  Updated: 02/Apr/15

Status: In Progress
Project: glassfish
Component/s: configuration
Affects Version/s: 4.1
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: Arindam Bandyopadhyay Assignee: Arindam Bandyopadhyay
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to GLASSFISH-21236 Glassfish 4.1 won't start with JDK 9 ... Resolved
Tags: javaee_ri_fix, jdk9-int

 Description   

I was fixing GLASSFISH-21236 - Glassfish startup issue with JDK 9. In order to start glassfish in JDK 9 we need to remove the -XX:MaxPermSize,-Djava.endorsed.dirs and -Djava.ext.dirs jvm options from the domain.xml.
I observed that even if we remove the above 3 jvm options from domain.xml , glassfish successfully starts up.I tested this for JVM 7, JVM 8 and JVM 9. In all the jvm glassfish successfully starts up without the above 3 jvm options .
Now my question is whether those 3 JVM options are currently required or we can safely remove them from domain.xml in future releases . Does any modules other than start up depends on them.



 Comments   
Comment by Arindam Bandyopadhyay [ 27/Mar/15 ]

Run the static analysis tool JDEPS on GF 4.1 .Found no static dependency on JDK/jre/lib/ext directory . However found a lot of instances where GF is using JDK internal api which will be non accessible(private module) in JDK 9.





[GLASSFISH-21219] SingleSignOnEntry uses session.hashCode, which may change Created: 30/Sep/14  Updated: 02/Apr/15

Status: In Progress
Project: glassfish
Component/s: web_container
Affects Version/s: 4.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: dmatej Assignee: Arindam Bandyopadhyay
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: 1 hour
Time Spent: Not Specified
Original Estimate: 1 hour

Tags: javaee_ri_fix, payara, review-blk, serialization, sso

 Description   

Since all Session implementations I have seen do not implement their own hashCode, so the value may change in time (depending on JVM).
Session is serializable, so serialization is one possible scenario.

protected Set<Session> sessions = new HashSet<Session>();

Similar things in Glassfish obviously use hash maps where the key is session id.



 Comments   
Comment by dmatej [ 06/Oct/14 ]

Apache version: http://svn.apache.org/repos/asf/tomcat/trunk/java/org/apache/catalina/authenticator/SingleSignOnEntry.java
My fixed version based on Glassfish: https://github.com/dmatej/Glassfish/commit/d8014d716c054bcab784bd08e35eaea5c9de4fcc

Comment by dmatej [ 14/Oct/14 ]

Two patches to apply to SVN:

commit 6984a431d154c4c9134b3b432f29ed5665c5f9cb
Author: David Matejcek <david.matejcek@i.cz>
Date:   Tue Sep 30 16:06:59 2014 +0200

    GLASSFISH-21219 Using HashMap instead of HashSet
    
    - Session.hashCode may change

diff --git a/main/appserver/web/web-core/src/main/java/org/apache/catalina/authenticator/SingleSignOnEntry.java b/main/appserver/web/web-core/src/main/java/org/apache/catalina/authenticator/SingleSignOnEntry.java
index 12c9751..006b685 100644
--- a/main/appserver/web/web-core/src/main/java/org/apache/catalina/authenticator/SingleSignOnEntry.java
+++ b/main/appserver/web/web-core/src/main/java/org/apache/catalina/authenticator/SingleSignOnEntry.java
@@ -58,38 +58,39 @@
 
 package org.apache.catalina.authenticator;
 
-import org.apache.catalina.Session;
-import org.apache.catalina.core.StandardServer;
-
 import java.security.Principal;
-import java.util.HashSet;
-import java.util.Set;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
+import org.apache.catalina.Session;
+import org.apache.catalina.core.StandardServer;
+
 /**
- * A private class representing entries in the cache of authenticated users.
+ * A class representing entries in the cache of authenticated users.
  */
 public class SingleSignOnEntry {
 
     private static final Logger log = StandardServer.log;
 
-    protected String id = null;
+    protected final String id;
 
-    protected String authType = null;
+    protected final String authType;
 
-    protected Principal principal = null;
+    /** Reset by HASingleSignOnEntry */
+    protected Principal principal;
 
-    protected Set<Session> sessions = new HashSet<Session>();
+    protected final Map<String, Session> sessions = new HashMap<String, Session>();
 
-    protected String username = null;
+    protected final String username;
 
-    protected String realmName = null;
+    protected final String realmName;
 
     protected long lastAccessTime;
 
-    protected AtomicLong version = null;
+    protected final AtomicLong version;
 
     public SingleSignOnEntry(String id, long ver,
                              Principal principal, String authType,
@@ -107,20 +108,20 @@ public class SingleSignOnEntry {
     /**
      * Adds the given session to this SingleSignOnEntry if it does not
      * already exist.
-     * 
+     *
      * @return true if the session was added, false otherwise
      */
     public synchronized boolean addSession(SingleSignOn sso, Session session) {
-        boolean result = sessions.add(session);
-        if (result) {
+        final Session oldEntry = sessions.put(session.getId(), session);
+        if (oldEntry == null) {
             session.addSessionListener(sso);
         }
-
-        return true;
+        return oldEntry == null;
     }
 
     public synchronized void removeSession(Session session) {
-        sessions.remove(session);
+        final Session removed = sessions.remove(session.getId());
+        log.warning("session " + session.getId() + "found (and removed): " + removed);
     }
 
 
@@ -132,7 +133,7 @@ public class SingleSignOnEntry {
      * associated with it, and false otherwise
      */
     public synchronized boolean isEmpty() {
-        return (sessions.size() == 0);
+        return sessions.isEmpty();
     }
 
 
@@ -141,23 +142,16 @@ public class SingleSignOnEntry {
      *
      */
     public synchronized void expireSessions() {
-        for (Session session: sessions) {
+        for (Session session: sessions.values()) {
             if (log.isLoggable(Level.FINE)) {
-
                 log.log(Level.FINE, " Invalidating session " + session);
             }
-        
-            //6406580 START
-            /*
-            // Invalidate this session
-            session.expire();
-             */
+
             // Invalidate this session
             // if it is not already invalid(ated)
-            if( (session).getIsValid() ) {
+            if(session.getIsValid() ) {
                 session.expire();
             }
-            //6406580 END
         }
     }
commit 128644b6a890f9959a3e641f4c27e8022c192899
Author: David Matejcek <david.matejcek@i.cz>
Date:   Tue Oct 14 12:08:24 2014 +0200

    GLASSFISH-21219 Using HashMap instead of HashSet (HA/SSO)

diff --git a/main/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/authenticator/HASingleSignOnEntry.java b/main/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/authenticator/HASingleSignOnEntry.java
index c9a7025..7d0cedc 100644
--- a/main/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/authenticator/HASingleSignOnEntry.java
+++ b/main/appserver/web/web-ha/src/main/java/org/glassfish/web/ha/authenticator/HASingleSignOnEntry.java
@@ -91,7 +91,7 @@ public class HASingleSignOnEntry extends SingleSignOnEntry {
                 throw new IllegalStateException("Cannot find the session: " + data.getSessionId(), ex);
             }
             if (session != null) {
-              sessions.add(session);
+              sessions.put(data.getSessionId(), session);
             }
         }
         logger.log(Level.FINER, "Loaded HA SSO entry from metadata. Principal: {}", this.principal);
Comment by dmatej [ 30/Oct/14 ]

Note: patch depends on patches in GLASSFISH-21148

Comment by dmatej [ 06/Nov/14 ]

Patches applied in Payara: https://github.com/payara/Payara/commit/f87a306cf64b6d0d434a40a7b61753012bd27f19

Comment by Arindam Bandyopadhyay [ 09/Mar/15 ]

I was working on to incorporate the patch to svn.
Is there a set of test case which I can run to validate the patch ?

Comment by prasads [ 02/Apr/15 ]

It is a structural bug . Waiting for test-case from Shing Wai Chan to validate the fix





[GLASSFISH-21007] HTTP Upgrade handler init called twice when access log is turned on Created: 17/Mar/14  Updated: 02/Apr/15

Status: In Progress
Project: glassfish
Component/s: web_container
Affects Version/s: 4.1
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: mreichman Assignee: Arindam Bandyopadhyay
Resolution: Unresolved Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Glassfish 4.0.1b4 Promoted, Windows 7 x64, JDK 1.7.0_51


Issue Links:
Blocks
blocks TYRUS-306 java.lang.IllegalStateException: Alre... Open
Dependency
blocks TYRUS-306 java.lang.IllegalStateException: Alre... Open
Tags: javaee_ri_fix, payara, review-blk

 Description   

When HTTP access logging is turned on, the init method of HttpUpgradeHandler implementations is called twice at upgrade-time. I'd previously filed TYRUS-306 for this, the necessary information, test components to reproduce are in that ticket. In the Tyrus case, the effect is that two websockets are created for one request which creates management difficulty and potential leaks.



 Comments   
Comment by smillidge-c2b2 [ 12/Jan/15 ]

A suggested fix for this is here
https://github.com/payara/Payara/commit/4b0951d503e416813cc4fba82edd2d60e8a77a53

Comment by prasads [ 02/Apr/15 ]

Pending Review from Amy Roh and Shing Wai Chan





[GLASSFISH-21335] Using activated remote ejb throwing java.rmi.RemoteException: CORBA BAD_OPERATION 0 No; Created: 24/Mar/15  Updated: 01/Apr/15

Status: Open
Project: glassfish
Component/s: ejb_container, orb
Affects Version/s: 4.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: jjsnyder83 Assignee: russgold
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File 774a67a8-25bc-4597-a426-c72b3f28b741.war     Java Archive File EjbInjectionTest-source.jar    

 Description   

A cdi tck test org.jboss.cdi.tck.tests.implementation.simple.resource.ejb.EjbInjectionTest
uses com.sun.enterprise.container.common.impl.util.JavaEEIOUtilsImpl to passivate and activate a remote ejb. After the ejb is activated when a method on the ejb is executed the following exception is thrown:
Caused by: java.rmi.RemoteException: CORBA BAD_OPERATION 0 No; nested exception is:
org.omg.CORBA.BAD_OPERATION: The delegate has not been set! vmcid: 0x0 minor code: 0 completed: No
at com.sun.corba.ee.impl.javax.rmi.CORBA.Util.mapSystemException(Util.java:310)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:134)
at com.sun.corba.ee.impl.presentation.rmi.codegen.CodegenStubBase.invoke(CodegenStubBase.java:226)
at org.jboss.cdi.tck.tests.implementation.simple.resource.ejb._BeanRemote_Remote_DynamicStub.knockKnock(org/jboss/cdi/tck/tests/implementation/simple/resource/ejb/_BeanRemote_Remote_DynamicStub.java)
... 107 more
Caused by: org.omg.CORBA.BAD_OPERATION: The delegate has not been set! vmcid: 0x0 minor code: 0 completed: No
at org.omg.CORBA.portable.ObjectImpl._get_delegate(ObjectImpl.java:71)
at com.sun.corba.ee.spi.presentation.rmi.StubAdapter.getDelegate(StubAdapter.java:175)
at com.sun.corba.ee.impl.presentation.rmi.StubInvocationHandlerImpl.invoke(StubInvocationHandlerImpl.java:132)
... 109 more
...

I will upload a test app with source shortly



 Comments   
Comment by jjsnyder83 [ 24/Mar/15 ]

To reproduce the exception follow these directions. The exception gets swallowed and does not get output so you must use a debugger:

Comment by jjsnyder83 [ 24/Mar/15 ]

Note this must be run with Weld 2.2.9.Final or 2.2.10.Final which I will get in very soon.





[GLASSFISH-21342] ClassNotFoundException for all JSF annotated classes Created: 31/Mar/15  Updated: 31/Mar/15

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

Type: Bug Priority: Major
Reporter: timweller Assignee: Joe Di Pol
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

ClassNotFoundExceptions are logged for each annotated JSF class (renderers, validators, converters, etc.). Application however deploys fine and is usable in both cases.

I'm running an EAR setup with an EJB module, multiple WAR modules and JAR modules.



 Comments   
Comment by timweller [ 31/Mar/15 ]

Is there a way to edit the issue or add attachments? - I wanted to add the exception and a sample EAR file to reproduce the issue.





[GLASSFISH-21341] Severe: Exception while deploying the app [helloservice-war] : A MultiException has 2 exceptions. They are: Created: 30/Mar/15  Updated: 30/Mar/15

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

Type: Bug Priority: Major
Reporter: pavel11 Assignee: Joe Di Pol
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

windows 7, Netbeans 8.0.2, jdk1.8.0_31, GlassFish 4.1 b 13



 Comments   
Comment by pavel11 [ 30/Mar/15 ]

I try to run Java EE example from Oracle tutorial. I download java_ee_sdk-7u1-web.zip file, use GlassFish and samples from it.
the sample I work with: ..\glassfish4\docs\javaee-tutorial\examples\jaxws

When I run, it returns error, and it looks like similar to https://java.net/jira/browse/GLASSFISH-20952. Though I do not understand what to do with that.

Here stack trace

Severe: Exception while deploying the app [helloservice-war]
Severe: Exception during lifecycle processing
MultiException stack 1 of 2
com.sun.enterprise.module.ResolveError: Failed to start OSGiModuleImpl:: Bundle = [org.glassfish.main.webservices.jsr109-impl [250]], State = [NEW]
at org.jvnet.hk2.osgiadapter.OSGiModuleImpl.start(OSGiModuleImpl.java:218)
at org.jvnet.hk2.osgiadapter.OsgiPopulatorPostProcessor$1.loadClass(OsgiPopulatorPostProcessor.java:77)
at org.jvnet.hk2.internal.ServiceLocatorImpl.loadClass(ServiceLocatorImpl.java:2058)
at org.jvnet.hk2.internal.ServiceLocatorImpl.reifyDescriptor(ServiceLocatorImpl.java:413)
at org.jvnet.hk2.internal.ServiceLocatorImpl.narrow(ServiceLocatorImpl.java:2120)
at org.jvnet.hk2.internal.ServiceLocatorImpl.access$900(ServiceLocatorImpl.java:119)
at org.jvnet.hk2.internal.ServiceLocatorImpl$8.compute(ServiceLocatorImpl.java:1063)
at org.jvnet.hk2.internal.ServiceLocatorImpl$8.compute(ServiceLocatorImpl.java:1058)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture$1.call(LRUHybridCache.java:115)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture$1.call(LRUHybridCache.java:111)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture.run(LRUHybridCache.java:173)
at org.glassfish.hk2.utilities.cache.LRUHybridCache.compute(LRUHybridCache.java:292)
at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetDescriptor(ServiceLocatorImpl.java:1147)
at org.jvnet.hk2.internal.ServiceLocatorImpl.getServiceHandle(ServiceLocatorImpl.java:1395)
at org.jvnet.hk2.internal.ServiceLocatorImpl.getServiceHandle(ServiceLocatorImpl.java:1384)
at com.sun.enterprise.v3.server.ContainerStarter.startContainer(ContainerStarter.java:112)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainer(ApplicationLifecycle.java:997)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:702)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:377)
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:539)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722)
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.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:189)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.osgi.framework.BundleException: Unresolved constraint in bundle org.glassfish.main.webservices.jsr109-impl [250]: Unable to resolve 250.0: missing requirement [250.0] osgi.wiring.package; (&(osgi.wiring.package=com.sun.tools.ws.spi)(version>=2.3.0)(Unable to render embedded object: File ( Unable to resolve 257.0: missing requirement [257.0] osgi.wiring.package; (&(osgi.wiring.package=javax.xml.rpc)(version>=1.1.0)() not found.(version>=2.0.0)))]
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3974)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2037)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)
at org.jvnet.hk2.osgiadapter.OSGiModuleImpl.start(OSGiModuleImpl.java:210)
... 57 more
MultiException stack 2 of 2
java.lang.IllegalStateException: Could not load descriptor SystemDescriptor(
implementation=org.glassfish.webservices.WebServicesContainer
name=org.glassfish.webservices.WebServicesContainer
contracts=

{org.glassfish.webservices.WebServicesContainer,org.glassfish.api.container.Container}
scope=javax.inject.Singleton
qualifiers={}
descriptorType=CLASS
descriptorVisibility=NORMAL
metadata=Bundle-SymbolicName={org.glassfish.main.webservices.jsr109-impl},Bundle-Version={4.1.0}
rank=0
loader=OsgiPopulatorPostProcessor.HK2Loader(OSGiModuleImpl:: Bundle = [org.glassfish.main.webservices.jsr109-impl [250]], State = [NEW],918763885)
proxiable=null
proxyForSameScope=null
analysisName=null
id=434
locatorId=0
identityHashCode=1010978305
reified=false)
at org.jvnet.hk2.internal.ServiceLocatorImpl.loadClass(ServiceLocatorImpl.java:2067)
at org.jvnet.hk2.internal.ServiceLocatorImpl.reifyDescriptor(ServiceLocatorImpl.java:413)
at org.jvnet.hk2.internal.ServiceLocatorImpl.narrow(ServiceLocatorImpl.java:2120)
at org.jvnet.hk2.internal.ServiceLocatorImpl.access$900(ServiceLocatorImpl.java:119)
at org.jvnet.hk2.internal.ServiceLocatorImpl$8.compute(ServiceLocatorImpl.java:1063)
at org.jvnet.hk2.internal.ServiceLocatorImpl$8.compute(ServiceLocatorImpl.java:1058)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture$1.call(LRUHybridCache.java:115)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture$1.call(LRUHybridCache.java:111)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture.run(LRUHybridCache.java:173)
at org.glassfish.hk2.utilities.cache.LRUHybridCache.compute(LRUHybridCache.java:292)
at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetDescriptor(ServiceLocatorImpl.java:1147)
at org.jvnet.hk2.internal.ServiceLocatorImpl.getServiceHandle(ServiceLocatorImpl.java:1395)
at org.jvnet.hk2.internal.ServiceLocatorImpl.getServiceHandle(ServiceLocatorImpl.java:1384)
at com.sun.enterprise.v3.server.ContainerStarter.startContainer(ContainerStarter.java:112)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainer(ApplicationLifecycle.java:997)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:702)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:377)
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:539)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722)
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.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:189)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745)

Severe: Exception while deploying the app [helloservice-war] : A MultiException has 2 exceptions. They are:
1. com.sun.enterprise.module.ResolveError: Failed to start OSGiModuleImpl:: Bundle = [org.glassfish.main.webservices.jsr109-impl [250]], State = [NEW]
2. java.lang.IllegalStateException: Could not load descriptor SystemDescriptor(
implementation=org.glassfish.webservices.WebServicesContainer
name=org.glassfish.webservices.WebServicesContainer
contracts={org.glassfish.webservices.WebServicesContainer,org.glassfish.api.container.Container}

scope=javax.inject.Singleton
qualifiers={}
descriptorType=CLASS
descriptorVisibility=NORMAL
metadata=Bundle-SymbolicName=

{org.glassfish.main.webservices.jsr109-impl},Bundle-Version={4.1.0}
rank=0
loader=OsgiPopulatorPostProcessor.HK2Loader(OSGiModuleImpl:: Bundle = [org.glassfish.main.webservices.jsr109-impl [250]], State = [NEW],918763885)
proxiable=null
proxyForSameScope=null
analysisName=null
id=434
locatorId=0
identityHashCode=1010978305
reified=false)
com.sun.enterprise.module.ResolveError: Failed to start OSGiModuleImpl:: Bundle = [org.glassfish.main.webservices.jsr109-impl [250]], State = [NEW]
at org.jvnet.hk2.osgiadapter.OSGiModuleImpl.start(OSGiModuleImpl.java:218)
at org.jvnet.hk2.osgiadapter.OsgiPopulatorPostProcessor$1.loadClass(OsgiPopulatorPostProcessor.java:77)
at org.jvnet.hk2.internal.ServiceLocatorImpl.loadClass(ServiceLocatorImpl.java:2058)
at org.jvnet.hk2.internal.ServiceLocatorImpl.reifyDescriptor(ServiceLocatorImpl.java:413)
at org.jvnet.hk2.internal.ServiceLocatorImpl.narrow(ServiceLocatorImpl.java:2120)
at org.jvnet.hk2.internal.ServiceLocatorImpl.access$900(ServiceLocatorImpl.java:119)
at org.jvnet.hk2.internal.ServiceLocatorImpl$8.compute(ServiceLocatorImpl.java:1063)
at org.jvnet.hk2.internal.ServiceLocatorImpl$8.compute(ServiceLocatorImpl.java:1058)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture$1.call(LRUHybridCache.java:115)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture$1.call(LRUHybridCache.java:111)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture.run(LRUHybridCache.java:173)
at org.glassfish.hk2.utilities.cache.LRUHybridCache.compute(LRUHybridCache.java:292)
at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetDescriptor(ServiceLocatorImpl.java:1147)
at org.jvnet.hk2.internal.ServiceLocatorImpl.getServiceHandle(ServiceLocatorImpl.java:1395)
at org.jvnet.hk2.internal.ServiceLocatorImpl.getServiceHandle(ServiceLocatorImpl.java:1384)
at com.sun.enterprise.v3.server.ContainerStarter.startContainer(ContainerStarter.java:112)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainer(ApplicationLifecycle.java:997)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:702)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:377)
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:539)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722)
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.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:189)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.osgi.framework.BundleException: Unresolved constraint in bundle org.glassfish.main.webservices.jsr109-impl [250]: Unable to resolve 250.0: missing requirement [250.0] osgi.wiring.package; (&(osgi.wiring.package=com.sun.tools.ws.spi)(version>=2.3.0)(Unable to render embedded object: File ( Unable to resolve 257.0: missing requirement [257.0] osgi.wiring.package; (&(osgi.wiring.package=javax.xml.rpc)(version>=1.1.0)() not found.(version>=2.0.0)))]
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3974)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2037)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)
at org.jvnet.hk2.osgiadapter.OSGiModuleImpl.start(OSGiModuleImpl.java:210)
... 57 more

Info: visiting unvisited references
Severe: Exception while deploying the app [helloservice-war]
Severe: Exception during lifecycle processing
MultiException stack 1 of 2
com.sun.enterprise.module.ResolveError: Failed to start OSGiModuleImpl:: Bundle = [org.glassfish.main.webservices.jsr109-impl [250]], State = [NEW]
at org.jvnet.hk2.osgiadapter.OSGiModuleImpl.start(OSGiModuleImpl.java:218)
at org.jvnet.hk2.osgiadapter.OsgiPopulatorPostProcessor$1.loadClass(OsgiPopulatorPostProcessor.java:77)
at org.jvnet.hk2.internal.ServiceLocatorImpl.loadClass(ServiceLocatorImpl.java:2058)
at org.jvnet.hk2.internal.ServiceLocatorImpl.reifyDescriptor(ServiceLocatorImpl.java:413)
at org.jvnet.hk2.internal.ServiceLocatorImpl.narrow(ServiceLocatorImpl.java:2120)
at org.jvnet.hk2.internal.ServiceLocatorImpl.access$900(ServiceLocatorImpl.java:119)
at org.jvnet.hk2.internal.ServiceLocatorImpl$8.compute(ServiceLocatorImpl.java:1063)
at org.jvnet.hk2.internal.ServiceLocatorImpl$8.compute(ServiceLocatorImpl.java:1058)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture$1.call(LRUHybridCache.java:115)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture$1.call(LRUHybridCache.java:111)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture.run(LRUHybridCache.java:173)
at org.glassfish.hk2.utilities.cache.LRUHybridCache.compute(LRUHybridCache.java:292)
at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetDescriptor(ServiceLocatorImpl.java:1147)
at org.jvnet.hk2.internal.ServiceLocatorImpl.getServiceHandle(ServiceLocatorImpl.java:1395)
at org.jvnet.hk2.internal.ServiceLocatorImpl.getServiceHandle(ServiceLocatorImpl.java:1384)
at com.sun.enterprise.v3.server.ContainerStarter.startContainer(ContainerStarter.java:112)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainer(ApplicationLifecycle.java:997)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:702)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:377)
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:539)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722)
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.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:189)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.osgi.framework.BundleException: Unresolved constraint in bundle org.glassfish.main.webservices.jsr109-impl [250]: Unable to resolve 250.0: missing requirement [250.0] osgi.wiring.package; (&(osgi.wiring.package=com.sun.tools.ws.spi)(version>=2.3.0)(Unable to render embedded object: File ( Unable to resolve 257.0: missing requirement [257.0] osgi.wiring.package; (&(osgi.wiring.package=javax.xml.rpc)(version>=1.1.0)() not found.(version>=2.0.0)))]
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3974)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2037)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)
at org.jvnet.hk2.osgiadapter.OSGiModuleImpl.start(OSGiModuleImpl.java:210)
... 57 more
MultiException stack 2 of 2
java.lang.IllegalStateException: Could not load descriptor SystemDescriptor(
implementation=org.glassfish.webservices.WebServicesContainer
name=org.glassfish.webservices.WebServicesContainer
contracts={org.glassfish.webservices.WebServicesContainer,org.glassfish.api.container.Container}
scope=javax.inject.Singleton
qualifiers={}
descriptorType=CLASS
descriptorVisibility=NORMAL
metadata=Bundle-SymbolicName={org.glassfish.main.webservices.jsr109-impl}

,Bundle-Version=

{4.1.0}
rank=0
loader=OsgiPopulatorPostProcessor.HK2Loader(OSGiModuleImpl:: Bundle = [org.glassfish.main.webservices.jsr109-impl [250]], State = [NEW],918763885)
proxiable=null
proxyForSameScope=null
analysisName=null
id=434
locatorId=0
identityHashCode=1010978305
reified=false)
at org.jvnet.hk2.internal.ServiceLocatorImpl.loadClass(ServiceLocatorImpl.java:2067)
at org.jvnet.hk2.internal.ServiceLocatorImpl.reifyDescriptor(ServiceLocatorImpl.java:413)
at org.jvnet.hk2.internal.ServiceLocatorImpl.narrow(ServiceLocatorImpl.java:2120)
at org.jvnet.hk2.internal.ServiceLocatorImpl.access$900(ServiceLocatorImpl.java:119)
at org.jvnet.hk2.internal.ServiceLocatorImpl$8.compute(ServiceLocatorImpl.java:1063)
at org.jvnet.hk2.internal.ServiceLocatorImpl$8.compute(ServiceLocatorImpl.java:1058)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture$1.call(LRUHybridCache.java:115)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture$1.call(LRUHybridCache.java:111)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture.run(LRUHybridCache.java:173)
at org.glassfish.hk2.utilities.cache.LRUHybridCache.compute(LRUHybridCache.java:292)
at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetDescriptor(ServiceLocatorImpl.java:1147)
at org.jvnet.hk2.internal.ServiceLocatorImpl.getServiceHandle(ServiceLocatorImpl.java:1395)
at org.jvnet.hk2.internal.ServiceLocatorImpl.getServiceHandle(ServiceLocatorImpl.java:1384)
at com.sun.enterprise.v3.server.ContainerStarter.startContainer(ContainerStarter.java:112)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainer(ApplicationLifecycle.java:997)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:702)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:377)
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:539)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722)
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.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:189)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745)

Severe: Exception while deploying the app [helloservice-war] : A MultiException has 2 exceptions. They are:
1. com.sun.enterprise.module.ResolveError: Failed to start OSGiModuleImpl:: Bundle = [org.glassfish.main.webservices.jsr109-impl [250]], State = [NEW]
2. java.lang.IllegalStateException: Could not load descriptor SystemDescriptor(
implementation=org.glassfish.webservices.WebServicesContainer
name=org.glassfish.webservices.WebServicesContainer
contracts={org.glassfish.webservices.WebServicesContainer,org.glassfish.api.container.Container}
scope=javax.inject.Singleton
qualifiers={}
descriptorType=CLASS
descriptorVisibility=NORMAL
metadata=Bundle-SymbolicName={org.glassfish.main.webservices.jsr109-impl},Bundle-Version={4.1.0}

rank=0
loader=OsgiPopulatorPostProcessor.HK2Loader(OSGiModuleImpl:: Bundle = [org.glassfish.main.webservices.jsr109-impl [250]], State = [NEW],918763885)
proxiable=null
proxyForSameScope=null
analysisName=null
id=434
locatorId=0
identityHashCode=1010978305
reified=false)
com.sun.enterprise.module.ResolveError: Failed to start OSGiModuleImpl:: Bundle = [org.glassfish.main.webservices.jsr109-impl [250]], State = [NEW]
at org.jvnet.hk2.osgiadapter.OSGiModuleImpl.start(OSGiModuleImpl.java:218)
at org.jvnet.hk2.osgiadapter.OsgiPopulatorPostProcessor$1.loadClass(OsgiPopulatorPostProcessor.java:77)
at org.jvnet.hk2.internal.ServiceLocatorImpl.loadClass(ServiceLocatorImpl.java:2058)
at org.jvnet.hk2.internal.ServiceLocatorImpl.reifyDescriptor(ServiceLocatorImpl.java:413)
at org.jvnet.hk2.internal.ServiceLocatorImpl.narrow(ServiceLocatorImpl.java:2120)
at org.jvnet.hk2.internal.ServiceLocatorImpl.access$900(ServiceLocatorImpl.java:119)
at org.jvnet.hk2.internal.ServiceLocatorImpl$8.compute(ServiceLocatorImpl.java:1063)
at org.jvnet.hk2.internal.ServiceLocatorImpl$8.compute(ServiceLocatorImpl.java:1058)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture$1.call(LRUHybridCache.java:115)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture$1.call(LRUHybridCache.java:111)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.glassfish.hk2.utilities.cache.LRUHybridCache$OriginThreadAwareFuture.run(LRUHybridCache.java:173)
at org.glassfish.hk2.utilities.cache.LRUHybridCache.compute(LRUHybridCache.java:292)
at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetDescriptor(ServiceLocatorImpl.java:1147)
at org.jvnet.hk2.internal.ServiceLocatorImpl.getServiceHandle(ServiceLocatorImpl.java:1395)
at org.jvnet.hk2.internal.ServiceLocatorImpl.getServiceHandle(ServiceLocatorImpl.java:1384)
at com.sun.enterprise.v3.server.ContainerStarter.startContainer(ContainerStarter.java:112)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainer(ApplicationLifecycle.java:997)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:702)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:377)
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:539)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:534)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:360)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1722)
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.StaticHttpHandlerBase.service(StaticHttpHandlerBase.java:189)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.osgi.framework.BundleException: Unresolved constraint in bundle org.glassfish.main.webservices.jsr109-impl [250]: Unable to resolve 250.0: missing requirement [250.0] osgi.wiring.package; (&(osgi.wiring.package=com.sun.tools.ws.spi)(version>=2.3.0)(Unable to render embedded object: File ( Unable to resolve 257.0: missing requirement [257.0] osgi.wiring.package; (&(osgi.wiring.package=javax.xml.rpc)(version>=1.1.0)() not found.(version>=2.0.0)))]
at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:3974)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2037)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:955)
at org.jvnet.hk2.osgiadapter.OSGiModuleImpl.start(OSGiModuleImpl.java:210)
... 57 more

Info: Grizzly Framework 2.3.15 started in: 34ms - bound to [/0.0.0.0:8080]
Info: Grizzly Framework 2.3.15 started in: 40ms - bound to [/0.0.0.0:8181]
Info: visiting unvisited references
Info: Created HTTP listener http-listener-1 on host/port 0.0.0.0:8080
Info: Created HTTP listener http-listener-2 on host/port 0.0.0.0:8181
Info: Created HTTP listener admin-listener on host/port 0.0.0.0:4848
Info: Created virtual server server
Info: Created virtual server __asadmin
Info: Setting JAAS app name glassfish-web
Info: Virtual server server loaded default web module
Severe: Startup of context failed due to previous errors
Severe: Exception during cleanup after start failed
org.apache.catalina.LifecycleException: Manager has not yet been started
at org.apache.catalina.session.StandardManager.stop(StandardManager.java:935)
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:6133)
at com.sun.enterprise.web.WebModule.stop(WebModule.java:720)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5950)
at com.sun.enterprise.web.WebModule.start(WebModule.java:691)
at org.apache.catalina.core.ContainerBase.startChildren(ContainerBase.java:1593)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1290)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:982)
at org.apache.catalina.core.ContainerBase.startChildren(ContainerBase.java:1593)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1290)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:402)
at org.apache.catalina.startup.Embedded.start(Embedded.java:995)
at com.sun.enterprise.web.WebContainer.postConstruct(WebContainer.java:865)
at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:329)
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:377)
at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:461)
at org.jvnet.hk2.internal.SingletonContext$1.compute(SingletonContext.java:114)
at org.jvnet.hk2.internal.SingletonContext$1.compute(SingletonContext.java:102)
at org.glassfish.hk2.utilities.cache.Cache$OriginThreadAwareFuture$1.call(Cache.java:97)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.glassfish.hk2.utilities.cache.Cache$OriginThreadAwareFuture.run(Cache.java:154)
at org.glassfish.hk2.utilities.cache.Cache.compute(Cache.java:199)
at org.jvnet.hk2.internal.SingletonContext.findOrCreate(SingletonContext.java:153)
at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2258)
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:105)
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:87)
at org.glassfish.internal.data.EngineInfo.getContainer(EngineInfo.java:86)
at com.sun.enterprise.v3.server.ApplicationLifecycle.startContainers(ApplicationLifecycle.java:1011)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:717)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:377)
at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:406)
at com.sun.enterprise.v3.admin.adapter.InstallerThread.load(InstallerThread.java:211)
at com.sun.enterprise.v3.admin.adapter.InstallerThread.run(InstallerThread.java:100)

Severe: Container StandardEngine[glassfish-web].StandardHost[server].StandardContext[] has not been started
org.apache.catalina.LifecycleException: java.util.ServiceConfigurationError: javax.servlet.ServletContainerInitializer: Provider com.sun.xml.ws.transport.http.servlet.WSServletContainerInitializer not found
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5954)
at com.sun.enterprise.web.WebModule.start(WebModule.java:691)
at org.apache.catalina.core.ContainerBase.startChildren(ContainerBase.java:1593)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1290)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:982)
at org.apache.catalina.core.ContainerBase.startChildren(ContainerBase.java:1593)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1290)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:402)
at org.apache.catalina.startup.Embedded.start(Embedded.java:995)
at com.sun.enterprise.web.WebContainer.postConstruct(WebContainer.java:865)
at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:329)
at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:377)
at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:461)
at org.jvnet.hk2.internal.SingletonContext$1.compute(SingletonContext.java:114)
at org.jvnet.hk2.internal.SingletonContext$1.compute(SingletonContext.java:102)
at org.glassfish.hk2.utilities.cache.Cache$OriginThreadAwareFuture$1.call(Cache.java:97)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.glassfish.hk2.utilities.cache.Cache$OriginThreadAwareFuture.run(Cache.java:154)
at org.glassfish.hk2.utilities.cache.Cache.compute(Cache.java:199)
at org.jvnet.hk2.internal.SingletonContext.findOrCreate(SingletonContext.java:153)
at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2258)
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:105)
at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:87)
at org.glassfish.internal.data.EngineInfo.getContainer(EngineInfo.java:86)
at com.sun.enterprise.v3.server.ApplicationLifecycle.startContainers(ApplicationLifecycle.java:1011)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:717)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:377)
at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:406)
at com.sun.enterprise.v3.admin.adapter.InstallerThread.load(InstallerThread.java:211)
at com.sun.enterprise.v3.admin.adapter.InstallerThread.run(InstallerThread.java:100)
Caused by: java.util.ServiceConfigurationError: javax.servlet.ServletContainerInitializer: Provider com.sun.xml.ws.transport.http.servlet.WSServletContainerInitializer not found
at java.util.ServiceLoader.fail(ServiceLoader.java:239)
at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:372)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at org.glassfish.web.loader.ServletContainerInitializerUtil.getInterestList(ServletContainerInitializerUtil.java:193)
at org.apache.catalina.core.StandardContext.callServletContainerInitializers(StandardContext.java:5996)
at com.sun.enterprise.web.WebModule.callServletContainerInitializers(WebModule.java:774)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5929)
... 29 more

Info: Java security manager is disabled.
Info: Entering Security Startup Service.
Info: Loading policy provider com.sun.enterprise.security.provider.PolicyWrapper.
Info: Security Service(s) started successfully.
Info: visiting unvisited references
Info: visiting unvisited references
Info: visiting unvisited references
Severe: Startup of context failed due to previous errors
Severe: Exception during cleanup after start failed
org.apache.catalina.LifecycleException: Manager has not yet been started
at org.apache.catalina.session.StandardManager.stop(StandardManager.java:935)
at org.apache.catalina.core.StandardContext.stop(StandardContext.java:6133)
at com.sun.enterprise.web.WebModule.stop(WebModule.java:720)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5950)
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:2286)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1932)
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:500)
at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:406)
at com.sun.enterprise.v3.admin.adapter.InstallerThread.load(InstallerThread.java:211)
at com.sun.enterprise.v3.admin.adapter.InstallerThread.run(InstallerThread.java:100)

Severe: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: java.util.ServiceConfigurationError: javax.servlet.ServletContainerInitializer: Provider com.sun.xml.ws.transport.http.servlet.WSServletContainerInitializer not found
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5954)
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:2286)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1932)
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:500)
at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:406)
at com.sun.enterprise.v3.admin.adapter.InstallerThread.load(InstallerThread.java:211)
at com.sun.enterprise.v3.admin.adapter.InstallerThread.run(InstallerThread.java:100)
Caused by: java.util.ServiceConfigurationError: javax.servlet.ServletContainerInitializer: Provider com.sun.xml.ws.transport.http.servlet.WSServletContainerInitializer not found
at java.util.ServiceLoader.fail(ServiceLoader.java:239)
at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:372)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
at org.glassfish.web.loader.ServletContainerInitializerUtil.getInterestList(ServletContainerInitializerUtil.java:193)
at org.apache.catalina.core.StandardContext.callServletContainerInitializers(StandardContext.java:5996)
at com.sun.enterprise.web.WebModule.callServletContainerInitializers(WebModule.java:774)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5929)
... 14 more

Warning: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.util.ServiceConfigurationError: javax.servlet.ServletContainerInitializer: Provider com.sun.xml.ws.transport.http.servlet.WSServletContainerInitializer not found
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.util.ServiceConfigurationError: javax.servlet.ServletContainerInitializer: Provider com.sun.xml.ws.transport.http.servlet.WSServletContainerInitializer not found
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1044)
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:2286)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1932)
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:500)
at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:406)
at com.sun.enterprise.v3.admin.adapter.InstallerThread.load(InstallerThread.java:211)
at com.sun.enterprise.v3.admin.adapter.InstallerThread.run(InstallerThread.java:100)

Severe: Exception while invoking class com.sun.enterprise.web.WebApplication start method
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.util.ServiceConfigurationError: javax.servlet.ServletContainerInitializer: Provider com.sun.xml.ws.transport.http.servlet.WSServletContainerInitializer not found
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:500)
at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:406)
at com.sun.enterprise.v3.admin.adapter.InstallerThread.load(InstallerThread.java:211)
at com.sun.enterprise.v3.admin.adapter.InstallerThread.run(InstallerThread.java:100)

Severe: Exception during lifecycle processing
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.util.ServiceConfigurationError: javax.servlet.ServletContainerInitializer: Provider com.sun.xml.ws.transport.http.servlet.WSServletContainerInitializer not found
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:500)
at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:406)
at com.sun.enterprise.v3.admin.adapter.InstallerThread.load(InstallerThread.java:211)
at com.sun.enterprise.v3.admin.adapter.InstallerThread.run(InstallerThread.java:100)

Severe: Exception while loading the app
Severe: Undeployment failed for context
Severe: Application deployment failed: Exception while loading the app
Info: Initiating Jersey application, version Jersey: 2.10.4 2014-08-08 15:09:00...
Info: Listening to REST requests at context: /management/domain.

Comment by pavel11 [ 30/Mar/15 ]

Looks like I used not proper archive java_ee_sdk-7u1-web.zip instead of java_ee_sdk-7u1.zip . I miss because i working with web services, and thought web preferable. More over i find example from tutorial in this archive but it cannot be run. When I use java_ee_sdk-7u1.zip it works fine.





[GLASSFISH-21340] CDI scope annotation on @Provider makes @NameBinding ignored Created: 26/Mar/15  Updated: 30/Mar/15

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

Type: Bug Priority: Major
Reporter: m-radzikowski Assignee: Marek Potociar
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

1.8.0_40



 Description   

Using CDI scope annotation (e.g. @javax.enterprise.context.RequestScoped) makes annotations with @javax.ws.rs.NameBinding ignored in @javax.ws.rs.ext.Provider.

Sample code:

EnableScopedFilter
@Retention(RUNTIME)
@NameBinding
public @interface EnableScopedFilter {	
}
ScopedFilter
@Provider
@EnableScopedFilter
@RequestScoped
public class ScopedFilter implements ContainerRequestFilter {
	@Override
	public void filter(ContainerRequestContext requestContext) throws IOException {
		System.out.println("Scoped filter triggered on path: " + requestContext.getUriInfo().getPath());
	}
}

This filter is executed on every REST method, not only on these annotated with @EnableScopedFilter. If @RequestScoped is removed everything is ok.

CDI scope annotation is needed is bean-discovery-mode in beans.xml is set to "annotation" and filter needs to @Inject some resources.



 Comments   
Comment by jjsnyder83 [ 30/Mar/15 ]

I don't think this is a CDI issue. I think it is a jax-rs issue. Assigning to jax-rs.





[GLASSFISH-20994] communication between DAS and instance fails if master password != changeit Created: 24/Feb/14  Updated: 30/Mar/15

Status: In Progress
Project: glassfish
Component/s: admin
Affects Version/s: 4.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: ChristianSch Assignee: Vinay Vishal
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: javaee_ri_fix, payara

 Description   

if GlassFish is started using --passswordfile command line option, GF should take passwords provided in this file instead of defaults.

1. create a domain with one DAS, clusters and instances
2. start instances, the config is retrieved from DAS
3. open admin gui and change something, push to instance fails with
javax.net.ssl.SSLException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.IllegalArgumentException

root cause is com.sun.enterprise.security.store.AsadminSecurityUtil#defaultMasterPassword()
it checks an undocumented system property or falls back to 'changeit' (see stack trace below)

if the system property is provided as jvm-option then the communcation works. however, providing passwords at several places (--passwordfile and jvm-option) is error prone and bad practice...

	AsadminSecurityUtil.defaultMasterPassword() line: 269	
	AsadminSecurityUtil.chooseMasterPassword(char[]) line: 252	
	AsadminSecurityUtil.init(char[], boolean) line: 170	
	AsadminSecurityUtil.<init>(char[], boolean) line: 135	
	AsadminSecurityUtil.getInstance(char[], boolean) line: 84	
	AsadminSecurityUtil.getInstance(boolean) line: 96	
	AsadminTruststore.newInstance() line: 84	
	AsadminTrustManager.checkCertificate(X509Certificate[]) line: 209	
	AsadminTrustManager.checkServerTrusted(X509Certificate[], String) line: 136	
	AbstractTrustManagerWrapper.checkServerTrusted(X509Certificate[], String, Socket) line: 813	
	ClientHandshaker.serverCertificate(HandshakeMessage$CertificateMsg) line: 1323	
	ClientHandshaker.processMessage(byte, int) line: 153	
	ClientHandshaker(Handshaker).processLoop() line: 868	
	ClientHandshaker(Handshaker).process_record(InputRecord, boolean) line: 804	
	SSLSocketImpl.readRecord(InputRecord, boolean) line: 1016	
	SSLSocketImpl.performInitialHandshake() line: 1312	
	SSLSocketImpl.startHandshake(boolean) line: 1339	
	SSLSocketImpl.startHandshake() line: 1323	
	HttpsClient.afterConnect() line: 563	
	DelegateHttpsURLConnection(AbstractDelegateHttpsURLConnection).connect() line: 185	
	DelegateHttpsURLConnection(HttpURLConnection).getOutputStream() line: 1091	
	HttpsURLConnectionImpl.getOutputStream() line: 250	
	ParameterMapFormProprietaryWriter.writeTo(Object, HttpURLConnection) line: 81	
	RemoteRestAdminCommand$1.prepareConnection(HttpURLConnection) line: 763	
	InstanceRestCommandExecutor(RemoteRestAdminCommand).doHttpCommand(String, String, RemoteRestAdminCommand$HttpCommand, boolean) line: 1058	
	InstanceRestCommandExecutor(RemoteRestAdminCommand).doHttpCommand(String, String, RemoteRestAdminCommand$HttpCommand) line: 958	
	InstanceRestCommandExecutor(RemoteRestAdminCommand).executeRemoteCommand(ParameterMap) line: 733	
	InstanceRestCommandExecutor(RemoteRestAdminCommand).executeCommand(ParameterMap) line: 548	
	InstanceRestCommandExecutor.run() line: 132	
	Executors$RunnableAdapter<T>.call() line: 471	
	FutureTask<V>.run() line: 262	
	Executors$RunnableAdapter<T>.call() line: 471	
	FutureTask<V>.run() line: 262	
	ThreadPoolExecutor.runWorker(ThreadPoolExecutor$Worker) line: 1145	
	ThreadPoolExecutor$Worker.run() line: 615	
	Thread.run() line: 744	


 Comments   
Comment by smillidge-c2b2 [ 14/Dec/14 ]

I believe this occurs if you disable the JMX connectors in GlassFish. The JMX connectors set the system properties javax.net.ssl.keyStorePassword and javax.net.ssl.trustStorePassword if they are disabled these are never set resulting in communication failure between the DAS and any instances with the error above.

This Payara commit https://github.com/smillidge/Payara/commit/7318105bf17f6ee231bd3c818425169a7996bdd0 is an attempt at fixing this issue by moving the initialisation of these properties to the IdmService once it has obtained the MasterPassword. This is probably not the best fix. It is probably better to rewrite AsadminSecurityUtil to use the IdmService rather than relying on the system property.

Comment by Vinay Vishal [ 20/Mar/15 ]

Exact issue as mentioned in the bug couldn't be reproduced. Exact steps to reproduce the same will be helpful. After changing the master password from default changeit to something else, domain server was started using password file. Password file had the new password as key value pair for key AS_ADMIN_MASTERPASSWORD. DAS got started successfully. Post this, a change was made in admin gui. Change successfully got saved.

If this issue is related to communication between DAS and other instances and cluster, --passwordfile option will work fine if instance is started using "start-local-instance" command. However, for start-cluster or start-instance to work correctly, its important to have master-password file placed in node/agent directory on the host where instances are configured. For security reasons, master-password at present is not transmitted over the wire and hence start-cluster or start-instance being Remote CLI commands, will not work until or unless master-password file is present in the node/agent directory.

Refer to following wiki for discussion around this: https://wikis.oracle.com/display/GlassFish/3.1+Master+Password

Similar other issue: https://java.net/jira/browse/GLASSFISH-16149?jql=text%20~%20start-cluster

Comment by ChristianSch [ 23/Mar/15 ]

the comment from smillidge provides a plausible root cause for the observed behavior. if password is not set, then GF falls back to 'changeit'

@Vinay Vishal: instances have access to the correct master password





[GLASSFISH-21009] The behavior of --timeout-seconds is not in line with the document Created: 19/Mar/14  Updated: 30/Mar/15

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

Type: Bug Priority: Major
Reporter: xj Assignee: Vinay Vishal
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: 4_0_1-approved, licbug

 Description   

One licensee found a contradicting behavior in Java EE 7 RI if 0 is set at
--timeout-seconds on command asadmin create-http.

There is such a description in GlassFish Reference Manual.

GlassFish Server Open Source Edition
Reference Manual Release 4.0
Page 1-77.
https://glassfish.java.net/docs/4.0/reference-manual.pdf

--timeout-seconds
The maximum time in seconds for which a keep alive connection is kept
open. A value of 0 or less means keep alive connections are kept open
indefinitely. The default is 30.

However, In Java EE 7 RI the connection is terminated immediately if
0 is set at --timeout-seconds which means 0 second is used.

It seems there is an inconsistent implementation in RI.

To reproduce.

1. Set following configurations
asadmin start-domain
asadmin create-protocol --securityenabled=false http-1
asadmin create-http --timeout-seconds 0 --default-virtual-server server http-1
asadmin create-network-listener --listenerport 7272 --protocol http-1 --enabled=true http-listener-3

The following config is set.
[domain.xml]
<protocol name="http-1">
<http timeout-seconds="0" default-virtual-server="server">
<file-cache></file-cache>
</http>
</protocol>

2. Connect the server
telnet 127.0.0.1 7272

You can see the connection is terminated immediately.



 Comments   
Comment by timmaher [ 30/Oct/14 ]

It gets even worse if you set the web session-timeout to 0 using the 4848 admin console.
Where previously there was no timeout entry in domain.xml when the timeout was set to 1800.
Saving 0 in the admin console results in the following:-
<web-container>
<session-config>
<session-manager>
<manager-properties></manager-properties>
<store-properties></store-properties>
</session-manager>
<session-properties timeout-in-seconds="0"></session-properties>
</session-config>
</web-container>
This is guaranteed to bomb all connections, including the admin console with a 500.
The only repair is to go into the domain.xml and reset the value to 1800 (I haven't tried removing it instead).





[GLASSFISH-21210] Please rename engine [weld] to engine [cdi] in admin console Created: 19/Sep/14  Updated: 30/Mar/15

Status: In Progress
Project: glassfish
Component/s: admin_gui
Affects Version/s: 4.1
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: mkarg Assignee: Shaifali Kansal
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The admin console lists engines used by applications as [ear], [web], [ejb], [webservices], [connector], [appclient], [weld]. Obviously this is inconsistent. "weld" is a product name, not an engine type. It would be more consistent to say [cdi] here, and it would open the possibility to change the implementation product for CDI in the future without changing the apperance on the console. There is no need to expose to the GF administrator that the CDI component is delivered by weld.






[GLASSFISH-21276] A number of monitor mbeans are broken Created: 20/Dec/14  Updated: 27/Mar/15  Resolved: 24/Mar/15

Status: Resolved
Project: glassfish
Component/s: amx
Affects Version/s: 4.1
Fix Version/s: 4.2

Type: Bug Priority: Major
Reporter: smillidge-c2b2 Assignee: Arindam Bandyopadhyay
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: javaee_ri_fix, payara

 Description   

The following MBeans have broken attributes for statistics gathering. A RuntimeException is thrown when the attributes are accessed.

servlet-instance-mon
bean-pool-mon
bean-method-mon
singleton-bean-mon
message-driven-bean-mon
security-realm-mon
equest-mon
ThreadPoolStatsImpl
transaction-service-mon
stateless-session-bean-mon



 Comments   
Comment by smillidge-c2b2 [ 20/Dec/14 ]

Forgot to say this is 4.1 GlassFish

Comment by smillidge-c2b2 [ 20/Dec/14 ]

This Payara commit fixes the issue https://github.com/payara/Payara/commit/17587c03b928018765c496332f6fb3164c53d8e7

Comment by Arindam Bandyopadhyay [ 09/Mar/15 ]

I was working to add the fix in glassfish. Please provide the test case for this issue.

Comment by smillidge-c2b2 [ 11/Mar/15 ]

Hi Arindam,

Just access their attributes through VisualVM MBean browser or JConsole you will see some attributes give an error.

Steve

Comment by Arindam Bandyopadhyay [ 24/Mar/15 ]

Fixed in trunk/main
Committed revision 63803.





[GLASSFISH-20931] UnsupportedCharsetException is not handled properly Created: 17/Dec/13  Updated: 27/Mar/15

Status: In Progress
Project: glassfish
Component/s: admin_gui
Affects Version/s: 4.1
Fix Version/s: future release

Type: Bug Priority: Major
Reporter: xianwu Assignee: mukesh.kumawat
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

« Hide

OS
Windows 7 Enterprise (Service Pack 1)

JDK
java version "1.7.0_11"
Java(TM) SE Runtime Environment (build 1.7.0_11-b21) Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)

GlassFish build: glassfish-4.0.1-b02-07_22_2013



 Description   

Reproducible operational steps:

1) set an invalid http.uri-encoding to admin-listener
asadmin set server.network-config.protocols.protocol.admin-listener.http.uri-encoding=testtest
server.network-config.protocols.protocol.admin-listener.http.uri-encoding=testtest
Command set executed successfully.

2) restart domain
asadmin restart-domain domain1
Successfully restarted the domain
Command restart-domain executed successfully.

3) access admin console (IE or FireFox)
http://localhost:4848/common/index.jsf

got page fault
HTPP Status 500-

Detailed logging from server.log

[2013-12-17T12:27:06.753+1100] [glassfish 4.0] [WARNING] [NCLS-CORE-00090] [javax.enterprise.system.core] [tid: _ThreadID=41 _ThreadName=admin-listener(3)] [timeMillis: 1387243626753] [levelValue: 900] [[
Internal Server error: /common/index.jsf
java.nio.charset.UnsupportedCharsetException: testtest
at java.nio.charset.Charset.forName(Charset.java:543)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:246)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:496)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:175)
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:187)
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:837)
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:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:722)

4) similar issue if set invalid uri-encoding to http-listener-*
For example,
asadmin set server.network-config.protocols.protocol.http-listener-1.http.uri-encoding=testtest
server.network-config.protocols.protocol.http-listener-1.http.uri-encoding=testtest
Command set executed successfully.

It will cause 500 page fault to an application page with similar logging in server.log

5) Suggestion
It should handle UnsupportedCharsetException properly to avoid throwing it to the top level and create 500 page fault






[GLASSFISH-20606] create-domain subcommand doesn't write jms.port property to domain.xml Created: 06/Jun/13  Updated: 27/Mar/15

Status: In Progress
Project: glassfish
Component/s: admin
Affects Version/s: 4.0
Fix Version/s: 4.1

Type: Bug Priority: Major
Reporter: David Zhao Assignee: mukesh.kumawat
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to GLASSFISH-16811 JMS - connection refused on 7676 when... Open

 Description   

When creating a new domain with jms.port property which is not the default value 7676, it can be seen in the asadmin output, but it doesn't be written to domain.xml for persistence.

>asadmin create-domain --domainproperties jms.port=7777 jmsdomain
Enter admin user name [Enter to accept default "admin" / no password]>
Using default port 4848 for Admin.
Using default port 8080 for HTTP Instance.
Using port 7777 for JMS.
Using default port 3700 for IIOP.
Using default port 8181 for HTTP_SSL.
Using default port 3820 for IIOP_SSL.
Using default port 3920 for IIOP_MUTUALAUTH.
Using default port 8686 for JMX_ADMIN.
Using default port 6666 for OSGI_SHELL.
Using default port 9009 for JAVA_DEBUGGER.
Distinguished Name of the self-signed X.509 Server Certificate is:
[CN=davidz.cn.oracle.com,OU=GlassFish,O=Oracle Corporation,L=Santa Clara,ST=California,C=US]
Distinguished Name of the self-signed X.509 Server Certificate is:
[CN=davidz.cn.oracle.com-instance,OU=GlassFish,O=Oracle Corporation,L=Santa Clara,ST=California,C=US]
Domain jmsdomain created.

In domain.xml, no 7777 can be found , but all the jms ports are default 7676 instead.



 Comments   
Comment by jifeng [ 27/Aug/13 ]

Hi
Chris,David
I modify the following code, it works fine,the jms.port will be written to domain.xml

com.sun.enterprise.admin.servermgmt.domain.CustomTokenClient

Index: CustomTokenClient.java
===================================================================
--- CustomTokenClient.java	(revision 62639)
+++ CustomTokenClient.java	(working copy)
@@ -71,7 +71,7 @@
     public static final String CUSTOM_TOKEN_PLACE_HOLDER = "TOKENS_HERE";
     public static final String DEFAULT_TOKEN_PLACE_HOLDER = "DEFAULT_TOKENS_HERE";
-
+    public static final String JMS_PROVIDER_PORT_TOKEN_NAME = "JMS_PROVIDER_PORT";
     private DomainConfig _domainConfig;
 
     public CustomTokenClient(DomainConfig domainConfig) {
@@ -120,6 +120,11 @@
          if (!NetUtils.isPortFree(port)) {
             throw new DomainException(_strings.get("unavailablePort", port));
           }
+       } if (name.equals(JMS_PROVIDER_PORT_TOKEN_NAME) && _domainConfig.get(DomainConfig.K_JMS_PORT) != null) {
+         port = Integer.valueOf(_domainConfig.get(DomainConfig.K_JMS_PORT).toString());
+         if (!NetUtils.isPortFree(port)) {
+              throw new DomainException(_strings.get("unavailablePort", port));
+          }                                
     } else {
             if (portBase != null && token.getTokenTypeDetails() instanceof PortTypeDetails) {
                   PortTypeDetails portTypeDetails = (PortTypeDetails)token.getTokenTypeDetails();

could you please confirm it and give me some suggestions?

Comment by Chris Kasso [ 19/Feb/14 ]

I'm able to duplicate the problem. It didn't exist in 3.1. In 3.1 the following entry is added to the domain.xml:

<jms-service type="EMBEDDED" default-jms-host="default_JMS_host">
<jms-host name="default_JMS_host" host="localhost" port="7777" admin-user-name="admin" admin-password="admin" lazy-init="true"/>
</jms-service>

I suspect this problem cropped up when the Config Modularity support was added to GF 4.0.

I'm not sure at this point whether the proposed fix is the best approach.

Comment by Alok Jain [ 03/Mar/14 ]

Fix looks good, I would like to wrap it in a if-else condition to avoid one additional call to NetUtils.isPortFree(port) method.

if (name.equals(JMS_PROVIDER_PORT_TOKEN_NAME) && _domainConfig.get(DomainConfig.K_JMS_PORT) != null)

{ port = Integer.valueOf(_domainConfig.get(DomainConfig.K_JMS_PORT).toString()); }

else

{ port = Integer.valueOf(domainProps.getProperty(token.getName())); }

if (!NetUtils.isPortFree(port))

{ throw new DomainException(_strings.get("unavailablePort", port)); }

The fix will resolve the issue corresponding to the JMS_PROVIDER_PORT, but if config modularity codes return some additional tokens and user tries to override them with --domainproperties argument than the similar check has to be added for those tokens also.





[GLASSFISH-21261] Cannot deploy .ear if same ear was deployed, then undeployed on NFS Created: 28/Nov/14  Updated: 27/Mar/15

Status: In Progress
Project: glassfish
Component/s: deployment
Affects Version/s: 4.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: davidwinters1980 Assignee: Vinay Vishal
Resolution: Unresolved Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows, Linux


Tags: javaee_ri_fix, payara

 Description   

The undeployment/deployment of applications (.ear, .war) can fail on NFS in GF 4.1 build 13. There was a previous issue raised with this exact same issue on windows which has been addressed as documented here on GF 4.x: https://java.net/jira/browse/GLASSFISH-19898

This issue occurs on NFS on SUSE Linux Enterprise Server 11 (x86_64). The fix for the defect above solely addresses issues on the windows ploatform whereby each second for a period of 5 seconds an attempt to delete the file in the .glassfishStaleFiles tracker file after a garbage collection is forced by calling System.gc()

I have a patch which be uploaded to here shortly to address this issue on all platforms. Furthermore, the retry interval and retry attempts are configurable rather than having hard coded properties in the code.



 Comments   
Comment by davidwinters1980 [ 01/Dec/14 ]

Patch which fixes this issue on NFS:

/*

  • DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
    *
  • Copyright (c) 2006-2013 Oracle and/or its affiliates. All rights reserved.
    *
  • The contents of this file are subject to the terms of either the GNU
  • General Public License Version 2 only ("GPL") or the Common Development
  • and Distribution License("CDDL") (collectively, the "License"). You
  • may not use this file except in compliance with the License. You can
  • obtain a copy of the License at
  • https://glassfish.dev.java.net/public/CDDL+GPL_1_1.html
  • or packager/legal/LICENSE.txt. See the License for the specific
  • language governing permissions and limitations under the License.
    *
  • When distributing the software, include this License Header Notice in each
  • file and include the License file at packager/legal/LICENSE.txt.
    *
  • GPL Classpath Exception:
  • Oracle designates this particular file as subject to the "Classpath"
  • exception as provided by Oracle in the GPL Version 2 section of the License
  • file that accompanied this code.
    *
  • Modifications:
  • If applicable, add the following below the License Header, with the fields
  • enclosed by brackets [] replaced by your own identifying information:
  • "Portions Copyright [year] [name of copyright owner]"
    *
  • Contributor(s):
  • If you wish your version of this file to be governed by only the CDDL or
  • only the GPL Version 2, indicate your decision by adding "[Contributor]
  • elects to include this software in this distribution under the [CDDL or GPL
  • Version 2] license." If you don't indicate a single choice of license, a
  • recipient has the option to distribute your version of this file under
  • either the CDDL, the GPL Version 2 or to extend the choice of license to
  • its licensees as provided above. However, if you add GPL Version 2 code
  • and therefore, elected the GPL Version 2 license, then the option applies
  • only if the new code is made subject to such option by the copyright
  • holder.
    */
    package com.sun.enterprise.util.io;

import com.sun.enterprise.universal.i18n.LocalStringsImpl;
import com.sun.enterprise.universal.io.SmartFile;
import com.sun.enterprise.util.CULoggerInfo;
import com.sun.enterprise.util.OS;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileFilter;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.FilenameFilter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.RandomAccessFile;
import java.io.Writer;
import java.nio.ByteBuffer;
import java.nio.channels.Channels;
import java.nio.channels.FileChannel;
import java.nio.channels.ReadableByteChannel;
import java.nio.channels.WritableByteChannel;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Locale;
import java.util.Set;
import java.util.TreeSet;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;

import javax.inject.Inject;

import org.jvnet.hk2.config.ConfigBean;

public class FileUtils {
final static Logger _utillogger = CULoggerInfo.getLogger();
private final static LocalStringsImpl messages = new LocalStringsImpl(FileUtils.class);

public static void setFileProperties()
{
Integer retryCounter = Integer.getInteger("com.sun.appserv.winFileLockRetryLimit");
Integer retryInterval = Integer.getInteger("com.sun.appserv.winFileLockRetryDelay");
if (retryCounter != null && retryCounter > 0)

{ FILE_OPERATION_MAX_RETRIES=retryCounter; }

if (retryInterval != null && retryInterval > 0)

{ FILE_OPERATION_SLEEP_DELAY_MS=retryInterval; }

}
/**

  • The method, java.io.File.getParentFile() does not necessarily do what
  • you would think it does. What it really does is to simply chop off the
  • final element in the path and return what is left-over. E.g.
  • if the file is /foo/. then the "parent" that is returned is /foo
  • which is probably not what you expected.
  • This method really returns the parent directory - or null if there is none.
  • @param f
  • @return
    */
    public static File getParentFile(File f) { if (f == null) return null; return SmartFile.sanitize(f).getParentFile(); }

/**

  • Wrapper for File.mkdirs
  • This version will return true if the directory exists when the method returns.
  • Unlike File.mkdirs which returns false if the directory already exists.
  • @param f The file pointing to the directory to be created
  • @return
    */
    public static boolean mkdirsMaybe(File f) { return f != null && (f.isDirectory() || f.mkdirs()); }

/**

  • Wrapper for File.delete
  • This version will return true if the file does not exist when the method returns.
  • Unlike File.delete which returns false if the file does not exist.
  • @param f The file to be deleted
  • @return
    */
    public static boolean deleteFileMaybe(File f) { return f != null && (!f.exists() || f.delete()); }

/*

  • Wrapper for File.listFiles
  • Guaranteed to return an array in all cases.
  • File.listFiles() returns either null or an empty array. This is annoying and results in harder
  • than neccessry to read code – i.e. there are 3 results possible:
  • an array with files in it
  • an empty array
  • a null
    */
    public static File[] listFiles(File f) {
    try { File[] files = f.listFiles(); if(files != null) return files; }

    catch(Exception e)

    { // fall through }

    return new File[0];
    }

    public static File[] listFiles(File f, FileFilter ff) {
    try { File[] files = f.listFiles(ff); if(files != null) return files; }
    catch(Exception e) { // fall through }

return new File[0];
}

public static File[] listFiles(File f, FilenameFilter fnf) {
try

{ File[] files = f.listFiles(fnf); if(files != null) return files; }

catch(Exception e)

{ // fall through }

return new File[0];
}

///////////////////////////////////////////////////////////////////////////

public static boolean safeIsDirectory(File f) { if (f == null || !f.exists() || !f.isDirectory()) return false; return true; }

///////////////////////////////////////////////////////////////////////////

public static boolean safeIsRealDirectory(String s) { return safeIsRealDirectory(new File(s)); }

///////////////////////////////////////////////////////////////////////////

public static boolean safeIsRealDirectory(File f) { if (safeIsDirectory(f) == false) return false; // these 2 values while be different for symbolic links String canonical = safeGetCanonicalPath(f); String absolute = f.getAbsolutePath(); if (canonical.equals(absolute)) return true; /* Bug 4715043 -- WHOA -- Bug Obscura!! * In Windows, if you create the File object with, say, "d:/foo", then the * absolute path will be "d:\foo" and the canonical path will be "D:\foo" * and they won't match!!! **/ if (OS.isWindows() && canonical.equalsIgnoreCase(absolute)) return true; return false; }

///////////////////////////////////////////////////////////////////////////

public static boolean safeIsDirectory(String s) { return safeIsDirectory(new File(s)); }

///////////////////////////////////////////////////////////////////////////

public static String safeGetCanonicalPath(File f) {
if (f == null)
return null;

try { return f.getCanonicalPath(); }
catch (IOException e) { return f.getAbsolutePath(); }
}

///////////////////////////////////////////////////////////////////////////

public static File safeGetCanonicalFile(File f) {
if (f == null)
return null;

try { return f.getCanonicalFile(); }
catch (IOException e) { return f.getAbsoluteFile(); }
}

///////////////////////////////////////////////////////////////////////////

public static boolean hasExtension(String filename, String ext) { if (filename == null || filename.length() <= 0) return false; return filename.endsWith(ext); }

///////////////////////////////////////////////////////////////////////////

public static boolean hasExtension(File f, String ext) { if (f == null || !f.exists()) return false; return f.getName().endsWith(ext); }

///////////////////////////////////////////////////////////////////////////

public static boolean hasExtensionIgnoreCase(String filename, String ext) { if (filename == null || filename.length() <= 0) return false; return filename.toLowerCase(Locale.ENGLISH).endsWith(ext.toLowerCase(Locale.ENGLISH)); }

///////////////////////////////////////////////////////////////////////////

public static boolean hasExtensionIgnoreCase(File f, String ext) { if (f == null || !f.exists()) return false; return f.getName().toLowerCase(Locale.ENGLISH).endsWith(ext.toLowerCase(Locale.ENGLISH)); }

///////////////////////////////////////////////////////////////////////////

public static boolean isLegalFilename(String filename) { if (!isValidString(filename)) return false; for (int i = 0; i < ILLEGAL_FILENAME_CHARS.length; i++) if (filename.indexOf(ILLEGAL_FILENAME_CHARS[i]) >= 0) return false; return true; }

///////////////////////////////////////////////////////////////////////////

public static boolean isFriendlyFilename(String filename) { if (!isValidString(filename)) return false; if (filename.indexOf(BLANK) >= 0 || filename.indexOf(DOT) >= 0) return false; return isLegalFilename(filename); }

///////////////////////////////////////////////////////////////////////////

public static String makeLegalFilename(String filename) { if (isLegalFilename(filename)) return filename; // let's use "__" to replace "/" and "\" (on Windows) so less chance // to collide with the actual name when reverting filename = filename.replaceAll("[/" + Pattern.quote("\\") + "]", "__"); for (int i = 0; i < ILLEGAL_FILENAME_CHARS.length; i++) filename = filename.replace(ILLEGAL_FILENAME_CHARS[i], REPLACEMENT_CHAR); return filename; }

///////////////////////////////////////////////////////////////////////////

public static String makeLegalNoBlankFileName(String filename)
{ return makeLegalFilename(filename).replace( BLANK, REPLACEMENT_CHAR); }


///////////////////////////////////////////////////////////////////////////
public static String makeFriendlyFilename(String filename) { if (isFriendlyFilename(filename)) return filename; String ret = makeLegalFilename(filename).replace(BLANK, REPLACEMENT_CHAR); ret = ret.replace(DOT, REPLACEMENT_CHAR); return ret; }

///////////////////////////////////////////////////////////////////////////

public static String makeFriendlyFilenameNoExtension(String filename) { int index = filename.lastIndexOf('.'); if (index > 0) filename = filename.substring(0, index); return (makeFriendlyFilename(filename)); }

///////////////////////////////////////////////////////////////////////////

public static String makeFriendlyFilenameExtension(String filename) {
if (filename == null) { return null; }

filename = makeLegalNoBlankFileName(filename);

String extension = "";
if (filename.endsWith(".ear")) { filename = filename.substring(0, filename.indexOf(".ear")); extension = "_ear"; } else if (filename.endsWith(".war")) { filename = filename.substring(0, filename.indexOf(".war")); extension = "_war"; } else if (filename.endsWith(".jar")) { filename = filename.substring(0, filename.indexOf(".jar")); extension = "_jar"; } else if (filename.endsWith(".rar")) { filename = filename.substring(0, filename.indexOf(".rar")); extension = "_rar"; }
return filename + extension;
}

public static String revertFriendlyFilenameExtension(String filename) {
if (filename == null ||
!(filename.endsWith("_ear") || filename.endsWith("_war") ||
filename.endsWith("_jar") || filename.endsWith("_rar"))) { return filename; }

String extension = "";
if (filename.endsWith("_ear")) { filename = filename.substring(0, filename.indexOf("_ear")); extension = ".ear"; } else if (filename.endsWith("_war")) { filename = filename.substring(0, filename.indexOf("_war")); extension = ".war"; } else if (filename.endsWith("_jar")) { filename = filename.substring(0, filename.indexOf("_jar")); extension = ".jar"; } else if (filename.endsWith("_rar")) { filename = filename.substring(0, filename.indexOf("_rar")); extension = ".rar"; }
return filename + extension;
}

public static String revertFriendlyFilename(String filename) { //first, revert the file extension String name = revertFriendlyFilenameExtension(filename); //then, revert the rest of the string return name.replaceAll("__", "/"); }

/////////////////////////////////////////////////////////

public static void liquidate(File parent) { whack(parent); }

///////////////////////////////////////////////////////////////////////////

public static boolean isJar(String filename)
{ return hasExtension(filename, ".jar"); }

///////////////////////////////////////////////////////////////////////////

public static boolean isZip(String filename)
{ return hasExtensionIgnoreCase(filename, ".zip"); }

///////////////////////////////////////////////////////////////////////////

public static boolean isJar(File f)
{ return hasExtension(f, ".jar"); }

///////////////////////////////////////////////////////////////////////////
public static boolean isZip(File f)
{ return hasExtensionIgnoreCase(f, ".zip"); }

/**
* Deletes a directory and its contents.
* <p/>
* If this method encounters a symbolic link in the subtree below "parent"
* then it deletes the link but not any of the files pointed to by the link.
* Note that whack will delete files if a symbolic link appears in the
* path above the specified parent directory in the path.
*
* @param parent the File at the top of the subtree to delete
* @return success or failure of deleting the directory
*/
public static boolean whack(File parent) { return whack(parent, null); }

/**
* Deletes a directory and its contents.
* <p/>
* If this method encounters a symbolic link in the subtree below "parent"
* then it deletes the link but not any of the files pointed to by the link.
* Note that whack will delete files if a symbolic link appears in the
* path above the specified parent directory in the path.
*
* @param parent the File at the top of the subtree to delete
* @return success or failure of deleting the directory
*/
public static boolean whack(File parent, Collection<File> undeletedFiles) {
try { /* *Resolve any links up-stream from this parent directory and *then whack the resulting resolved directory. */ return whackResolvedDirectory(parent.getCanonicalFile(), undeletedFiles); } catch (IOException ioe) { _utillogger.log(Level.SEVERE, CULoggerInfo.exceptionIO, ioe); return false; }
}

/**
* Deletes a directory and its contents.
* <p/>
* The whackResolvedDirectory method is invoked with a File argument
* in which any upstream file system links have already been resolved.
* This method will treate Any file passed in that does not have the same
* absolute and canonical path - as evaluated in safeIsRealDirectory -
* as a link and will delete the link without deleting any files in the
* linked directory.
*
* @param parent the File at the top of the subtree to delete
* @return success or failure of deleting the directory
*/
private static boolean whackResolvedDirectory(File parent, Collection<File> undeletedFiles) {
/*
*Do not recursively delete the contents if the current parent
*is a symbolic link.
*/
if (safeIsRealDirectory(parent)) {
File[] kids = listFiles(parent);

for (int i = 0; i < kids.length; i++) {
File f = kids[i];

if (f.isDirectory())
whackResolvedDirectory(f, undeletedFiles);
else if (!deleteFile(f) && undeletedFiles != null) { undeletedFiles.add(f); }

}
}

/*
*Delete the directory or symbolic link.
*/
return deleteFile(parent);
}

/**
* Delete a file. If impossible to delete then try to delete it when the JVM exits.
* E.g. when Windows is using a jar in the current JVM – you can not delete the jar until
* the JVM dies.
* @param f file to delete
*/
public static void deleteFileNowOrLater(File f) { if(!deleteFile(f)) f.deleteOnExit(); }

/**
* Delete a file. Will retry every ten milliseconds for five seconds, doing a
* gc after each second.
*
* @param f file to delete
* @return boolean indicating success or failure of the deletion atttempt; returns true if file is absent
*/
public static boolean deleteFileWithWaitLoop(File f) { return internalDeleteFile(f, true); }

/**
* Delete a file. If on Windows and the delete fails, run the gc and retry the deletion.
*
* @param f file to delete
* @return boolean indicating success or failure of the deletion atttempt; returns true if file is absent
*/
public static boolean deleteFile(File f) { return internalDeleteFile(f, false); }

/**
* Delete a file. If on Windows and the delete fails, run the gc and retry the deletion.
*
* @param f file to delete
* @return boolean indicating success or failure of the deletion atttempt; returns true if file is absent
*/
private static boolean internalDeleteFile(File f, boolean doWaitLoop) {
/*
*The operation succeeds immediately if the file is deleted
*successfully. On systems that support symbolic links, the file
*will be reported as non-existent if the file is a sym link to a
*non-existent directory. In that case invoke delete to remove
*the link before checking for existence, since File.exists on
*a symlink checks for the existence of the linked-to directory or
*file rather than of the link itself.
*/
if (!doWaitLoop) {
if (f.delete()) { return true; }
}
else {
DeleteFileWork work = new DeleteFileWork(f);

doWithRetry(work);

if (work.workComplete()) { return true; }
}

boolean log = _utillogger.isLoggable(FILE_OPERATION_LOG_LEVEL);
String filePath = f.getAbsolutePath();

/*
*The deletion failed. This could be simply because the file
*does not exist. In that case, log an appropriate message and
*return.
*/
if (!f.exists()) {
if (log) { _utillogger.log(Level.FINE, CULoggerInfo.deleteFailedAbsent, filePath); }
return true;
} else {
/*
*The delete failed and the file exists. Log a message if that
*level is enabled and return false to indicate the failure.
*/
if (log) { _utillogger.log(FILE_OPERATION_LOG_LEVEL, CULoggerInfo.deleteFailed, filePath); }
return false;
}
}

/**
* Opens a stream to the specified output file, retrying if necessary.
*
* @param out the output File for which a stream is needed
* @return the FileOutputStream
* @throws IOException for any errors opening the stream
*/
public static FileOutputStream openFileOutputStream(File out) throws IOException {
FileOutputStreamWork work = new FileOutputStreamWork(out);
int retries = doWithRetry(work);
if (retries > 0) { _utillogger.log(Level.FINE, "Retrying " + retries + " times"); }
if (work.workComplete()) { return work.getStream(); } else { IOException ioe = new IOException(); ioe.initCause(work.getLastError()); throw ioe; }
}

/**
* Return a set of all the files (File objects) under the directory specified, with
* relative pathnames filtered with the filename filter (can be null for all files).
*/
public static Set<File> getAllFilesUnder(File directory, FilenameFilter filenameFilter) throws IOException {
if (!directory.exists() || !directory.isDirectory()) { throw new IOException("Problem with: " + directory + ". You must supply a directory that exists"); }
return getAllFilesUnder(directory, filenameFilter, true);
}

public static Set<File> getAllFilesUnder(File directory, FilenameFilter filenameFilter, boolean relativize) throws IOException { Set<File> allFiles = new TreeSet<File>(); File relativizingDir = relativize ? directory : null; recursiveGetFilesUnder( relativizingDir, directory, filenameFilter, allFiles, false ); return allFiles; }

public static Set<File> getAllFilesAndDirectoriesUnder(File directory) throws IOException {
if (!directory.exists() || !directory.isDirectory()) { throw new IOException("Problem with: " + directory + ". You must supply a directory that exists"); }
Set<File> allFiles = new TreeSet<File>();
recursiveGetFilesUnder(directory, directory, null, allFiles, true);
return allFiles;
}

// relativizingRoot can be null, in which case no relativizing is
// performed.
private static void recursiveGetFilesUnder(File relativizingRoot, File directory, FilenameFilter filenameFilter, Set<File> set, boolean returnDirectories) {
File[] files = listFiles(directory, filenameFilter);
for (int i = 0; i < files.length; i++) {
if (files[i].isDirectory()) {
recursiveGetFilesUnder(relativizingRoot, files[i], filenameFilter, set, returnDirectories);
if (returnDirectories) {
if( relativizingRoot != null ) { set.add(relativize(relativizingRoot, files[i])); } else { set.add(files[i]); }
}
} else {
if( relativizingRoot != null ) { set.add(relativize(relativizingRoot, files[i])); } else { set.add(files[i]); }
}
}
}

/**
* Given a directory and a fully-qualified file somewhere
* under that directory, return the portion of the child
* that is relative to the parent.
*/
public static File relativize(File parent, File child) {
String baseDir = parent.getAbsolutePath();
String baseDirAndChild = child.getAbsolutePath();

String relative = baseDirAndChild.substring(baseDir.length(),
baseDirAndChild.length());

// Strip off any extraneous file separator character.
if( relative.startsWith(File.separator) ) { relative = relative.substring(1); }

return new File(relative);
}


/**
* Executes the supplied work object until the work is done or the max.
* retry count is reached.
*
* @param work the RetriableWork implementation to be run
* @return the number of retries performed; 0 indicates the work succeeded without having to retry
*/
private static int doWithRetry(RetriableWork work) {
int retries = 0;

/*
*Try the work the first time. Ideally this will work.
*/
work.run();

/*
*If the work failed and this is Windows - on which running gc may
*unlock the locked file - then begin the retries.
*/
if (!work.workComplete()) {
if(cmdfilepropertieset)
{ setFileProperties(); cmdfilepropertieset=false; }
_utillogger.log(FILE_OPERATION_LOG_LEVEL, CULoggerInfo.performGC);
while (!work.workComplete() && retries++ < FILE_OPERATION_MAX_RETRIES) {
try { Thread.sleep(FILE_OPERATION_SLEEP_DELAY_MS); } catch (InterruptedException ex) {
}
System.gc();
work.run();
}
}
return retries;
}

/**
* Creates a String listing the absolute paths of files, separated by
* the platform's line separator.
*
* @param files the Collection of File objects to be listed
* @return String containing the absolute paths of the files with the line separator between them
*/
public static String formatFileCollection(Collection<File> files) {
StringBuilder sb = new StringBuilder();
String lineSep = System.getProperty("line.separator");
String prefix = "";
for (File f : files) { sb.append(prefix).append(f.getAbsolutePath()); prefix = lineSep; }
return sb.toString();
}
///////////////////////////////////////////////////////////////////////////

public static File getDirectory(File f) { String filename = f.getAbsolutePath(); return new File((new File(filename)).getParent()); }

///////////////////////////////////////////////////////////////////////////

public static File createTempFile(File directory) {
File f = null;

try { f = File.createTempFile(TMPFILENAME, "jar", directory); }
catch (IOException ioe) { _utillogger.log(Level.SEVERE, CULoggerInfo.exceptionIO, ioe); }

f.deleteOnExit(); // just in case
return f;
}

/**
* Returns an array of abstract pathnames that matches with the given
* file extension. If the given abstract pathname does not denote a
* directory, then this method returns null. If there is no matching
* file under the given directory and its sub directories,
* it returns null;
*
* @param dirName dir name under which search will begin
* @param ext file extension to look for
* @return an array of abstract pathnames that matches with the extension
*/
public static File[] listAllFiles(File dirName, String ext) {
File[] target = null;
List<File> list = searchDir(dirName, ext);

if ((list != null) && (list.size() > 0)) { target = new File[list.size()]; target = (File[]) list.toArray(target); }

return target;
}

/**
* Returns a list of abstract pathnames that matches with the given
* file extension. If the given abstract pathname does not denote a
* directory, then this method returns null. If there is no matching
* file under the given directory and its sub directories, it returns
* an empty list.
*
* @param dirName dir name under which search will begin
* @param ext file extension to look for
* @return a list of abstract pathnames of type java.io.File
* that matches with the given extension
*/
public static List<File> searchDir(File dirName, String ext) {
List<File> targetList = null;

if (dirName.isDirectory()) {
targetList = new ArrayList<File>();

File[] list = listFiles(dirName);

for (int i = 0; i < list.length; i++) {
if (list[i].isDirectory()) { targetList.addAll(searchDir(list[i], ext)); } else {
String name = list[i].toString();
if (hasExtension(name, ext)) { targetList.add(list[i]); }
}
}
}

return targetList;
}

/**
* Copies a file.
*
* @param from Name of file to copy
* @param to Name of new file
* @throws IOException if an error while copying the content
*/
public static void copy(String from, String to) throws IOException { //if(!StringUtils.ok(from) || !StringUtils.ok(to)) if (from == null || to == null) throw new IllegalArgumentException("null or empty filename argument"); File fin = new File(from); File fout = new File(to); copy(fin, fout); }

/**
* Copies a file.
*
* @param fin File to copy
* @param fout New file
* @throws IOException if an error while copying the content
*/
public static void copy(File fin, File fout) throws IOException {
if (safeIsDirectory(fin)) { copyTree(fin, fout); return; }

if (!fin.exists())
throw new IllegalArgumentException("File source doesn't exist");

if(!mkdirsMaybe(fout.getParentFile()))
throw new RuntimeException("Can't create parent dir of output file: " + fout);

copyFile(fin, fout);
}

/**
* Copies the entire tree to a new location.
*
* @param din File pointing at root of tree to copy
* @param dout File pointing at root of new tree
* @throws IOException if an error while copying the content
*/
public static void copyTree(File din, File dout)
throws IOException {
if (!safeIsDirectory(din))
throw new IllegalArgumentException("Source isn't a directory");

if(!mkdirsMaybe(dout))
throw new IllegalArgumentException("Can't create destination directory");

FileListerRelative flr = new FileListerRelative(din);
String[] files = flr.getFiles();

for (int i = 0; i < files.length; i++) { File fin = new File(din, files[i]); File fout = new File(dout, files[i]); copy(fin, fout); }
}


/**
* Returns a String with uniform slashes such that all the
* occurances of '
' are replaced with '/'.
* In other words, the returned string will have all forward slashes.
* Accepts non-null strings only.
*
* @param inputStr non null String
* @return a String which <code> does not contain `
` character </code>
*/
public static String makeForwardSlashes(String inputStr) { if (inputStr == null) throw new IllegalArgumentException("null String FileUtils.makeForwardSlashes"); return (inputStr.replace('\\', '/')); }

/**
* Given a string (typically a path), quote the string such that spaces
* are protected from interpretation by a Unix or Windows command shell.
* Note that this method does not handle quoting for all styles of special
* characters. Just for the basic case of strings with spaces.
*
* @param s input string
* @return a String which is quoted to protect spaces
*/
public static String quoteString(String s) {
if (s == null) { throw new IllegalArgumentException("null string"); }

if (!s.contains("\'")) { return("\'" + s + "\'"); } else if(!s.contains("\"")) { return("\"" + s + "\""); } else {
// Contains a single quote and a double quote. Use backslash
// On Unix. Double quotes on Windows. This method does not claim
// to support this case well if at all
if (OS.isWindows()) { return("\"" + s + "\""); } else { return(s.replaceAll("\040", "\134 ")); }
}
}

///////////////////////////////////////////////////////////////////////////

public static String getIllegalFilenameCharacters() { return ILLEGAL_FILENAME_STRING; }

///////////////////////////////////////////////////////////////////////////

static boolean isValidString(String s) { return ((s != null) && (s.length() != 0)); }


/**
* This method is used to copy a given file to another file
* using the buffer sixe specified
*
* @param fin the source file
* @param fout the destination file
*/
public static void copyFile(File fin, File fout) throws IOException { InputStream inStream = new BufferedInputStream(new FileInputStream(fin)); FileOutputStream fos = FileUtils.openFileOutputStream(fout); copy(inStream, fos, fin.length()); }


public static void copy(InputStream in, FileOutputStream out, long size) throws IOException {

try { copyWithoutClose(in, out, size); } finally { if (in != null) in.close(); if (out != null) out.close(); }
}

public static void copyWithoutClose(InputStream in, FileOutputStream out, long size) throws IOException { ReadableByteChannel inChannel = Channels.newChannel(in); FileChannel outChannel = out.getChannel(); outChannel.transferFrom(inChannel, 0, size); }

public static void copy(InputStream in, OutputStream os, long size) throws IOException {
if (os instanceof FileOutputStream) { copy(in, (FileOutputStream) os, size); } else {
ReadableByteChannel inChannel = Channels.newChannel(in);
WritableByteChannel outChannel = Channels.newChannel(os);
if (size==0) {

ByteBuffer byteBuffer = ByteBuffer.allocate(10240);
int read;
do {
read = inChannel.read(byteBuffer);
if (read>0) { byteBuffer.limit(byteBuffer.position()); byteBuffer.rewind(); outChannel.write(byteBuffer); byteBuffer.clear(); }
} while (read!=-1);
} else {
ByteBuffer byteBuffer;
try{ byteBuffer = ByteBuffer.allocate(Long.valueOf(size).intValue()); }catch(Throwable err){ throw new IOException(messages.get("allocate.more.than.java.heap.space", err)); }
inChannel.read(byteBuffer);
byteBuffer.rewind();
outChannel.write(byteBuffer);
}
}
}

/**
*Rename, running gc on Windows if needed to try to force open streams to close.
*@param fromFile to be renamed
*@param toFile name for the renamed file
*@return boolean result of the rename attempt
*/
public static boolean renameFile(File fromFile, File toFile) {
boolean log = _utillogger.isLoggable(FILE_OPERATION_LOG_LEVEL) || _utillogger.isLoggable(Level.FINE);

RenameFileWork renameWork = new RenameFileWork(fromFile, toFile);
int retries = doWithRetry(renameWork);
boolean result = renameWork.workComplete();

String fromFilePath = null;
String toFilePath = null;
if (log || ! result) { fromFilePath = fromFile.getAbsolutePath(); toFilePath = toFile.getAbsolutePath(); }

/*
*If the rename worked, then write an appropriate log message if the
*logging level allows.
*/
if (result) {
if (log) {
/*
*If the rename worked without retries, then log a FINE message.
*If retries were needed then use the configured
*FILE_OPERATION_LOG_LEVEL.
*/
if (retries == 0) {
if (_utillogger.isLoggable(Level.FINE)) {
_utillogger.log(Level.FINE, CULoggerInfo.renameInitialSuccess,
new Object [] {fromFilePath, toFilePath});
}
} else {
_utillogger.log(FILE_OPERATION_LOG_LEVEL, CULoggerInfo.retryRenameSuccess,
new Object [] {fromFilePath, toFilePath, Integer.valueOf(retries)});
}
}
} else {
/*
*The rename has failed. Write a warning message.
*/
_utillogger.log(Level.WARNING, CULoggerInfo.retryRenameFailure,
new Object [] {fromFilePath, toFilePath, Integer.valueOf(retries) });
}
return result;
}

/** Appends the given line at the end of given text file. If the given
* file does not exist, an attempt is made to create it.
* Note that this method can handle only text files.
* @param fileName name of the text file that needs to be appended to
* @param line the line to append to
* @throws RuntimeException in case of any error - that makes it callable
* from a code not within try-catch. Note that NPE will be thrown if either
* argument is null.
* Note that this method is not tested with String containing characters
* with 2 bytes.
*/
public static void appendText(String fileName, String line) throws
RuntimeException {
RandomAccessFile file = null;
try { final String MODE = "rw"; file = new RandomAccessFile(fileName, MODE); file.seek(file.getFilePointer() + file.length()); file.writeBytes(line); }
catch(Exception e) { throw new RuntimeException("FileUtils.appendText()", e); }
finally {
try { if (file != null) file.close(); }
catch(Exception e){}
}
}
public static void appendText(String fileName, StringBuffer buffer)
throws IOException, FileNotFoundException
{ appendText(fileName, buffer.toString()); }
///////////////////////////////////////////////////////////////////////////

/** A utility routine to read a <b> text file </b> efficiently and return
* the contents as a String. Sometimes while reading log files of spawned
* processes this kind of facility is handy. Instead of opening files, coding
* FileReaders etc. this method could be employed. It is expected that the
* file to be read is <code> small </code>.
* @param fileName String representing absolute path of the file
* @return String representing the contents of the file, empty String for an empty file
* @throws java.io.IOException if there is an i/o error.
* @throws java.io.FileNotFoundException if the file could not be found
*/
public static String readSmallFile(final String fileName)
throws IOException, FileNotFoundException { return (readSmallFile(new File(fileName)) ); }

public static String readSmallFile(final File file)
throws IOException {
final BufferedReader bf = new BufferedReader(new FileReader(file));
final StringBuilder sb = new StringBuilder(); //preferred over StringBuffer, no need to synchronize
String line = null;
try {
while ( (line = bf.readLine()) != null ) { sb.append(line); sb.append(System.getProperty("line.separator")); }
}
finally {
try { bf.close(); }
catch (Exception e) {}
}
return ( sb.toString() );
}

/**
* If the path dir/file does not exist, look for it in the classpath. If found
* in classpath, create dir/file.
*
* @param file - path to look for
* @param dir - directory where the path file should exist
* @return the File representing dir/file. If that does not exist, return null.
* @throws IOException
*/

public static File getManagedFile(String file, File dir) throws IOException {
File f = new File(dir, file);
if (f.exists())
return f;
InputStream is = null, bis = null;
OutputStream os = null;
try {
is = Thread.currentThread().getContextClassLoader().getResourceAsStream(file);
if (is == null)
return null;
bis = new BufferedInputStream(is);

if(!mkdirsMaybe(f.getParentFile()))
throw new RuntimeException("Can't create parent dir of output file: " + f);

os = new BufferedOutputStream(FileUtils.openFileOutputStream(f));
byte buf[] = new byte[10240];
int len = 0;
while ((len =bis.read(buf)) > 0) { os.write(buf, 0, len); }
return f;
} finally {
if (os != null)
try { os.close(); } catch (IOException ex) {}

if (bis != null)
try { bis.close(); } catch (IOException ex) {}

if (is != null)
try { is.close(); } catch (IOException ex) {}
}
}

/**
* Write the String to a file. Then make the file readable and writable.
* If the file already exists it will be truncated and the contents replaced
* with the String argument.
* @param s The String to write to the file
* @param f The file to write the String to
* @throws IOException if any errors
*/
public static void writeStringToFile(String s, File f) throws IOException {
Writer writer = null;

try { writer = new PrintWriter(f); writer.write(s); }
finally {
if(writer != null) {
try { writer.close(); }
catch(Exception e) { //ignore }
f.setReadable(true);
f.setWritable(true);
}
}
}
/**
* Find files matching the regular expression in the given directory
* @param dir the directory to search
* @param regexp the regular expression pattern
* @return either an array of matching File objects or an empty array. Guaranteed
* to never return null
*/
public static File[] findFilesInDir(File dir, final String regexp) {
try {
File[] matches = dir.listFiles(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) { return name.matches(regexp); }
});
if (matches != null)
return matches;
}
catch (Exception e) { // fall through }

return new File[0];
}

/**

  • Read in the given resourceName as a resource, and convert to a String
    *
  • @param resourceName
  • @return the contents of the resource as a String or null if absent
    */
    public static String resourceToString(String resourceName) { byte[] bytes = resourceToBytes(resourceName); return bytes == null ? null : new String(bytes); }

/**

  • Read in the given resourceName as a resource, and convert to a byte array
    *
  • @param resourceName
  • @return the contents of the resource as a byte array or null if absent
    */
    public static byte[] resourceToBytes(String resourceName) {
    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    InputStream is = cl.getResourceAsStream(resourceName);

if (is == null)
return null;

try {
is = new BufferedInputStream(is);
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int n;

while ((n = is.read(buffer)) != -1)

{ baos.write(buffer, 0, n); }

is.close();
return baos.toByteArray();
}
catch (Exception e) {
try

{ is.close(); }

catch (Exception ex)

{ // ignore... }

return null;
}
}

/**

  • Represents a unit of work that should be retried, if needed, until it
  • succeeds or the configured retry limit is reached.
  • <p/>
  • The <code>run</code> method required by the Runnable interface is invoked
  • to perform the work.
    */
    private interface RetriableWork extends Runnable { /** * Returns whether the work to be done by this instance of RetriableWork * has been completed successfully. * <p/> * This method may be invoked multiple times and so should not have * side effects. * * @return whether the work has been successfully completed */ public boolean workComplete(); }

/**
*Retriable work for renaming a file.
*/
private static class RenameFileWork implements RetriableWork {

private File originalFile;
private File newFile;
private boolean renameResult = false;

public RenameFileWork(File originalFile, File newFile)

{ this.originalFile = originalFile; this.newFile = newFile; }

public boolean workComplete()

{ return renameResult; }

public void run()

{ renameResult = originalFile.renameTo(newFile); }

}

/**

  • Retriable work for opening a FileOutputStream.
    */
    private static class FileOutputStreamWork implements RetriableWork {

private FileOutputStream fos = null;
private Throwable lastError = null;
private File out;

public FileOutputStreamWork(File out)

{ this.out = out; }

public boolean workComplete()

{ return fos != null; }

public void run() {
try

{ fos = new FileOutputStream(out); lastError = null; }

catch (IOException ioe)

{ lastError = ioe; }

}

public FileOutputStream getStream()

{ return fos; }

public Throwable getLastError()

{ return lastError; }

}

/**

  • Retriable work for deleting a file
    */
    private static class DeleteFileWork implements RetriableWork {

private final File deleteMe;
private boolean complete = false;

private DeleteFileWork(File deleteMe)

{ this.deleteMe = deleteMe; }

@Override
public void run()

{ if (complete) return; if (deleteMe.delete()) complete = true; }

@Override
public boolean workComplete()

{ return complete; }

}

///////////////////////////////////////////////////////////////////////////

private final static char[] ILLEGAL_FILENAME_CHARS =

{'/', '\\', ':', '*', '?', '"', '<', '>', '|'}

;
private final static String ILLEGAL_FILENAME_STRING = "\\/:*?\"<>|";
private final static char REPLACEMENT_CHAR = '_';
private final static char BLANK = ' ';
private final static char DOT = '.';
private static String TMPFILENAME = "scratch";
/*
*The following property names are private, unsupported, and unpublished.
*/

private static int FILE_OPERATION_MAX_RETRIES=20;
private static int FILE_OPERATION_SLEEP_DELAY_MS=1000;
private static boolean cmdfilepropertieset=true;
private static final Level FILE_OPERATION_LOG_LEVEL = Level.FINE;
}

Comment by davidwinters1980 [ 08/Jan/15 ]

Although we suspected this issue was originally an NFS file locking issue whereby we allowed users to configure the file delete retry count and interval, we discovered this issue was caused as as a result of the existing code in FileUtils.safeIsRealDirectory(..) not correctly validating symbolic links if the application directory path being checked at undeployment time contained a reference to a symbolic link i.e. the application domain directory is a symbolic link however the application directory and files within this directory are not symbolic links

The amended code below to FileUtils.safeIsRealDirectory(..) fixes this issue:

public static boolean safeIsRealDirectory(File f) {
if (safeIsDirectory(f) == false)
return false;

String canonical =null;
String absolute=null;

try {
canonical = safeGetCanonicalPath(f);
absolute = f.getParentFile().getCanonicalPath() + File.separator + f.getName();

_utillogger.log(Level.FINE,"Canonical path and abolute path values are " + canonical + " " + absolute);

if(canonical.equals(absolute))

{ _utillogger.log(Level.FINE,"The directory " + absolute + " is a symbolic link false"); return true; }

} catch (IOException ioe)

{ _utillogger.log(Level.SEVERE, CULoggerInfo.exceptionIO, ioe); }

/* Bug 4715043 – WHOA – Bug Obscura!!

  • In Windows, if you create the File object with, say, "d:/foo", then the
  • absolute path will be "d:\foo" and the canonical path will be "D:\foo"
  • and they won't match!!!
    **/
    if (OS.isWindows() && canonical.equalsIgnoreCase(absolute)) { _utillogger.log(Level.FINE,"The directory " + absolute + " is a symbolic link false"); return true; }

_utillogger.log(Level.FINE,"The directory " + absolute + " is a symbolic link true");
return false;
}

Comment by dmatej [ 08/Jan/15 ]

Hi Dave,

I recently reported an issue GLASSFISH-21147 , it seems our problem si the same. I patched some other things, but GF team was too slow and finally my patches were accepted in Payara (and maybe later will occur also in Glassfish, but some of them were not still applied). Maybe you should send the patch there - C2B2 reaction is very fast.

I didn't find this bug, so this is great news for me, because redeploys are very annoying at this time (our script deletes directories after successful undeploy).
I will take a look at this, but I think you hit the nail on the head

EDIT: already in Payara, so I will try it! Thanks!

Comment by dmatej [ 12/Jan/15 ]

Hi Dave,

I can confirm that your patch fixed also GLASSFISH-21147 !

Thank you very much!





[GLASSFISH-21265] TypeNotPresentExceptionProxy deploying Spring Boot application Created: 07/Dec/14  Updated: 27/Mar/15  Resolved: 06/Mar/15

Status: Resolved
Project: glassfish
Component/s: deployment
Affects Version/s: 4.1
Fix Version/s: 4.2

Type: Bug Priority: Major
Reporter: philwebb Assignee: Vinay Vishal
Resolution: Fixed Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: javaee_ri_fix, payara

 Description   

When trying to deploy a Spring Boot application to GlassFish 4.1 the following error occurs:

[2014-12-06T23:18:14.803-0800] [glassfish 4.1] [SEVERE] [NCLS-CORE-00026] [javax.enterprise.system.core] [tid: _ThreadID=59 _ThreadName=AutoDeployer] [timeMillis: 1417936694803] [levelValue: 1000] [[
  Exception during lifecycle processing
java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy
	at sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:673)
	at sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:480)
	at sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:306)
	at sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:241)
	at sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:88)
	at sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70)
	at java.lang.Class.initAnnotationsIfNecessary(Class.java:3178)
	at java.lang.Class.getAnnotations(Class.java:3158)
	at org.glassfish.apf.impl.AnnotationProcessorImpl.processAnnotations(AnnotationProcessorImpl.java:285)
	at org.glassfish.apf.impl.AnnotationProcessorImpl.process(AnnotationProcessorImpl.java:195)
	at org.glassfish.apf.impl.AnnotationProcessorImpl.process(AnnotationProcessorImpl.java:134)
	at com.sun.enterprise.deployment.archivist.Archivist.processAnnotations(Archivist.java:626)
	at com.sun.enterprise.deployment.archivist.Archivist.readAnnotations(Archivist.java:462)
	at com.sun.enterprise.deployment.archivist.Archivist.readAnnotations(Archivist.java:446)
	at org.glassfish.web.deployment.archivist.WebArchivist.postAnnotationProcess(WebArchivist.java:338)
	at org.glassfish.web.deployment.archivist.WebArchivist.postAnnotationProcess(WebArchivist.java:91)
	at com.sun.enterprise.deployment.archivist.Archivist.readRestDeploymentDescriptors(Archivist.java:420)
	at com.sun.enterprise.deployment.archivist.Archivist.readDeploymentDescriptors(Archivist.java:396)
	at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:271)
	at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:280)
	at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:241)
	at com.sun.enterprise.deployment.archivist.ApplicationFactory.openArchive(ApplicationFactory.java:161)
	at org.glassfish.javaee.core.deployment.DolProvider.processDOL(DolProvider.java:203)
	at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:227)
	at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:96)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:881)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:821)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:377)
	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:539)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:535)
	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:534)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:565)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$3.run(CommandRunnerImpl.java:557)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:356)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:556)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1464)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1300(CommandRunnerImpl.java:109)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1846)
	at org.glassfish.deployment.autodeploy.AutoOperation.run(AutoOperation.java:164)
	at org.glassfish.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:597)
	at org.glassfish.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:484)
	at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:412)
	at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:403)
	at org.glassfish.deployment.autodeploy.AutoDeployService$1.run(AutoDeployService.java:233)
	at java.util.TimerThread.mainLoop(Timer.java:555)
	at java.util.TimerThread.run(Timer.java:505)

I believe that this is because GlassFish is reading a class that has an annotation that refers to another class not available at deployment time. There are many such classes with Spring Boot due to the way that auto-configuration works (e.g. @ConditionalOnClass([SomeClass.class]) where SomeClass may not be on the classpath).

I'm unsure why GlassFish is attempting to read the annotation and why it doesn't silently ignore such errors.

You can find an example deployment test application here.

Equivalent tests for TomEE and WildFly deploy fine.



 Comments   
Comment by smillidge-c2b2 [ 07/Dec/14 ]

Suggested Patch below

From 71db6c614a0d32ccf81dc61f7a347d405f31a0c9 Mon Sep 17 00:00:00 2001
Subject: [PATCH] Handled exception when processing annotations

---
 .../main/java/org/glassfish/apf/impl/AnnotationProcessorImpl.java  | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/appserver/common/annotation-framework/src/main/java/org/glassfish/apf/impl/AnnotationProcessorImpl.java b/appserver/common/annotation-framework/src/main/java/org/glassfish/apf/impl/AnnotationProcessorImpl.java
index eb20604..c12cf59 100644
--- a/appserver/common/annotation-framework/src/main/java/org/glassfish/apf/impl/AnnotationProcessorImpl.java
+++ b/appserver/common/annotation-framework/src/main/java/org/glassfish/apf/impl/AnnotationProcessorImpl.java
@@ -37,6 +37,7 @@
  * only if the new code is made subject to such option by the copyright
  * holder.
  */
+// Portions Copyright [2014] [C2B2 Consulting Limited]
 
 package org.glassfish.apf.impl;
 
@@ -281,7 +282,8 @@ public class AnnotationProcessorImpl implements AnnotationProcessor {
     {
     
         HandlerProcessingResultImpl result= new HandlerProcessingResultImpl();
-        
+
+        try {
         for (Annotation annotation : element.getAnnotations()) {
             // initialize the result...
             AnnotationInfo subElement = new AnnotationInfo(ctx, element, annotation, getTopElementType());
@@ -293,6 +295,9 @@ public class AnnotationProcessorImpl implements AnnotationProcessor {
                 }
             }       
         }
+        } catch ( Exception tnpe) {
+            logger.info("Got Exception when scanning " + element + " for annotations " + tnpe.toString() + " ignoring Annotations");
+        } 
         return result;
     }
     
-- 
1.9.1

Graphical view here https://github.com/payara/Payara/commit/71db6c614a0d32ccf81dc61f7a347d405f31a0c9

Comment by smillidge-c2b2 [ 07/Dec/14 ]

Can you try this Payara download and see if it fixes everything for you.
http://payara.co.s3-website-eu-west-1.amazonaws.com/payara.zip
It incorporates the patch above.

I tested with a build off your branch and the war deployed and showed "Hello World". Is that enough to pass the test?

Comment by philwebb [ 08/Dec/14 ]

I can confirm that the patch appears to fix things. Thanks.

Comment by Vinay Vishal [ 19/Feb/15 ]

In the suggested patch above, "java.lang.Exception" super class itself is being caught. Wherein if intention is to allow deployment to continue whenever sun.reflect.annotation.TypeNotPresentExceptionProxy is encountered during annotation processing, we can just catch the "java.lang.ArrayStoreException" and put a check on the message inside it. If reason for failure is TypeNotPresentException, deployment can be allowed to continue, in all other exceptions, deployment should fail.

Please suggest.

Comment by Vinay Vishal [ 06/Mar/15 ]

Merged in main trunk.

Sending appserver/common/annotation-framework/src/main/java/org/glassfish/apf/impl/AnnotationProcessorImpl.java
Transmitting file data .
Committed revision 63785.





[GLASSFISH-21117] Enter a positive integer value for: Max Post Size Created: 08/Jul/14  Updated: 27/Mar/15  Resolved: 02/Mar/15

Status: Resolved
Project: glassfish
Component/s: admin, admin_gui
Affects Version/s: 4.1_b08
Fix Version/s: 4.2

Type: Bug Priority: Major
Reporter: gcruscoe Assignee: Vinay Vishal
Resolution: Fixed Votes: 3
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: fishcat, javaee_ri_fix

 Description   

Go to the server-config -> network config -> http listeners -> http listener-2 (https) -> Http Tab

Try to update something other than the Max Post Size (which is defaulted to -1). For instance, I need to turn off compression to see if a different bug goes away (https not working). I cannot save because -1 is an invalid number.



 Comments   
Comment by gcruscoe [ 08/Jul/14 ]

This should have the fishcat tag set. I cannot set this now that the bug is created.

Comment by jclingan [ 08/Jul/14 ]

Added "fishcat" tag.

Comment by ratking [ 10/Oct/14 ]

I encountered the same problem in GlassFish 4.1

Comment by doobrie [ 13/Feb/15 ]

I've created a patch for this issue

Index: appserver/admingui/web/src/main/resources/grizzly/httpAttr.inc
===================================================================
--- appserver/admingui/web/src/main/resources/grizzly/httpAttr.inc	(revision 63769)
+++ appserver/admingui/web/src/main/resources/grizzly/httpAttr.inc	(working copy)
@@ -2,7 +2,7 @@

     DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.

-    Copyright (c) 2009-2013 Oracle and/or its affiliates. All rights reserved.
+    Copyright (c) 2009-2015 Oracle and/or its affiliates. All rights reserved.

     The contents of this file are subject to the terms of either the GNU
     General Public License Version 2 only ("GPL") or the Common Development
@@ -98,7 +98,7 @@
         </sun:property>

         <sun:property id="MaxPostSize"  labelAlign="left" noWrap="#{true}" overlapLabel="#{false}" label="$resource{i18n_web.http.MaxPostSize}" helpText="$resource{i18n_web.http.MaxPostSizeHelp}" >
-            <sun:textField id="headerBLength" styleClass="integer" columns="$int{20}" maxLength="#{sessionScope.fieldLengths['maxLength.http.MaxPostSize']}" text="#{pageSession.httpMap['maxPostSizeBytes']}" />
+            <sun:textField id="headerBLength" styleClass="intAllowMinusOne" columns="$int{20}" maxLength="#{sessionScope.fieldLengths['maxLength.http.MaxPostSize']}" text="#{pageSession.httpMap['maxPostSizeBytes']}" />
             <sun:staticText id="byte" style="padding: 8pt" text="$resource{i18n.common.Bytes}"/>
         </sun:property>
Comment by Vinay Vishal [ 02/Mar/15 ]

This issue has been fixed in main trunk.





[GLASSFISH-20341] Support for AroundConstruct Interceptors defined in ejb-jar.xml Created: 17/Apr/13  Updated: 26/Mar/15

Status: Open
Project: glassfish
Component/s: cdi
Affects Version/s: 4.0
Fix Version/s: 4.1

Type: Bug Priority: Major
Reporter: arjavdesai Assignee: phil.zampino
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: 4_0_1-approved

 Description   

We are seeing a few EJB devtest failure

ejb32/interceptors/constructor-level/descriptor/
ejb32/interceptors/aroundconstruct/descriptor/
ejb32/interceptors/get_method_lc/descriptor/

where Interceptor for AroundConstruct on a bean are defined "only in" ejb-jar.xml and implicit CDI scanning has been enabled. The exception reported is:

[java] Caused by: java.lang.RuntimeException: [SfulEJB] InterceptorA.AroundConstruct was not called
[java] at com.acme.BaseBean.verify(BaseBean.java:17)
[java] at com.acme.SfulEJB.hello(SfulEJB.java:19)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] at java.lang.reflect.Method.invoke(Method.java:601)
[java] at org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1081)
[java] at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1153)
[java] at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:4695)
[java] at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:630)
[java] at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
[java] at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:582)
[java] at com.acme.InterceptorA.interceptCall(InterceptorA.java:51)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] at java.lang.reflect.Method.invoke(Method.java:601)
[java] at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
[java] at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
[java] at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:582)
[java] at com.acme.InterceptorB.interceptCall(InterceptorB.java:46)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] at java.lang.reflect.Method.invoke(Method.java:601)
[java] at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
[java] at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
[java] at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:582)
[java] at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:46)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[java] at java.lang.reflect.Method.invoke(Method.java:601)
[java] at com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:883)
[java] at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:822)
[java] at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:369)
[java] at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:4667)
[java] at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4655)
[java] at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:212)



 Comments   
Comment by arjavdesai [ 17/Apr/13 ]

Waiting on WELD to resolve https://issues.jboss.org/browse/WELD-1412. In the meantime, if AroundConstruct interceptors are specified in the ejb-jar.xml, that module can't use CDI. Hence the above mentioned tests are modified to disable CDI scanning. To reproduce the issue, please remove beans.xml from it.

Comment by tlcksnyder [ 23/Apr/13 ]

JBoss not planning to fix in Weld 2.0, therefore it is not making initial drop for EE7 / 4.0.

Comment by arjavdesai [ 24/Apr/13 ]

Following EJB CTS failure are caused by this issue as well:

com/sun/ts/tests/ejb30/lite/interceptor/singleton/lifecycle/descriptor/Client.java#aroundConstructInterceptorTest_from_ejbembed: Client_aroundConstructInterceptorTest_from_ejbembed
Failed with exception
java.lang.RuntimeException: nullExpecting result list: [InterceptorA, Interceptor9, Interceptor9, InterceptorBaseBase, InterceptorBase, InterceptorBaseBase, InterceptorBase, InterceptorBeanBase, AroundConstructInterceptorBean]null , but actual: [InterceptorBaseBase, InterceptorBase, InterceptorBaseBase, InterceptorBase, InterceptorBeanBase, AroundConstructInterceptorBean]
at com.sun.ts.tests.ejb30.common.helper.Helper.compareResultList(Helper.java:36)
at com.sun.ts.tests.ejb30.common.helper.Helper.compareResultList(Helper.java:42)
at com.sun.ts.tests.ejb30.lite.interceptor.common.lifecycle.ClientBase.interceptorTest(ClientBase.java:146)
at com.sun.ts.tests.ejb30.lite.interceptor.common.lifecycle.ClientBase.aroundConstructInterceptorTest(ClientBase.java:138)
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 com.sun.ts.tests.ejb30.common.lite.EJBLiteClientBase.runTestInVehicle(EJBLiteClientBase.java:221)
at com.sun.ts.tests.ejb30.common.lite.EJBLiteClientBase.getStatus(EJBLiteClientBase.java:114)
at com.sun.ts.tests.common.vehicle.ejbembed.EJBEmbedRunner.run(EJBEmbedRunner.java:41)
at com.sun.ts.lib.harness.ServiceEETest.run(ServiceEETest.java:102)
at com.sun.ts.lib.harness.EETest.getPropsReady(EETest.java:446)
at com.sun.ts.lib.harness.ServiceEETest.run(ServiceEETest.java:210)
at com.sun.ts.lib.harness.EETest.run(EETest.java:257)
at com.sun.ts.tests.common.vehicle.VehicleClient.main(VehicleClient.java:27)

com/sun/ts/tests/ejb30/lite/interceptor/singleton/lifecycle/descriptor/Client.java#aroundConstructInterceptorTest_from_ejblitejsf: Client_aroundConstructInterceptorTest_from_ejblitejsf
com/sun/ts/tests/ejb30/lite/interceptor/singleton/lifecycle/descriptor/Client.java#aroundConstructInterceptorTest_from_ejblitejsp: Client_aroundConstructInterceptorTest_from_ejblitejsp
com/sun/ts/tests/ejb30/lite/interceptor/singleton/lifecycle/descriptor/Client.java#aroundConstructInterceptorTest_from_ejbliteservlet: Client_aroundConstructInterceptorTest_from_ejbliteservlet
com/sun/ts/tests/ejb30/lite/interceptor/singleton/lifecycle/descriptor/Client.java#aroundConstructInterceptorTest_from_ejbliteservlet2: Client_aroundConstructInterceptorTest_from_ejbliteservlet2

java.lang.RuntimeException:
Expecting result list: [InterceptorA, Interceptor9, Interceptor9, InterceptorBaseBase, InterceptorBase, InterceptorBaseBase, InterceptorBase, InterceptorBeanBase, AroundConstructInterceptorBean]
, but actual: [InterceptorBaseBase, InterceptorBase, InterceptorBaseBase, InterceptorBase, InterceptorBeanBase, AroundConstructInterceptorBean]
at com.sun.ts.tests.ejb30.common.helper.Helper.compareResultList(Helper.java:36)
at com.sun.ts.tests.ejb30.common.helper.Helper.compareResultList(Helper.java:42)
at com.sun.ts.tests.ejb30.lite.interceptor.common.lifecycle.ClientBase.interceptorTest(ClientBase.java:146)
at com.sun.ts.tests.ejb30.lite.interceptor.common.lifecycle.ClientBase.aroundConstructInterceptorTest(ClientBase.java:138)
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 com.sun.ts.tests.ejb30.common.lite.EJBLiteClientBase.runTestInVehicle(EJBLiteClientBase.java:221)
at com.sun.ts.tests.ejb30.common.lite.EJBLiteClientBase.getStatus(EJBLiteClientBase.java:114)
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 javax.el.BeanELResolver.getValue(BeanELResolver.java:363)
at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
at com.sun.el.parser.AstValue.getValue(AstValue.java:140)
at com.sun.el.parser.AstValue.getValue(AstValue.java:204)
at com.sun.el.parser.AstDeferredExpression.getValue(AstDeferredExpression.java:63)
at com.sun.el.parser.AstCompositeExpression.getValue(AstCompositeExpression.java:68)
at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:226)
at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50)
at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:50)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:194)
at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:182)
at javax.faces.component.UIOutput.getValue(UIOutput.java:174)

Comment by phil.zampino [ 20/Jun/13 ]

The associated Weld issue (https://issues.jboss.org/browse/WELD-1412) is targeted for 2.0.1, but is as of yet unresolved.

Comment by jjsnyder83 [ 26/Mar/15 ]

The upgrade to Weld 2.2.10.Final went in last night with revision 63813. Please retry.





[GLASSFISH-21053] SFSB injection changed since Java EE 6 Created: 29/Apr/14  Updated: 26/Mar/15

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

Type: Bug Priority: Major
Reporter: ChristianSch Assignee: jjsnyder83
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

we found a change in behavior between GFv3 and GFv4, but no explanation in JSR-346 on why this was changed.

@Stateful
public class StatefulService {
    
    private String state;
    
    @PostConstruct
    public void init(){
        this.state = "init";
@Stateful @SessionScoped
public class StatefulSessionScopedService {
@RequestScoped
public class Injection {
    
    @Inject
    StatefulSessionScopedService firstScoped;

    @Inject
    StatefulSessionScopedService secondScoped;

    @Inject
    StatefulService first;

    @Inject
    StatefulService second;
    
    
    public String invokeScopedService(){
        firstScoped.setState("stateFromFirst");
        return secondScoped.getState();
    }

    public String invokeStatefulService(){
        first.setState("stateFromFirst");
        return second.getState();
    }
}

invokeScopedService() behave the same in GFv3 and GFv4, both return "stateFromFirst"
However, invokeStatefulService() on GFv3 returns "init" and on GFv4 "stateFromFirst"

I assume the same SFSB is used for ScopedService because of

JSR-346 Ch. 2.4
Scoped objects, by contrast, exist in a well-defined lifecycle context:
• they may be automatically created when needed and then automatically destroyed when the context in which they were created
ends, and
• their state is automatically shared by clients that execute in the same context.

but why is the same happening for SFSB without scope? Bug or feature?



 Comments   
Comment by smillidge-c2b2 [ 09/Dec/14 ]

This is fixed by an upgrade of Weld to 2.2.7.Final

Comment by jjsnyder83 [ 24/Mar/15 ]

We will be upgrading to Weld 2.2.10.Final as soon as it is released.

Comment by jjsnyder83 [ 26/Mar/15 ]

The upgrade to Weld 2.2.10.Final went in last night with revision 63813. Please retry.





[GLASSFISH-21183] Web container still does not call AsynContext.complete() on timeout/exception Created: 03/Sep/14  Updated: 26/Mar/15

Status: In Progress
Project: glassfish
Component/s: web_container
Affects Version/s: 4.0_b89_RC5
Fix Version/s: None

Type: Bug Priority: Major
Reporter: patson Assignee: Vinay Vishal
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

As reported in https://java.net/jira/browse/GLASSFISH-19364, that AsyncContext.complete() was not called for timeout/exception, and it was fixed in rev 57176 (https://java.net/projects/glassfish/lists/commits/archive/2012-11/message/316)

After that fix, timeout/exception indeed calls Request.asyncComplete(), however that call still would not call AsyncContext.complete(), therefore does not adhere to the defintion of AsyncContext which:

Timeout:

In the event that an asynchronous operation has timed out, the container must run through these steps:

Invoke, at their onTimeout method, all AsyncListener instances registered with the ServletRequest on which the asynchronous operation was initiated.
If none of the listeners called complete() or any of the dispatch() methods, perform an error dispatch with a status code equal to HttpServletResponse.SC_INTERNAL_SERVER_ERROR.
If no matching error page was found, or the error page did not call complete() or any of the dispatch() methods, call complete().

Error:

Any errors or exceptions that may occur during the execution of this method must be caught and handled by the container, as follows:

Invoke, at their onError method, all AsyncListener instances registered with the ServletRequest for which this AsyncContext was created, and make the caught Throwable available via AsyncEvent#getThrowable.
If none of the listeners called complete() or any of the dispatch() methods, perform an error dispatch with a status code equal to HttpServletResponse.SC_INTERNAL_SERVER_ERROR, and make the above Throwable available as the value of the RequestDispatcher.ERROR_EXCEPTION request attribute.
If no matching error page was found, or the error page did not call complete() or any of the dispatch() methods, call complete().

Many thanks for your kind attention in advance!!






[GLASSFISH-20858] Message "Invalid Url Pattern" contains placeholder, while it obviously must contain the invalid pattern Created: 16/Oct/13  Updated: 26/Mar/15

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

Type: Bug Priority: Minor
Reporter: mkarg Assignee: Shing Wai Chan
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Debian 7.2, AMD64, JDK 8 (Developer's Preview)


Attachments: Text File WebResourceCollectionNode.java.patch    

 Description   

I did a typo in the URL pattern of web-resource-collection in web.xml, and as a result receive this stacktrace. Apparently the message contains the placeholder

{0} while it should contain the false pattern instead.

[2013-10-16T19:25:11.020+0200] [glassfish 4.0] [SEVERE] [NCLS-CORE-00026] [javax.enterprise.system.core] [tid: _ThreadID=99 _ThreadName=AutoDeployer] [timeMillis: 1381944311020] [levelValue: 1000] [[
Exception during lifecycle processing
java.lang.IllegalArgumentException: Invalid URL Pattern: [{0}

]
at org.glassfish.web.deployment.node.WebResourceCollectionNode.setElementValue(WebResourceCollectionNode.java:136)
at com.sun.enterprise.deployment.node.SaxParserHandler.endElement(SaxParserHandler.java:583)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:606)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.endElement(XMLSchemaValidator.java:863)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1786)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2951)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:846)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:775)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:626)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:332)
at com.sun.enterprise.deployment.io.DeploymentDescriptorFile.read(DeploymentDescriptorFile.java:318)
at com.sun.enterprise.deployment.io.DeploymentDescriptorFile.read(DeploymentDescriptorFile.java:245)
at com.sun.enterprise.deployment.archivist.Archivist.readStandardDeploymentDescriptor(Archivist.java:665)
at com.sun.enterprise.deployment.archivist.Archivist.readDeploymentDescriptors(Archivist.java:391)
at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:271)
at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:280)
at com.sun.enterprise.deployment.archivist.Archivist.open(Archivist.java:241)
at com.sun.enterprise.deployment.archivist.ApplicationFactory.openArchive(ApplicationFactory.java:161)
at org.glassfish.javaee.core.deployment.DolProvider.processDOL(DolProvider.java:198)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:222)
at org.glassfish.javaee.core.deployment.DolProvider.load(DolProvider.java:96)
at com.sun.enterprise.v3.server.ApplicationLifecycle.loadDeployer(ApplicationLifecycle.java:878)
at com.sun.enterprise.v3.server.ApplicationLifecycle.setupContainerInfos(ApplicationLifecycle.java:818)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:374)
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 org.glassfish.deployment.autodeploy.AutoOperation.run(AutoOperation.java:164)
at org.glassfish.deployment.autodeploy.AutoDeployer.deploy(AutoDeployer.java:595)
at org.glassfish.deployment.autodeploy.AutoDeployer.deployAll(AutoDeployer.java:482)
at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:410)
at org.glassfish.deployment.autodeploy.AutoDeployer.run(AutoDeployer.java:401)
at org.glassfish.deployment.autodeploy.AutoDeployService$1.run(AutoDeployService.java:233)
at java.util.TimerThread.mainLoop(Timer.java:555)
at java.util.TimerThread.run(Timer.java:505)



 Comments   
Comment by Terry2013 [ 04/Jan/15 ]

Hi, hong
I have confirmed the code.
I think the code for outputing the error message is wrong.
I create the a patch for this bug.I test it and it works fine.
Could you please reviwe it?

Comment by Hong Zhang [ 05/Jan/15 ]

Thanks for submitting a patch for this bug. The WebResourceCollectionNode is owned by the web team, reassign to them for them to review the patch.

Comment by jifeng [ 04/Feb/15 ]

Hi, Shing Wai Chan

I found that the same problem exists in the following classes. In these classes the usage of MessageFormat.format() method is error:

war-util/src/main/java/org/glassfish/web/loader/WebappClassLoader.java
web-core/src/main/java/org/apache/catalina/core/StandardServer.java
web-glue/src/main/java/org/glassfish/web/config/WebSslConfigHandler.java
web-glue/src/main/java/org/glassfish/web/deployment/node/FilterMappingNode.java
web-glue/src/main/java/org/glassfish/web/deployment/node/ServletMappingNode.java
web-naming/src/main/java/org/apache/naming/ContextBindings.java
web-naming/src/main/java/org/apache/naming/resources/WARDirContext.java
web-naming/src/main/java/org/apache/naming/resources/WebDirContext.java

Comment by lzg5039 [ 19/Mar/15 ]

Hi, Shing Wai Chan

I use the following source to fix all problems , can you help me to review it .

Index: war-util/src/main/java/org/glassfish/web/loader/WebappClassLoader.java
===================================================================
--- war-util/src/main/java/org/glassfish/web/loader/WebappClassLoader.java	(revision 62639)
+++ war-util/src/main/java/org/glassfish/web/loader/WebappClassLoader.java	(working copy)
@@ -1258,7 +1258,7 @@
                 } catch(AccessControlException ace) {
                     if (logger.isLoggable(Level.WARNING)) {
                         String msg = MessageFormat.format(
-                                FIND_CLASS_INTERNAL_SECURITY_EXCEPTION,
+                                rb.getString(FIND_CLASS_INTERNAL_SECURITY_EXCEPTION),
                                 new Object[]{name, ace.getMessage()});
                         logger.log(Level.WARNING, msg, ace);
                     }
@@ -1705,7 +1705,7 @@
                 try {
                     securityManager.checkPackageAccess(name.substring(0,i));
                 } catch (SecurityException se) {
-                    String error = MessageFormat.format(SECURITY_EXCEPTION, name);
+                    String error = MessageFormat.format(rb.getString(SECURITY_EXCEPTION), name);
                     if (logger.isLoggable(Level.INFO)) {
                         logger.log(Level.INFO, error, se);
                     }
Index: web-core/src/main/java/org/apache/catalina/core/StandardServer.java
===================================================================
--- web-core/src/main/java/org/apache/catalina/core/StandardServer.java	(revision 62639)
+++ web-core/src/main/java/org/apache/catalina/core/StandardServer.java	(working copy)
@@ -892,7 +892,7 @@
             try {
                 oname=new ObjectName( "Catalina:type=Server");
             } catch (Exception e) {
-                String msg = MessageFormat.format(ERROR_REGISTERING, e.toString());
+                String msg = MessageFormat.format(rb.getString(ERROR_REGISTERING), e.toString());
                 log.log(Level.SEVERE, msg, e);
             }
         }
Index: web-glue/src/main/java/org/glassfish/web/config/WebSslConfigHandler.java
===================================================================
--- web-glue/src/main/java/org/glassfish/web/config/WebSslConfigHandler.java	(revision 62639)
+++ web-glue/src/main/java/org/glassfish/web/config/WebSslConfigHandler.java	(working copy)
@@ -94,9 +94,9 @@
         try {
             if (listener == null) {
                 report.setMessage(
-                        WebContainer.rb.getString(
-                                MessageFormat.format(
-                                        CREATE_SSL_HTTP_NOT_FOUND, command.listenerId)));
+                        MessageFormat.format(
+                                WebContainer.rb.getString(
+                                        CREATE_SSL_HTTP_NOT_FOUND), command.listenerId));
                 httpProtocol = command.findOrCreateProtocol(command.listenerId);
             } else {
                 httpProtocol = listener.findHttpProtocol();
@@ -103,9 +103,9 @@
                 Ssl ssl = httpProtocol.getSsl();
                 if (ssl != null) {
                     report.setMessage(
-                            WebContainer.rb.getString(
-                                    MessageFormat.format(
-                                            CREATE_SSL_HTTP_ALREADY_EXISTS, command.listenerId)));
+                            MessageFormat.format(
+                                    WebContainer.rb.getString(
+                                            CREATE_SSL_HTTP_ALREADY_EXISTS), command.listenerId));
                     report.setActionExitCode(ActionReport.ExitCode.FAILURE);
                     return;
                 }
@@ -134,8 +134,8 @@
 
         if (networkListener == null) {
             report.setMessage(
-                    WebContainer.rb.getString(
-                            MessageFormat.format(DELETE_SSL_HTTP_LISTENER_NOT_FOUND, command.listenerId)));
+                    MessageFormat.format(
+                            WebContainer.rb.getString(DELETE_SSL_HTTP_LISTENER_NOT_FOUND), command.listenerId));
             report.setActionExitCode(ActionReport.ExitCode.FAILURE);
             return;
         }
@@ -143,8 +143,8 @@
         Protocol protocol = networkListener.findHttpProtocol();
         if (protocol.getSsl() == null) {
             report.setMessage(
-                    WebContainer.rb.getString(
-                            MessageFormat.format(DELETE_SSL_ELEMENT_DOES_NOT_EXIST, command.listenerId)));
+                    MessageFormat.format(
+                            WebContainer.rb.getString(DELETE_SSL_ELEMENT_DOES_NOT_EXIST), command.listenerId));
             report.setActionExitCode(ActionReport.ExitCode.FAILURE);
             return;
         }
Index: web-glue/src/main/java/org/glassfish/web/deployment/node/FilterMappingNode.java
===================================================================
--- web-glue/src/main/java/org/glassfish/web/deployment/node/FilterMappingNode.java	(revision 62639)
+++ web-glue/src/main/java/org/glassfish/web/deployment/node/FilterMappingNode.java	(working copy)
@@ -141,9 +141,9 @@
                     value = trimmedUrl;
                 } else {
                     throw new IllegalArgumentException(
-                            WebContainer.rb.getString(
-                                    MessageFormat.format(
-                                            ENTERPRISE_DEPLOYMENT_INVALID_URL_PATTERN, value)));
+                            MessageFormat.format(
+                                    WebContainer.rb.getString(
+                                            ENTERPRISE_DEPLOYMENT_INVALID_URL_PATTERN), value));
                 }
             }
             descriptor.addURLPattern(value);
Index: web-glue/src/main/java/org/glassfish/web/deployment/node/ServletMappingNode.java
===================================================================
--- web-glue/src/main/java/org/glassfish/web/deployment/node/ServletMappingNode.java	(revision 62639)
+++ web-glue/src/main/java/org/glassfish/web/deployment/node/ServletMappingNode.java	(working copy)
@@ -112,9 +112,9 @@
                     value = trimmedUrl;
                 } else {
                     throw new IllegalArgumentException(
-                            WebContainer.rb.getString(
-                                    MessageFormat.format(
-                                            FilterMappingNode.ENTERPRISE_DEPLOYMENT_INVALID_URL_PATTERN, value)));
+                            MessageFormat.format(
+                                    WebContainer.rb.getString(
+                                            FilterMappingNode.ENTERPRISE_DEPLOYMENT_INVALID_URL_PATTERN), value));
                 }
             }
 
Index: web-naming/src/main/java/org/apache/naming/ContextBindings.java
===================================================================
--- web-naming/src/main/java/org/apache/naming/ContextBindings.java	(revision 62639)
+++ web-naming/src/main/java/org/apache/naming/ContextBindings.java	(working copy)
@@ -223,8 +223,8 @@
             Context context = contextNameBindings.get(name);
             if (context == null)
                 throw new NamingException(
-                        rb.getString(
-                                MessageFormat.format(UNKNOWN_CONTEXT, name)));
+                        MessageFormat.format(
+                                rb.getString(UNKNOWN_CONTEXT), name));
             threadBindings.put(Thread.currentThread(), context);
             threadNameBindings.put(Thread.currentThread(), name);
         }
@@ -326,8 +326,8 @@
             Context context = contextNameBindings.get(name);
             if (context == null)
                 throw new NamingException(
-                        rb.getString(
-                                MessageFormat.format(UNKNOWN_CONTEXT, name)));
+                        MessageFormat.format(
+                                rb.getString(UNKNOWN_CONTEXT), name));
             clBindings.put(classLoader, context);
             clNameBindings.put(classLoader, name);
         }
Index: web-naming/src/main/java/org/apache/naming/resources/WARDirContext.java
===================================================================
--- web-naming/src/main/java/org/apache/naming/resources/WARDirContext.java	(revision 62639)
+++ web-naming/src/main/java/org/apache/naming/resources/WARDirContext.java	(working copy)
@@ -215,7 +215,7 @@
             try {
                 base.close();
             } catch (IOException e) {
-                String msg = MessageFormat.format(EXCEPTION_CLOSING_WAR, base.getName());
+                String msg = MessageFormat.format(rb.getString(EXCEPTION_CLOSING_WAR), base.getName());
                 log.log(Level.WARNING, msg, e);
             }
         }
Index: web-naming/src/main/java/org/apache/naming/resources/WebDirContext.java
===================================================================
--- web-naming/src/main/java/org/apache/naming/resources/WebDirContext.java	(revision 62639)
+++ web-naming/src/main/java/org/apache/naming/resources/WebDirContext.java	(working copy)
@@ -165,7 +165,7 @@
             jfEntry = lookupFromJars(name);
             if (jfEntry == null) {
                 throw new NamingException
-                    (rb.getString(MessageFormat.format(RESOURCES_NOT_FOUND, name)));
+                    (MessageFormat.format(rb.getString(RESOURCES_NOT_FOUND), name));
             }
         }
 
@@ -223,7 +223,7 @@
 
         if (file == null && jfeEntries.size() == 0) {
             throw new NamingException
-                    (rb.getString(MessageFormat.format(RESOURCES_NOT_FOUND, name)));
+                    (MessageFormat.format(rb.getString(RESOURCES_NOT_FOUND), name));
         }
         return new NamingContextEnumeration(namingEntries.iterator());
     }
@@ -263,7 +263,7 @@
 
         if (file == null && jfeEntries.size() == 0) {
             throw new NamingException
-                    (rb.getString(MessageFormat.format(RESOURCES_NOT_FOUND, name)));
+                    (MessageFormat.format(rb.getString(RESOURCES_NOT_FOUND), name));
         }
 
         return new NamingContextBindingsEnumeration(namingEntries.iterator(),
@@ -298,7 +298,7 @@
             JarFileEntry jfEntry = lookupFromJars(name);
             if (jfEntry == null) {
                 throw new NamingException
-                    (rb.getString(MessageFormat.format(RESOURCES_NOT_FOUND, name)));
+                    (MessageFormat.format(rb.getString(RESOURCES_NOT_FOUND), name));
             } else {
                 return new JarResourceAttributes(jfEntry.getJarEntry());
             }

Index: web-glue/src/main/java/org/glassfish/web/deployment/node/WebResourceCollectionNode.java
===================================================================
--- web-glue/src/main/java/org/glassfish/web/deployment/node/WebResourceCollectionNode.java	(revision 63724)
+++ web-glue/src/main/java/org/glassfish/web/deployment/node/WebResourceCollectionNode.java	(working copy)
@@ -134,9 +134,9 @@
                     value = trimmedUrl;
                 } else {
                     throw new IllegalArgumentException(
-                            WebContainer.rb.getString(
-                                    MessageFormat.format(
-                                            FilterMappingNode.ENTERPRISE_DEPLOYMENT_INVALID_URL_PATTERN, value)));
+                            MessageFormat.format(
+                                    WebContainer.rb.getString(FilterMappingNode.ENTERPRISE_DEPLOYMENT_INVALID_URL_PATTERN),
+                                    value));
                 }
             }
             descriptor.addUrlPattern(value);




[GLASSFISH-21338] Upgrade to Weld 2.2.10.Final Created: 25/Mar/15  Updated: 25/Mar/15  Resolved: 25/Mar/15

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

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


 Comments   
Comment by jjsnyder83 [ 25/Mar/15 ]

Committed revision 63813.





[GLASSFISH-20800] NoSuchMethodException when attempting to install log handler in GlassFish server Created: 06/Sep/13  Updated: 25/Mar/15

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

Type: Bug Priority: Major
Reporter: Craig Brumfield Assignee: michael.y.chen
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

I am attempting to configure GF server to use SMTPHandler (http://smtphandler.sourceforge.net/), and get NoSuchMethodException on SMTPTransport during domain startup. This occurs without having any applications deployed to the server and only the minimal changes to configure this log handler for the domain.

I can reproduct on both GF 3.1.2.2 and 4 (build 89). The only difference in testing these two is to either use JavaMail 1.4 (GF 3.1.2.2) or JavaMail 1.5 (GF 4).

To reproduce, make the following change to domains/domain1/config/logging.properties:

Old:
handlers=java.util.logging.ConsoleHandler
New:
handlers=java.util.logging.ConsoleHandler,smtphandler.SMTPHandler

Add:
smtphandler.SMTPHandler.level=SEVERE
smtphandler.SMTPHandler.smtpHost=<your SMTP server>
smtphandler.SMTPHandler.to=<your email to: address>
smtphandler.SMTPHandler.from=<your email from: address>
smtphandler.SMTPHandler.subject=[SMTPHandler] Application message

Then copy smtphandler-0.6.jar (attached) and mail.jar to domains/domain1/lib/ext directory. The version of the mail.jar to use is based on the version of GF you are using as noted above.

Alternatively, you can update the META-INF/MANIFEST.MF in the smtphandler-0.6.jar to add the following so that it will use the same JavaMail JAR file (osgi bundle) that is deployed with GF.

Class-Path: ../../../../modules/javax.mail.jar

After making these changes, start the domain (asadmin start-domain) and you will see the errors below when SEVERE error is logged by GF server when it determines that the certificate installed is expired. Sometimes the first message will send fine, but then subsequent messages fail with the errors below.

[2013-09-06T15:10:23.873-0400] [glassfish 4.0] [INFO] [] [] [tid: _ThreadID=16 _ThreadName=Thread-3] [timeMillis: 1378494623873] [levelValue: 800] [[
DEBUG: setDebug: JavaMail version 1.5.0]]

[2013-09-06T15:10:23.876-0400] [glassfish 4.0] [INFO] [] [] [tid: _ThreadID=16 _ThreadName=Thread-3] [timeMillis: 1378494623876] [levelValue: 800] [[
DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle]]]

[2013-09-06T15:10:23.876-0400] [glassfish 4.0] [INFO] [] [] [tid: _ThreadID=16 _ThreadName=Thread-3] [timeMillis: 1378494623876] [levelValue: 800] [[
DEBUG: Exception loading provider, THROW:]]

[2013-09-06T15:10:23.850-0400] [glassfish 4.0] [SEVERE] [] [] [tid: _ThreadID=35 _ThreadName=Thread-4] [timeMillis: 1378494623850] [levelValue: 1000] [[
java.util.logging.ErrorManager: 1: sendBuffer]]

[2013-09-06T15:10:23.888-0400] [glassfish 4.0] [INFO] [] [] [tid: _ThreadID=16 _ThreadName=Thread-3] [timeMillis: 1378494623888] [levelValue: 800] [[
java.lang.NoSuchMethodException: com.sun.mail.smtp.SMTPTransport.<init>(javax.mail.Session, javax.mail.URLName)
at java.lang.Class.getConstructor0(Class.java:2730)
at java.lang.Class.getConstructor(Class.java:1676)
at javax.mail.Session.getService(Session.java:799)
at javax.mail.Session.getTransport(Session.java:728)
at javax.mail.Session.getTransport(Session.java:668)
at javax.mail.Session.getTransport(Session.java:648)
at javax.mail.Session.getTransport(Session.java:705)
at javax.mail.Transport.send0(Transport.java:248)
at javax.mail.Transport.send(Transport.java:124)
at smtphandler.SMTPHandler.sendBuffer(SMTPHandler.java:355)
at smtphandler.SMTPHandler.publish(SMTPHandler.java:185)
at java.util.logging.Logger.log(Logger.java:565)
at com.sun.common.util.logging.LoggingOutputStream.log(LoggingOutputStream.java:152)
at com.sun.common.util.logging.LoggingOutputStream$1.run(LoggingOutputStream.java:125)]]



 Comments   
Comment by Craig Brumfield [ 06/Sep/13 ]

Note, I also enabled verbose classpath logging for the domain so that I could verify that there were not extraneous versions of JavaMail, etc. classes being loaded, but did not see any that were obvious.

Also, this issue has been reproduced on the Linux environment--not tested on Windows.

Comment by jmehrens [ 25/Mar/15 ]

When working on the MailHandler I uncovered the root cause and proposed a patch for JavaMail. The JavaMail team issued the patch (https://java.net/projects/javamail/sources/mercurial/revision/680) and filed a JavaMail issue to track the changes as Bug 6668 -skip unusable Store and Transport classes (https://kenai.com/bugzilla/show_bug.cgi?id=6668). Using JavaMail 1.5.3 should fix the issue.

The only other workaround is to set the context classloader to the classloader returned by javax.mail.Sesssion.class.getClassLoader() during the call to Transport.send.





[GLASSFISH-21336] CDI Interceptor is not called in EJB Schedule Created: 24/Mar/15  Updated: 24/Mar/15  Resolved: 24/Mar/15

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

Type: Bug Priority: Major
Reporter: janario Assignee: jjsnyder83
Resolution: Invalid Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

I have defined a CDI interceptor as following:

@Interceptor
@MyIntercept
public class MyInterceptor {
@AroundInvoke
public Object intercept(InvocationContext context) throws Exception {
LOG.info("Call {}.{}",
context.getMethod().getDeclaringClass().getName(), context.getMethod().getName());
return context.proceed();
}
}

@InterceptorBinding
@Retention(RetentionPolicy.RUNTIME)
@Target(

{ElementType.METHOD, ElementType.TYPE}

)
public @interface MyIntercept {}

And declared it in MyService
@Singleton
@MyIntercept
public class MyService {
@Schedule(second = "0/10", minute = "", hour = "", persistent = false)
public void schedule()

{ //... do something }

public void manualCall() { //... do something }

}

The interceptor was never called to schedule method but when call the manualCall method the interceptor was invoked.



 Comments   
Comment by jjsnyder83 [ 24/Mar/15 ]

Please provide a reproducible test caes.

Comment by janario [ 24/Mar/15 ]

You may close this as invalid.
After report it I discovered that it should be annotated with @AroundTimeout and not @AroundInvoke





[GLASSFISH-20870] ViewScoped conditional event observer NPE Created: 24/Oct/13  Updated: 24/Mar/15

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

Type: Bug Priority: Major
Reporter: jnfelix Assignee: jjsnyder83
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows Vista, Netbeans 7.4, included Glassfish 4.0, JSF 2.2


Tags: 4_0_1-reviewed, CDI, ViewScoped, events

 Description   

When a CDI event is fired from a JSF @SessionScoped bean, @ViewScoped event listeners using Reception.IF_EXISTS (see below) are involved in the notifications chain even if the view does NOT exist. The bean is not really created and observer method is not reached but the server throws:

java.lang.NullPointerException
at org.jboss.weld.injection.producer.BeanInjectionTarget.produce(BeanInjectionTarget.java:177)
at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:157)
at com.sun.faces.application.view.ViewScopeContextManager.createBean(ViewScopeContextManager.java:120)
at com.sun.faces.application.view.ViewScopeContext.get(ViewScopeContext.java:137)
at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:716)
at org.jboss.weld.event.ObserverMethodImpl.getReceiver(ObserverMethodImpl.java:302)
at org.jboss.weld.event.ObserverMethodImpl.getReceiverIfExists(ObserverMethodImpl.java:295)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:259)
at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:240)
at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:170)
at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:166)
at org.jboss.weld.event.TransactionalObserverNotifier.notifyObserver(TransactionalObserverNotifier.java:44)
at org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:120)
at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:113)
at org.jboss.weld.event.EventImpl.fire(EventImpl.java:79)
at com.mytest.core.web.model.UserContext.setManagedShopInfo(UserContext.java:63)
at com.my.core.web.model.UserContext$Proxy$_$$_WeldClientProxy.setManagedShopInf

Simple view scoped observer:

import javax.faces.view.ViewScoped;

@Named(value = "cdiEvents")
@ViewScoped
public class TestCdiEvents implements Serializable{

public void onUserContextEvent(@Observes (notifyObserver = Reception.IF_EXISTS) @EventUserContext String chg)

{... }

}

Notes:

  • changing the scope from @ViewScoped to @SessionScoped fixes the issue (as expected, the bean is not created and no error/event is fired);
  • changing reception to ALWAYS also behaves as expected (bean created & listener method called)

This may be related to https://community.jboss.org/message/840033 but I couldn't test the weld osgi 2.1 bundle in GF4 instalattion(some packages were removed and could't make GF start)



 Comments   
Comment by jnfelix [ 24/Oct/13 ]

Correction: it seems it tries to create the bean, the constructor for the @ViewScoped bean is called (it doesn't hit @PostConstruct where i had the breakpoint initially) when the event is fired

Comment by brutus [ 23/Sep/14 ]

The matter is even worse. If a custom scope is used (scopes from Deltaspike for example) and the observer method in such a bean is annotated with @Observes(notifyObserver = Reception.IF_EXISTS), the event is never delivered, although the bean exists. As long as this bug is not fixed, the use of CDI eventing in glassfish is very limited

Comment by jjsnyder83 [ 24/Mar/15 ]

please provide a reproducible test case.

Comment by brutus [ 24/Mar/15 ]

The issue has been fixed with GF 4.1 and WELD 2.2.2 Now it works as expected

Comment by jjsnyder83 [ 24/Mar/15 ]

I will be updating GF to Weld 2.2.10.Final as soon as it is released. Once I update I will close this jira.





[GLASSFISH-21267] Unnecessary resolving of not required JNDI-dependencies in com.sun.enterprise.container.common.impl.util.InjectionManagerImpl#_inject Created: 10/Dec/14  Updated: 24/Mar/15  Resolved: 24/Mar/15

Status: Resolved
Project: glassfish
Component/s: cdi, naming, performance
Affects Version/s: 3.1.2_b08, 4.0, 4.1
Fix Version/s: None

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


 Description   

In com.sun.enterprise.container.common.impl.util.InjectionManagerImpl#_inject there is a loop over injectableResources. Within this loop:
1. The resource is resolved using JNDI.
2. there is check if this resource is required (is suitable for target object), if not we go to next iteration.
3. The resource is injected.

As

  • The resource is not required to make the check in point 2.
  • list of (potentially) injectable resources is much bigger (at least in my case) than list of required resources
  • the frequent resolving of JNDI components leads to contention (due to shared context and usage of environment variable implemented as Hashtable in javax.naming API).
    I made a change to resolve resources only after passing point 2.

My change to fix the problem:
Numbers of lines relate to https://java.net/projects/glassfish/sources/svn/content/trunk/main/appserver/common/container-common/src/main/java/com/sun/enterprise/container/common/impl/util/InjectionManagerImpl.java?rev=63719

a) I replaced the lines 631-638 with following line (additional "sharedValue" is required to resolve the "value" only once witin the inner loop because "value" has to be final as it is referenced from inner classes).

Object sharedValue = null;

b) I inserted the following lines after line 647:

if (sharedValue == null){
	String lookupName = next.getComponentEnvName();
	if( !lookupName.startsWith("java:") ) {
		lookupName = "java:comp/env/" + lookupName;
	}
	
	sharedValue =  (componentId != null) ?
			glassfishNamingManager.lookup(componentId, lookupName) :
			glassfishNamingManager.getInitialContext().lookup(lookupName);                    	
}

final Object value = sharedValue;


 Comments   
Comment by jjsnyder83 [ 24/Mar/15 ]

This will not work in all cases. The for loop checks all injectable resources that have been defined for a class. These resources may not be the same and so the first time through the loop will assign sharedValue and every iteration through the loop after that will not get a new value.





[GLASSFISH-20736] CLONE -@Singleton @Startup (EJB) , with an @Observes(notifyObserver = IF_EXISTS) wont Deploy, Created: 01/Aug/13  Updated: 24/Mar/15  Resolved: 24/Mar/15

Status: Closed
Project: glassfish
Component/s: cdi, ejb_container
Affects Version/s: 3.1.2_b23
Fix Version/s: None

Type: Bug Priority: Major
Reporter: ulrichBerl Assignee: jjsnyder83
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Glassfish 3.1.2. Windows 7, Java 1.6,


Tags: Singleton, Startup, notifyObserver

 Description   

You get this, but i think GF eat the real weld exception somewhere. This happens only with the notifyObserver parameter, without is working fine, but i want to listen to events only when all i say so!!

I don't Implement any interface or something similar,...

@Singleton
@Startup
@TransactionManagement(TransactionManagementType.BEAN)
public class SubsystemConnectionMonitor {

// stuff
public void subsystemConnectionEventFired(
@Observes(notifyObserver = IF_EXISTS) SubsystemConnectionEvent incomingEvent)

{ subsystemConnectionMonitor.subsystemConnectionEventFired(incomingEvent); }

//other stuff

}

Then you get this,...
2013-03-05 16:54:41.278 SEVERE 20 Exception while loading the app (javax.enterprise.system.core.com.sun.enterprise.v3.server)
2013-03-05 16:54:42.963 SEVERE 20 Exception while shutting down application container (javax.enterprise.system.tools.admin.org.glassfish.deployment.admin)



 Comments   
Comment by jjsnyder83 [ 16/Apr/14 ]

Can you please test this against GF 4.0?





[GLASSFISH-20959] JMSContext injection does not work in CDI bean that is jbatch artifact. Created: 18/Jan/14  Updated: 24/Mar/15

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

Type: Bug Priority: Major
Reporter: jiggster Assignee: Mahesh Kannan
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Mac OS X 10.9, Ubuntu 12.04, Windows 7


Tags: 4_0_1-evangelists, 4_0_1-reviewed, batch, cdi, jms

 Description   

The following construct does not work when used inside CDI bean that is batch artifact:

@Inject private JMSContext context;

It results in org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type javax.enterprise.context.RequestScoped when the injected context is used.



 Comments   
Comment by jiggster [ 18/Jan/14 ]

How can I add attachment? Would like to upload sample application that presents the issue...

Comment by jjsnyder83 [ 16/Apr/14 ]

Login and you should see "Attach file" under Operations on the left column.

Comment by jjsnyder83 [ 24/Mar/15 ]

please provide a reproducible test case





[GLASSFISH-20982] @RequestScoped and @SessionScoped beans do not work in requests initiated by a forward Created: 13/Feb/14  Updated: 24/Mar/15

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

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

Linux, jdk 1.7.0_45


Tags: 4_0_1-reviewed

 Description   

When a method on a @RequestScoped or @SessionScoped bean is invoked where the request came from a forward, a org.jboss.weld.context.ContextNotActiveException is thrown.

In my setup, I have a second application that handles some resource requests. In my main app, I request the resource with a forward:

request.getServletContext().getContext("/resource").getRequestDispatcher(path).forward(request, response)

I also have some common auditing code which uses @RequestScoped and @SessionScoped beans. These beans work correctly in the main app with a user invoked request, but not in the servlet handling the forward (and possibly include).

@RequestScoped
public class RequestDataTracker {

    private String action;
    private final UUID requestId = UUID.randomUUID();
    private String sessionId;
    private String username;

    public String getSessionId() {
        return sessionId;
    }

    public void setSessionId(String sessionId) {
        if (this.sessionId == null) {
            this.sessionId = sessionId;
        }
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        if (this.username == null) {
            this.username = username;
        }
    }

    public UUID getRequestId() {
        return requestId;
    }

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    @Override
    public String toString() {
        return "RequestDataTracker{" + "action=" + action + ", requestId=" + requestId + ", sessionId=" + sessionId + ", username=" + username + '}';
    }

}

I have a BaseLoggingServlet that extends HttpServlet that has the logic for logging. The LoggingServlet extends that and implements methods to get and set data in an injected RequestDataTracker

public abstract class LoggingServlet extends BaseLoggingServlet {

    @Inject
    protected RequestDataTracker requestDataTracker;

    @Override
    protected String getUsername(HttpServletRequest request) {
        String username = SessionUtil.getSessionObject(request, CmdCtrConsts.USERNAME, String.class, false);
        if(username == null){
            username = (String) request.getAttribute(CmdCtrConsts.ACTUAL_USERNAME);
        }
        requestDataTracker.setUsername(username);
        return requestDataTracker.getUsername();
    }

    @Override
    protected UUID getRequestId(HttpServletRequest request) {
         return requestDataTracker.getRequestId();
    }

    @Override
    protected String getSessionId(HttpServletRequest request) {
        String sessionId = super.getSessionId(request);
        requestDataTracker.setSessionId(sessionId);
        return requestDataTracker.getSessionId();
    }
}

The following exception is thrown:

org.jboss.weld.context.ContextNotActiveException: WELD-001303 No active contexts for scope type javax.enterprise.context.RequestScoped
	at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:667)
	at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:74)
	at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:79)
	at com.me.myproduct.logging.performance.RequestDataTracker$Proxy$_$$_WeldClientProxy.setSessionId(Unknown Source)
	at com.me.myproduct.core.common.logging.LoggingServlet.logAndProcess(LoggingServlet.java:27)
	at com.me.myproduct.core.common.logging.LoggingServlet.doGet(LoggingServlet.java:48)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
	at org.apache.catalina.core.ApplicationDispatcher.doInvoke(ApplicationDispatcher.java:875)
	at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:739)
	at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:575)
	at org.apache.catalina.core.ApplicationDispatcher.doDispatch(ApplicationDispatcher.java:546)
	at org.apache.catalina.core.ApplicationDispatcher.dispatch(ApplicationDispatcher.java:428)
	at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:378)
	at com.me.myproduct.core.servlets.RequestDispatcherUtil.forward(RequestDispatcherUtil.java:51)
	at com.me.myproduct.core.servlets.portlet.ServeResourceDispatcherServlet.processRequest(ServeResourceDispatcherServlet.java:64)
	at com.me.myproduct.core.common.logging.LoggingServlet.logAndProcess(LoggingServlet.java:35)
	at com.me.myproduct.core.common.logging.LoggingServlet.doGet(LoggingServlet.java:48)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
	at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:344)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
	at com.me.myproduct.core.filters.SecurityFilter.doFilter(SecurityFilter.java:99)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:256)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:316)
	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:188)
	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:744)


 Comments   
Comment by jjsnyder83 [ 24/Mar/15 ]

Please provide a reproducible test case.





[GLASSFISH-20996] EJB CreateException when calling a method in a retrieved local interface Created: 28/Feb/14  Updated: 24/Mar/15  Resolved: 24/Mar/15

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

Type: Bug Priority: Major
Reporter: sicruise Assignee: jjsnyder83
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

jdk7u51 64 bit , glassfish 4 up to glassfish-4.0.1-b04-02_26_2014, ubuntu


Tags: 4_0_1-reviewed, createexception, ejb

 Description   

This application works perfectly in 3.1.2.2 and there has been no changes to the way beans are loaded when migrating to glassfish 4.

Application is building using jars under glassfish/modules directory, the same ones used for running.

EJB's effected so far are all marked with @Stateless annotation. The example here is the first bean that is executed on application startup.

EJB is being picked up and loaded into JNDI and when getting it from jndi it is an instance of the correct object. Just when you go to call a method in the bean it fails.

[2014-02-28T10:35:04.247+0000] [glassfish 4.0] [INFO] [AS-EJB-00054] [javax.enterprise.ejb.container] [tid: _ThreadID=37 _ThreadName=admin-listener(3)] [timeMillis: 1393583704247] [levelValue: 800] [[
Portable JNDI names for EJB DAOStatisticBean: [java:global/merchant/webapp/DAOStatisticBean, java:global/merchant/webapp/DAOStatisticBean!com.merchant.ejb.DAOStatisticBean]]]

but then...

[2014-02-28T10:35:08.055+0000] [glassfish 4.0] [SEVERE] [] [javax.enterprise.ejb.container] [tid: _ThreadID=37 _ThreadName=admin-listener(3)] [timeMillis: 1393583708055] [levelValue: 1000] [[
ejb.stateless_ejbcreate_exception]]

[2014-02-28T10:35:08.056+0000] [glassfish 4.0] [WARNING] [AS-EJB-00056] [javax.enterprise.ejb.container] [tid: _ThreadID=37 _ThreadName=admin-listener(3)] [timeMillis: 1393583708056] [levelValue: 900] [[
A system exception occurred during an invocation on EJB DAOStatisticBean, method: public com.merchant.dto.DAOStatisticDTO com.merchant.ejb.DAOStatisticBean.loadTodayStatistic() throws javax.ejb.EJBException]]

Root Cause of CreateException

Caused by: java.lang.NullPointerException
at java.util.concurrent.ConcurrentHashMap.hash(ConcurrentHashMap.java:333)
at java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:988)
at org.jboss.weld.manager.BeanManagerImpl.getBean(BeanManagerImpl.java:1185)
at org.jboss.weld.manager.BeanManagerImpl.getBean(BeanManagerImpl.java:185)
at org.glassfish.weld.services.JCDIServiceImpl._createJCDIInjectionContext(JCDIServiceImpl.java:198)
at org.glassfish.weld.services.JCDIServiceImpl.createJCDIInjectionContext(JCDIServiceImpl.java:179)
at com.sun.ejb.containers.BaseContainer.createEjbInstanceAndContext(BaseContainer.java:1696)
at com.sun.ejb.containers.StatelessSessionContainer.createStatelessEJB(StatelessSessionContainer.java:456)
at com.sun.ejb.containers.StatelessSessionContainer.access$000(StatelessSessionContainer.java:97)
at com.sun.ejb.containers.StatelessSessionContainer$SessionContextFactory.create(StatelessSessionContainer.java:698)
at com.sun.ejb.containers.util.pool.NonBlockingPool.getObject(NonBlockingPool.java:246)
at com.sun.ejb.containers.StatelessSessionContainer._getContext(StatelessSessionContainer.java:430)
at com.sun.ejb.containers.BaseContainer.getContext(BaseContainer.java:2579)
at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1971)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:210)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
at com.sun.proxy.$Proxy338.loadTodayStatistic(Unknown Source)
at com.merchant.ejb._EJB31_GeneratedDAOStatisticBeanIntf__Bean_.loadTodayStatistic(Unknown Source)
at com.merchant.thread.DAOStatisticThread.<init>(DAOStatisticThread.java:84)
at com.merchant.thread.DAOStatisticThread.startThread(DAOStatisticThread.java:195)
at com.merchant.InitServlet.init(InitServlet.java:102)
at javax.servlet.GenericServlet.init(GenericServlet.java:244)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1583)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1382)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5704)



 Comments   
Comment by Hong Zhang [ 11/Apr/14 ]

As stack trace is from CDI code, assign to cdi team for initial evaluation.

Comment by jjsnyder83 [ 16/Apr/14 ]

Can you please provide a source code example of:

  • The definition of the ejb
  • How it is injected into the servlet (I assume it is injected into a servlet based on the stack trace)
  • How it is accessed that causes the exception.




[GLASSFISH-21077] EJB injection works only for first ejbModule in ear if the beans.xml is not provided Created: 28/May/14  Updated: 24/Mar/15

Status: Open
Project: glassfish
Component/s: cdi, ejb_container
Affects Version/s: 4.0, 4.1_b07
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: dmatej Assignee: jjsnyder83
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: 2 hours
Time Spent: Not Specified
Original Estimate: 2 hours

Status Whiteboard:

EJB injection works only in first ejbModule in ear if the beans.xml not provided.

Tags: beans, ejb, injection, stateless

 Description   

I am migrating application from SGES2.1.1 with JDK6 to Glassfish4 with JDK8.

If I deploy EAR application with two or more EJB modules without beans.xml file, only in the first ejbModule injection works (@EJB and @Stateless annotations).

If I add beans.xml file to ejbModules, injection works in all of them.
I think this is a minor issue because this simple workaround exists, but this behavior is still incorrect.



 Comments   
Comment by jjsnyder83 [ 24/Mar/15 ]

Can you attach a reproducible test case.





[GLASSFISH-21225] Exception root cause is not available when using @Transactional Created: 08/Oct/14  Updated: 24/Mar/15  Resolved: 24/Mar/15

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

Type: Improvement Priority: Critical
Reporter: mgsoft Assignee: paul_parkinson
Resolution: Duplicate Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

If a method is marked with @Transactional and an exception is thrown within this method it is not possible to find out the root cause. Rather a RollbackException (Message: Transaction marked for rollback is thrown!)

monospaced
@Transactional
void insertValue(int i)

{ if(i < 10) throw new IllegalStateExeption("Value is too small!"); ... }

From my point of view it is OK if the particular exception is wrapped into another exception but it is absolutely necessary for the caller to be able to find out the original exception that caused the current transaction to be rolled back.



 Comments   
Comment by arjavdesai [ 24/Mar/15 ]

Its dup of GLASSFISH-21172.





[GLASSFISH-21195] CDI Injection in Entity Listener - NullPointerException Created: 15/Sep/14  Updated: 24/Mar/15

Status: Open
Project: glassfish
Component/s: entity-persistence
Affects Version/s: 4.1
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: emresindir Assignee: Srini
Resolution: Unresolved Votes: 6
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

I just up to date glassfish 4.0 to 4.1. When inject cdi bean in entity listener, i get NullPointerException.

Excetion Details:
java.lang.NullPointerException
at org.eclipse.persistence.internal.sessions.cdi.EntityListenerInjectionManagerImpl.createEntityListenerAndInjectDependancies(EntityListenerInjectionManagerImpl.java:55)
at org.eclipse.persistence.internal.jpa.metadata.listeners.EntityListener.createEntityListenerAndInjectDependancies(EntityListener.java:137)
at org.eclipse.persistence.internal.jpa.metadata.listeners.EntityListener.constructListenerInstance(EntityListener.java:151)
at org.eclipse.persistence.internal.jpa.metadata.listeners.EntityListener.getListener(EntityListener.java:234)
at org.eclipse.persistence.internal.jpa.metadata.listeners.EntityListener.invokeMethod(EntityListener.java:350)
at org.eclipse.persistence.internal.jpa.metadata.listeners.EntityListener.prePersist(EntityListener.java:449)
at org.eclipse.persistence.descriptors.DescriptorEventManager.notifyListener(DescriptorEventManager.java:748)
at org.eclipse.persistence.descriptors.DescriptorEventManager.notifyEJB30Listeners(DescriptorEventManager.java:674)
at org.eclipse.persistence.descriptors.DescriptorEventManager.executeEvent(DescriptorEventManager.java:229)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerNewObjectClone(UnitOfWorkImpl.java:4316)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerNotRegisteredNewObjectForPersist(UnitOfWorkImpl.java:4293)
at org.eclipse.persistence.internal.sessions.RepeatableWriteUnitOfWork.registerNotRegisteredNewObjectForPersist(RepeatableWriteUnitOfWork.java:518)
at org.eclipse.persistence.internal.sessions.UnitOfWorkImpl.registerNewObjectForPersist(UnitOfWorkImpl.java:4235)
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.persist(EntityManagerImpl.java:496)
at com.sun.enterprise.container.common.impl.EntityManagerWrapper.persist(EntityManagerWrapper.java:287)

Details:

public class MyEntityListener {

@Inject
UserSession userSession;

@PrePersist
public void prePersist(AbstractEntity entity)

{ UserOrganization organizastion = userSession.getUserOrganization(); //... //... }

@PreUpdate
public void preUpdate(AbstractEntity entity)

{ //... }

@PreRemove
public void preRemove(AbstractEntity entity)

{ //... }

}



 Comments   
Comment by emresindir [ 15/Sep/14 ]

My project works fine with Glassfish 4.0 but Glassfish 4.1 not. Actually i don't get any lifecycle exception when i deploy. And also i can inject my "UserSession" CDI bean anywhere, except EntityListener.

Edit
-----------------
OS: Linux Mint 17 Qiana (Cinnamon)
Java: JDK 1.7.0.60
IDE: Netbeans 8.0.1

Comment by azuchi [ 22/Sep/14 ]

I was just hit by that same issue too. (Ubuntu 14.04 LTS, JDK 1.8.0_05-b13.)
Works fine with Glassfish 4.0.

Comment by chzbrgla [ 23/Sep/14 ]

I am getting NullPointerException when injecting into an @EntityListener

It used to work on gf4.0, but is not working on gf4.1.

Ubuntu 14.04 LTS; JDK 1.7.0_67-b01

Comment by drame1499 [ 24/Sep/14 ]

Same Problem here. Glassfish 4.1 Build 13 on Ubuntu Server 14.04, JDK 1.7.0_67 Server 64Bit.

Comment by smillidge-c2b2 [ 24/Feb/15 ]

I suspect this is due to https://bugs.eclipse.org/bugs/show_bug.cgi?id=438105 which was introduced in Eclipselink 2.5.2

Comment by jjsnyder83 [ 24/Mar/15 ]

I don't think this has anything to do with CDI so changing the component.





[GLASSFISH-21163] Include ../modules/cdi-api.jar in the Class-Path: section of META-INF/MANIFEST.MF in ${com.sun.aas.installRoot}/lib/javaee.jar Created: 12/Aug/14  Updated: 24/Mar/15

Status: Open
Project: glassfish
Component/s: cdi
Affects Version/s: 4.1
Fix Version/s: future release

Type: Bug Priority: Minor
Reporter: rgoldberg Assignee: Romain Grécourt
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: 5 minutes
Time Spent: Not Specified
Original Estimate: 5 minutes
Environment:

All


Tags: cdi, jar, javaee, manifest, modules

 Description   

The:

Class-Path:

section of the file:

META-INF/MANIFEST.MF

in the jar file:

$

{com.sun.aas.installRoot}

/lib/javaee.jar

should include:

../modules/cdi-api.jar

Other Java EE jars might be missing from that manifest, too, but I haven't checked.



 Comments   
Comment by rgoldberg [ 12/Aug/14 ]

In the Description, I forgot to escape the opening brace and closing brace, so .${com.sun.aas.installRoot}/lib/javaee.jar is formatted poorly.

I cannot seem to edit the Description.

Can someone escape the braces?

Comment by rgoldberg [ 25/Aug/14 ]

Will this be fixed anytime soon?

It should only take 30 seconds to add ../modules/cdi-api.jar to the Class-Path: section.

It might take a few minutes (around 2 - 5) to check if any other jars should also be included.





[GLASSFISH-21174] Add beans_1_1.xsd to glassfish/lib/schemas Created: 25/Aug/14  Updated: 24/Mar/15

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

Type: Improvement Priority: Minor
Reporter: rgoldberg Assignee: Hong Zhang
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: 1 minute
Time Spent: Not Specified
Original Estimate: 1 minute

Tags: cdi, xsd

 Description   

Add beans_1_1.xsd (from http://xmlns.jcp.org/xml/ns/javaee/beans_1_1.xsd) to glassfish/lib/schemas

If beans_1_2.xsd actually exists (I don't think it does), also add it to glassfish/lib/schemas

Add any other missing xsds to glassfish/lib/schemas



 Comments   
Comment by jjsnyder83 [ 24/Mar/15 ]

Hong could you please address this jira?





[GLASSFISH-21177] WELD Exception due to Created: 29/Aug/14  Updated: 24/Mar/15  Resolved: 24/Mar/15

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

Type: Bug Priority: Minor
Reporter: Thomas Andres Assignee: jjsnyder83
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

I'm testing our application on glassfish 4.1 (build 13).

I see a new exception when processing things in the background (@Asynchronous observation of CDI event)

Caused by: org.jboss.weld.context.ContextNotActiveException: WELD-001303: No active contexts for scope type javax.enterprise.context.SessionScoped
        at org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:687)
        at org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:825)
        at org.jboss.weld.injection.ParameterInjectionPointImpl.getValueToInject(ParameterInjectionPointImpl.java:76)
        at org.jboss.weld.injection.MethodInjectionPoint.getParameterValues(MethodInjectionPoint.java:124)
        at org.jboss.weld.injection.MethodInjectionPoint.invokeWithSpecialValue(MethodInjectionPoint.java:69)
        at org.jboss.weld.injection.MethodInjectionPoint.invoke(MethodInjectionPoint.java:63)
        at org.jboss.weld.util.Beans.callInitializers(Beans.java:389)
        at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:377)
        at org.jboss.weld.injection.producer.ResourceInjector$1.proceed(ResourceInjector.java:70)
        at org.glassfish.weld.services.InjectionServicesImpl.aroundInject(InjectionServicesImpl.java:172)
        at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:46)
        at org.jboss.weld.injection.producer.ResourceInjector.inject(ResourceInjector.java:65)
        at org.jboss.weld.injection.producer.BasicInjectionTarget.inject(BasicInjectionTarget.java:109)
        at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:150)
        at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:69)
        at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:740)
        at org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:831)
        at org.jboss.weld.injection.ParameterInjectionPointImpl.getValueToInject(ParameterInjectionPointImpl.java:76)
        at org.jboss.weld.injection.MethodInjectionPoint.getParameterValues(MethodInjectionPoint.java:124)
        at org.jboss.weld.injection.MethodInjectionPoint.invokeWithSpecialValue(MethodInjectionPoint.java:69)
        at org.jboss.weld.injection.MethodInjectionPoint.invoke(MethodInjectionPoint.java:63)
        at org.jboss.weld.util.Beans.callInitializers(Beans.java:389)
        at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:377)
        at org.jboss.weld.injection.producer.ResourceInjector$1.proceed(ResourceInjector.java:70)
        at org.glassfish.weld.services.InjectionServicesImpl.aroundInject(InjectionServicesImpl.java:172)
        at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:46)
        at org.jboss.weld.injection.producer.ResourceInjector.inject(ResourceInjector.java:65)
        at org.jboss.weld.injection.producer.BasicInjectionTarget.inject(BasicInjectionTarget.java:109)
        at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:150)
        at org.jboss.weld.context.unbound.DependentContextImpl.get(DependentContextImpl.java:69)
        at org.jboss.weld.manager.BeanManagerImpl.getReference(BeanManagerImpl.java:740)
        at org.jboss.weld.manager.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:831)
        at org.jboss.weld.injection.ParameterInjectionPointImpl.getValueToInject(ParameterInjectionPointImpl.java:76)
        at org.jboss.weld.injection.MethodInjectionPoint.getParameterValues(MethodInjectionPoint.java:124)
        at org.jboss.weld.injection.MethodInjectionPoint.invokeWithSpecialValue(MethodInjectionPoint.java:69)
        at org.jboss.weld.injection.MethodInjectionPoint.invoke(MethodInjectionPoint.java:63)
        at org.jboss.weld.util.Beans.callInitializers(Beans.java:389)
        at org.jboss.weld.util.Beans.injectFieldsAndInitializers(Beans.java:377)
        at org.jboss.weld.injection.producer.ResourceInjector$1.proceed(ResourceInjector.java:70)
        at org.glassfish.weld.services.InjectionServicesImpl.aroundInject(InjectionServicesImpl.java:172)
        at org.jboss.weld.injection.InjectionContextImpl.run(InjectionContextImpl.java:46)
        at org.jboss.weld.injection.producer.ResourceInjector.inject(ResourceInjector.java:65)
        at org.jboss.weld.injection.producer.BasicInjectionTarget.inject(BasicInjectionTarget.java:109)
        at org.jboss.weld.bean.ManagedBean.create(ManagedBean.java:150)
        at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96)
        at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:98)
        at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:78)

I don't know if this was silently ignored in glassfish 4.0 or if there was indeed a session context available in 4.0.

The component I try to inject provides some context information per request or session. In the asynchronous case, I would only access the request state anyway. I can problably work around the issue by looking up the session state only, when it's really required.

I can see that there is no more session context available. If the change is intended, it would be nice to know what exactly changed and why.
Otherwise it should probably be fixed to avoid the issue.



 Comments   
Comment by jjsnyder83 [ 29/Aug/14 ]

Please provide a simple reproducible test case.

Comment by Thomas Andres [ 29/Aug/14 ]

I'll try to build an example. Might take some time though...





[GLASSFISH-21315] Ambiguous dependencies refer to the same CDI producer twice Created: 25/Feb/15  Updated: 24/Mar/15  Resolved: 24/Mar/15

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

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

Linux cps601 3.0.101-0.7.17-default #1 SMP Tue Feb 4 13:24:49 UTC 2014 (90aac76) x86_64 x86_64 x86_64 GNU/Linux
java version "1.7.0_40"
Java(TM) SE Runtime Environment (build 1.7.0_40-b43)
Java HotSpot(TM) 64-Bit Server VM (build 24.0-b56, mixed mode)



 Description   

The war file that used to boot without a problem in Glassfish 4.0 is refused by Glassfish 4.1 with the following funny message (Possible dependencies show two identical @Producer methods):
Exception 0 :
org.jboss.weld.exceptions.DeploymentException: WELD-001409: Ambiguous dependencies for type ConfigValue<String> with qualifiers @Default
at injection point [BackedAnnotatedField] @Inject @ConfigParams private com.epnet.ese.cds.metadata.DeliveryMetadataStoreImpl.defaultMetadataPlugin
at com.epnet.ese.cds.metadata.DeliveryMetadataStoreImpl.defaultMetadataPlugin(DeliveryMetadataStoreImpl.java:0)
Possible dependencies:

  • Producer Method [ConfigValue<Object>] with qualifiers [@Any @Default] declared as [[BackedAnnotatedMethod] @Produces public com.epnet.ese.jese.config.ConfigServiceImpl.getConfigValue(InjectionPoint)],
  • Producer Method [ConfigValue<Object>] with qualifiers [@Any @Default] declared as [[BackedAnnotatedMethod] @Produces public com.epnet.ese.jese.config.ConfigServiceImpl.getConfigValue(InjectionPoint)]

at org.jboss.weld.bootstrap.Validator.validateInjectionPointForDeploymentProblems(Validator.java:378)
at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:291)
at org.jboss.weld.bootstrap.Validator.validateGeneralBean(Validator.java:134)
at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:165)
at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:529)
at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:515)
at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:490)
at org.jboss.weld.bootstrap.WeldStartup.validateBeans(WeldStartup.java:419)



 Comments   
Comment by arie_golos [ 04/Mar/15 ]

I would like to withdraw that Jira. It was caused by having two jars of the same classes but with different versions.
On the other hand, why would cdi would take into account classes that will not be loaded due to the fact that they are behind the target classes in the classpath?

Comment by jjsnyder83 [ 24/Mar/15 ]

I'm not sure where the jars are that you refer to. If they are library jars then CDI processes them as such and you would see the Ambiguous exception.

Comment by arie_golos [ 24/Mar/15 ]

Yes, they are library jars. I was referring to my mental model in which all jars in lib directory form some kind of a class path. So, when looking for a class, the CDI would search jars in the order of their appearance in that classpath and when first class is found, it stops looking any further down the path.





[GLASSFISH-21227] Session bean fails to deploy with bean validation Created: 08/Oct/14  Updated: 24/Mar/15  Resolved: 24/Mar/15

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

Type: Bug Priority: Major
Reporter: smillidge-c2b2 Assignee: jjsnyder83
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu JDK7



 Description   

Cargotracker fails to deploy with a method on a session bean includes bean validation annotations see CARGOTRACKER-51 with ClassNotFoundException org.hibernate.validator.internal.cdi.interceptor.ValidationInterceptor

This Interceptor is being added by WeldDeployer during the handling of Application_Loaded event (line 222) however the webapplication classloader does not have this Interceptor in its classloader



 Comments   
Comment by smillidge-c2b2 [ 11/Oct/14 ]

After much debugging I believe this is caused by https://java.net/jira/browse/HK2-233

Comment by smillidge-c2b2 [ 19/Oct/14 ]

I've incorporated the hk2 2.4.0-b03 into a GlassFish build which fixes HK2-233 and the problem goes away. This can be closed when latest HK2 is included in nucleus/pom.xml





[GLASSFISH-21232] Application cannot detect custom interceptor annotation Created: 10/Oct/14  Updated: 24/Mar/15  Resolved: 24/Mar/15

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

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

glassfish 4.1
java 7 update 51



 Description   

I have a customer annotation:
@Inherited
@IntereceptorBinding
@Retention(RUNTIME)
@Target(

{METHOD, TYPE}

)
public @interface WebSecured {

}

Then I map it into interceptor:
@Interceptor
@WebSecured
public class WebRoleInterceptor implements Serializable{

private static final long serialVersionUID = 1L;

@AroundInvoke
public Object checkRight(InvocationContext ctx) throws Exception

{ System.out.println("intercept here"); return ctx.proceed(); }

}

When I put it into @Named bean, it does not work for intercept, nothing happen
@Named("testBean")
@ViewScoped

public class TestBean{
@GbSecured
public void test(){
}
}

When I call testBean.test, the WebRoleInterceptor interceptor does not work.



 Comments   
Comment by dungld [ 10/Oct/14 ]

please replace GbSecured by WebSecured on my example, typing mistake

Comment by ratking [ 10/Oct/14 ]

This is not a bug.

In order for an interceptor to be invoked in a CDI application, it mus be specified in the beans.xml file. For example, the WebRoleInterceptor class is specified as follows:

<interceptors>
    <class>xxx.yyy.WebRoleInterceptor</class>
</interceptors>

see also: Using Interceptors in CDI Applications
http://docs.oracle.com/javaee/6/tutorial/doc/gkhjx.html

Comment by dungld [ 10/Oct/14 ]

I also add bean.xml to WEB-INF dir as follows, but I cannot use @WebSecured for interceptor.

Would u try my example ?

<?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"
bean-discovery-mode="all"
>
<interceptors>
<class>xxx.yyy.WebRoleInterceptor</class>
</interceptors>
</beans>

Comment by dungld [ 10/Oct/14 ]

When I test sample billpayment of Java EE tuto for interceptor, it work ok, but when i copy those files into my project, it does not work.

I dont know what happen?

Some info about my project, it enable cluster feature, single sign on, session replicate. Maybe extra features affect to interceptor logic ?

Note: when I replace @WebSecured annotation by @Interceptors(WebRoleInterceptor.class), it work ok for intercepting. What's wrong with @WebSecured annotation?

Comment by dungld [ 18/Oct/14 ]

I fixed it! I changed @ManagedBean to @Named and everything ok. Thank you for support!





[GLASSFISH-21325] @Inject HttpSession prevents session (de)serialization Created: 06/Mar/15  Updated: 24/Mar/15

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

Type: Bug Priority: Major
Reporter: xwibao Assignee: jjsnyder83
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

JDK 1.8.0.40



 Description   

In any managed component like servlet, JAX-RS resource, WebSocket server endpoint, try the following:

@Inject HttpSession private session;

then do something to session, so that injection occurs.

After that, try to reload your application. You will get the following:

Info:   Cannot serialize session attribute WELD_S#9 for session cadd11390cd0f18aa9386925f091
java.io.NotSerializableException: org.apache.catalina.session.StandardSessionFacade
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)
	at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1548)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1509)
	at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1432)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1178)
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)
	at org.apache.catalina.session.StandardSession.writeObject(StandardSession.java:2196)

Since that moment, your service method will fail (until the session is killed):

Warning:   StandardWrapperValve[test.ApplicationConfig]: Servlet.service() for servlet test.ApplicationConfig threw exception
java.lang.ClassCastException: org.jboss.weld.proxies.HttpSession$1781022004$Proxy$_$$_WeldClientProxy cannot be cast to java.lang.String
	at org.jboss.weld.proxies.HttpSession$1781022004$Proxy$_$$_WeldClientProxy.toString(Unknown Source)

This happens because Weld stores all @SessionScoped instances as HTTP session attributes. When application is unloaded, all session attributes are serialized (session preservation). Since injected HttpSession instance itself is @SessionScoped, it undergoes serialization, too - but it's not serializable.

Probably it gets serialized as some (error) string that can't be deserialized back, which breaks serviceMethod.



 Comments   
Comment by xwibao [ 06/Mar/15 ]

I'm sorry, the correct syntax for injection is @Inject private HttpSession session;

The last line is a bit erroneous too (and unfortunately I can't edit it). I've got java.lang.ClassCastException: org.jboss.weld.proxies.HttpSession$1781022004$Proxy$_$$_WeldClientProxy cannot be cast to java.lang.String when I was simply trying to print out session.toString().

If I try to invoke any HttpSession method on this broken instance, I get the following:

java.lang.IllegalArgumentException: object is not an instance of declaring class
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:483)
	at org.jboss.weld.bean.proxy.AbstractBeanInstance.invoke(AbstractBeanInstance.java:38)

However, session.getClass().getInterfaces() shows the following:

[interface javax.servlet.http.HttpSession, interface java.io.Serializable, interface org.jboss.weld.interceptor.proxy.LifecycleMixin, interface org.jboss.weld.interceptor.util.proxy.TargetInstanceProxy, interface org.jboss.weld.bean.proxy.ProxyObject]
Comment by jjsnyder83 [ 24/Mar/15 ]

Do you really want to have your HttpSession variable persisted? Try making the sessoin variable transitive.





[GLASSFISH-21281] Glassfish 3 , jvms suddenly going down Created: 29/Dec/14  Updated: 23/Mar/15

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

Type: Bug Priority: Major
Reporter: Ptejas Assignee: Joe Di Pol
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

We have setup glassfish V-Open Source Edition 3.1.2.2 (build 5) in our production environment. The jvms from two of the glassfish nodes , go down frequently. Glassfish Jvm logs do not indicate anything unusual .

Can you please help to figure out what could be the issue



 Comments   
Comment by Ptejas [ 29/Dec/14 ]

Any update regarding this issue ?

Comment by Joe Di Pol [ 29/Dec/14 ]

Things you could try if you haven't already:

  • Update to the latest version of the JDK
  • Modify the JVM arguments especially around heap size and GC behavior
  • Identify what is different between the nodes that crash and those that don't (assuming there are some nodes that don't) and see if that sheds any light
  • Post to the GlassFish forum: https://www.java.net/forums/glassfish/glassfish
  • Try GlassFish 4.1

Beyond that if you need formal GlassFish 3 support then you could consider switching to the commercial product (Oracle GlassFish Server 3.1.2.2).

Comment by tejas.pathak [ 23/Mar/15 ]

Hi Joe,

Thanks for the information.
We already have a latest jdk sun-jdk "jdk1.6.0_45" with this glassfish. The heap size and gc parameters for the jvms look good.
Jvms from all the nodes suddenly go down intermittently
I will post to the glassfish Forum.

Thanks,
--Tejas





[GLASSFISH-21114] Failure to lookup EJB in ear/war Created: 01/Jul/14  Updated: 22/Mar/15

Status: Open
Project: glassfish
Component/s: web_services
Affects Version/s: 4.1_b05, 4.1_b06, 4.1_b07
Fix Version/s: None

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

Tags: 4_0_1-review, fishcat

 Description   

I have an ear which includes an EJB and a jax-rs WAR module, both listed in the application.xml file of the EAR.

The war contains jax-rs Application and resource bean classes, and the resource class injects stateless bean from the EJB module using @EJB annotation.

When I access the REST resource after deploy GlassFish is unable to locate the jax-rs resource bean, which lives inside the WAR. It looks like GlassFish assumes it is to be found in the EJB module (see Stacktrace below).

I have a small example application exhibiting this problem, that I will gladly upload if possible.

The problem does not appear to be in GlassFish versions 4.0 up to and including 4.0.1 b04.

We have done testing on both Java 7 and 8.

[2014-07-01T12:06:22.179+0200] [glassfish 4.0] [WARNING] [] [org.glassfish.jersey.gf.ejb.internal.EjbComponentProvider] [tid: _ThreadID=123 _ThreadName=http-listener-1(1)] [timeMillis: 1404209182179] [levelValue: 900] [[
An instance of EJB class, dk.dbc.gf.ejb.HelloWorldBean, could not be looked up using simple form name. Attempting to look up using the fully-qualified form name.
javax.naming.NamingException: Lookup failed for 'java:app/gf-4.0.1-fail-ejb-1.0-SNAPSHOT/HelloWorldBean' in SerialContext[myEnv=

{java.naming.factory.initial=com.sun.enterprise.naming.impl.SerialInitContextFactory, java.naming.factory.state=com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl, java.naming.factory.url.pkgs=com.sun.enterprise.naming}

[Root exception is javax.naming.NameNotFoundException: No object bound to name java:app/gf-4.0.1-fail-ejb-1.0-SNAPSHOT/HelloWorldBean]
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:491)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:438)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at javax.naming.InitialContext.lookup(InitialContext.java:417)
at org.glassfish.jersey.gf.ejb.internal.EjbComponentProvider.lookupSimpleForm(EjbComponentProvider.java:378)
at org.glassfish.jersey.gf.ejb.internal.EjbComponentProvider.lookup(EjbComponentProvider.java:360)
at org.glassfish.jersey.gf.ejb.internal.EjbComponentProvider.access$000(EjbComponentProvider.java:100)
at org.glassfish.jersey.gf.ejb.internal.EjbComponentProvider$EjbFactory.provide(EjbComponentProvider.java:123)
at org.jvnet.hk2.internal.FactoryCreator.create(FactoryCreator.java:96)
at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:456)
at org.jvnet.hk2.internal.PerLookupContext.findOrCreate(PerLookupContext.java:69)
at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2151)
at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:641)
at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:626)
at org.glassfish.jersey.internal.inject.Injections.getOrCreate(Injections.java:172)
at org.glassfish.jersey.server.model.MethodHandler$ClassBasedMethodHandler.getInstance(MethodHandler.java:185)
at org.glassfish.jersey.server.internal.routing.PushMethodHandlerRouter.apply(PushMethodHandlerRouter.java:74)
at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:112)
at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:115)
at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:115)
at org.glassfish.jersey.server.internal.routing.RoutingStage._apply(RoutingStage.java:115)
at org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:94)
at org.glassfish.jersey.server.internal.routing.RoutingStage.apply(RoutingStage.java:63)
at org.glassfish.jersey.process.internal.Stages.process(Stages.java:197)
at org.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:261)
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:297)
at org.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:252)
at org.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:1025)
at org.glassfish.jersey.servlet.WebComponent.service(WebComponent.java:372)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:382)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:345)
at org.glassfish.jersey.servlet.ServletContainer.service(ServletContainer.java:220)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1682)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:318)
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:415)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:282)
at com.sun.enterprise.v3.services.impl.ContainerMapper$HttpHandlerCallable.call(ContainerMapper.java:459)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:167)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:201)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:175)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:235)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:284)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:201)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:133)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:112)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:561)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:112)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:117)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:56)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:137)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:565)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:545)
at java.lang.Thread.run(Thread.java:745)
Caused by: javax.naming.NameNotFoundException: No object bound to name java:app/gf-4.0.1-fail-ejb-1.0-SNAPSHOT/HelloWorldBean
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:741)
at com.sun.enterprise.naming.impl.GlassfishNamingManagerImpl.lookup(GlassfishNamingManagerImpl.java:715)
at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.java:167)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:471)
... 64 more
]]



 Comments   
Comment by Joe Di Pol [ 01/Jul/14 ]

There have been some recent Jersey integrations. Assigning to Jakub for initial evaluation.

Comment by dbcjbn [ 04/Aug/14 ]

Would you happen to have an estimate on when this issue will be addressed, please?

Comment by dbcjbn [ 10/Sep/14 ]

This bug has also been observed on GlassFish v4.1

Comment by sgerr [ 16/Sep/14 ]

Bug is reproduced at Glassfish 4.1. It seems it is related to https://java.net/jira/browse/JERSEY-2122, but Jersey bug is at fixed state (fix version is 2.6), whereas Glassfish 4.1 is packaged with jersey of version 2.10.4-0. Unfortunately, this bug still appears. Is it scheduled for resolution?

Comment by giates2000 [ 21/Sep/14 ]

Due to this issue all my working jee7 rest web services are now stopped on glassfish v. 4.1, is there any workaround ?

Comment by gray [ 20/Oct/14 ]

I've found what is causing this bug and added comment to https://java.net/jira/browse/JERSEY-2122.

Comment by gray [ 21/Oct/14 ]

https://java.net/jira/browse/JERSEY-2690

Comment by MarvinEmilBrach [ 08/Mar/15 ]

posssible workaround: replace @Stateless with:
@javax.enterprise.context.RequestScoped
@javax.enterprise.context.ApplicationScoped
@javax.enterprise.context.ConversationScoped // NOT tested
@javax.enterprise.context.SessionScoped // NOT tested

perhaps related to https://java.net/jira/browse/GLASSFISH-21199

Comment by dobromyslov [ 15/Mar/15 ]

@RequestScoped breaks transactions in Jersey and it requires to mark methods as @Transactional.

Also Weld does not work well with @RequestScoped and raises an exception sometimes:
https://issues.jboss.org/browse/WELD-1774

Comment by dobromyslov [ 22/Mar/15 ]

java.lang.IllegalStateException: WELD-000335: Context is already active
Raises when I redeploy with JRebel.
It's been fixed in WELD 2.2.8.Final.





[GLASSFISH-21333] Error when set jvm-options "-Dcom.sun.appserv.iiop.endpoints=host1:port1,host2:port2" in jvm cluster settings Created: 18/Mar/15  Updated: 18/Mar/15

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

Type: Bug Priority: Major
Reporter: malaury Assignee: russellgold
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux Centos 6.5 64bits



 Description   

I have an frontend and backend application communicate whith remote EJB.
When I set jvm-options "-Dcom.sun.appserv.iiop.endpoints=host1:port1,host2:port2" in jvm frontend cluster settings and I start it I obtain this error :

java.lang.IllegalStateException: Service org.glassfish.gms.bootstrap.GMSAdapterService was started at level 1 but it has a run level of 10.

In the class : com.sun.enterprise.naming.impl.SerialInitContextFactory#getInitialContext, the boolean useLB is set to true. Then the com.sun.enterprise.naming.impl.SerialInitContextFactory#getORB method is call.
In the method org.glassfish.enterprise.iiop.impl.GlassFishORBManager#setFOLBProperties it created a new IiopFolbGmsClient( services ). In this class there is a call to gmsAdapterService = services.getService(GMSAdapterService.class);. A this line cannot create the GMSAdapterService because it start with runlevel 10.

Maybe I don't understand how to set the IIOP loadbalancing ?






[GLASSFISH-21296] the value of create in MDB is worng Created: 04/Feb/15  Updated: 18/Mar/15

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

Type: Bug Priority: Major
Reporter: lzg5039 Assignee: Byron Nevins
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

linux



 Description   

The method of MessageDrivenBeanStatsProvider'getCreateCount override the method of EjbMonitoringStatsProvider'getCreateCount,
but ManagedAttribute id of MessageDrivenBeanStatsProvider'getCreateCount is messagecount,
and return value of MessageDrivenBeanStatsProvider'getCreateCount is messageCount,
So I think the method name of MessageDrivenBeanStatsProvider is wrong.

org.glassfish.ejb.mdb.monitoring.stats.MessageDrivenBeanStatsProvider is as follows.

    @ManagedAttribute(id="messagecount")
    @Description( "Number of messages received for a message-driven bean")
    public CountStatistic getCreateCount() {
        return messageCount.getStatistic();
    }

com.sun.ejb.monitoring.stats.EjbMonitoringStatsProvider is as follows.

    @ManagedAttribute(id="createcount")
    @Description( "Number of times EJB create method is called")
    public CountStatistic getCreateCount() {
        return createStat.getStatistic();
    }


 Comments   
Comment by lzg5039 [ 04/Feb/15 ]

Modify the method name.The modified code is as follows.

The following source in the org.glassfish.ejb.mdb.monitoring.stats.MessageDrivenBeanStatsProvider

    @ManagedAttribute(id="messagecount")
    @Description( "Number of messages received for a message-driven bean")
    public CountStatistic getMessageCount() {
        return messageCount.getStatistic();
    }
Comment by zhouronghui [ 09/Feb/15 ]

Would you please give the operations and the error message?
By the way, the Title has a miss. "worng" should be "wrong".

Comment by lzg5039 [ 11/Mar/15 ]

Hi zhou

The following steps are excuted,the bug would happen
1.start imqbrokerd.
2.create jms resource.
3.write MDB APP(bussiness method print "Hello world" in server.log).
4.deploy MDB(receive jms message)
5.a client send a jms message,after MDB processed this message("Hello world" has been printed in server.log),the client send another jms message.

bug happens:
Because after MDB processed first message, the MDB receive second message, the MDB use the same instance to process first and second message.So the value of message-driven-bean-mon'createcount should be 1.But at this time use jconsole to see the value of message-driven-bean-mon'createcount which is 2.





[GLASSFISH-21188] Unable to create a converter for javax.json.JsonObject Created: 07/Sep/14  Updated: 18/Mar/15

Status: Open
Project: glassfish
Component/s: entity-persistence
Affects Version/s: 4.0
Fix Version/s: None

Type: Bug Priority: Major
Reporter: atrajano Assignee: Srini
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

I have tried to create a JsonObject to Clob converter

import java.sql.Clob;
import java.sql.SQLException;

import javax.json.Json;
import javax.json.JsonObject;
import javax.persistence.AttributeConverter;
import javax.persistence.Converter;
import javax.persistence.PersistenceException;
import javax.sql.rowset.serial.SerialClob;

@Converter(autoApply = true)
public class JsonObjectConverter implements
AttributeConverter<JsonObject, Clob> {

	@Override
	public Clob convertToDatabaseColumn(final JsonObject jsonObject) {
		if (jsonObject == null) {
			return null;
		}
		try {
			return new SerialClob(jsonObject.toString().toCharArray());
		} catch (final SQLException e) {
			throw new PersistenceException(e);
		}
	}

	@Override
	public JsonObject convertToEntityAttribute(final Clob dbData) {
		if (dbData == null) {
			return null;
		}
		try {
			return Json.createReader(dbData.getCharacterStream()).readObject();
		} catch (final SQLException e) {
			throw new PersistenceException(e);
		}
	}
}

I have also placed the converter in a separate JAR because of a bug with Joda Time and GLASSFISH-21161 .

Here is the relevant stack trace

Caused by: Exception [EclipseLink-67] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.DescriptorException
Exception Description: Could not serialize object into byte array.
Internal Exception: java.io.NotSerializableException: org.glassfish.json.JsonObjectBuilderImpl$JsonObjectImpl
Mapping: org.eclipse.persistence.mappings.DirectToFieldMapping[json-->BEANWITHJODATIME.JSON]

Adding the @Converter will make the system report that the class was not found.



 Comments   
Comment by atrajano [ 08/Sep/14 ]

Code for this is at https://github.com/trajano/jodatime-jpa-converter-example/tree/json-converter

Comment by atrajano [ 18/Mar/15 ]

Also applies for 4.1





[GLASSFISH-21332] java.util.logging and different resource bundles Created: 18/Mar/15  Updated: 18/Mar/15

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

Type: Bug Priority: Major
Reporter: atrajano Assignee: rajendra_inamdar
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Oracle JDK8



 Description   

I have a project that has a few JAR files. In one JAR I have a logger defined as
Logger.getLogger("net.trajano.oidc", "META-INF/Messages")

In another JAR which depends on the previous one I have a logger defined as,

Logger.getLogger("net.trajano.oidc.jaspic", "META-INF/JaspicMessages")

The reason I had different names was because if I kept the same only the Messages in the previous one is used rather than the one local to the JAR file. That is a problem on its own.

I had also created a JUnit test to see if I am even allowed to have different resource bundles to see if it is a JDK issue, but it seems to be okay.

Here is the link to the branch of my project that demonstrates the issue

https://github.com/trajano/openid-connect/tree/bad-logger

The error message I get is this.

Caused by: java.lang.IllegalArgumentException: META-INF/Messages != META-INF/JaspicMessages
at java.util.logging.Logger.setupResourceInfo(Logger.java:1928)
at java.util.logging.Logger.getLogger(Logger.java:564)
at net.trajano.openidconnect.jaspic.internal.Log.<clinit>(Log.java:25)






[GLASSFISH-20849] "maxHistoryFile" is not honored if "GFFileHandler.file" does not point to default location in logging.properties Created: 11/Oct/13  Updated: 18/Mar/15

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

Type: Bug Priority: Major
Reporter: bhuvangu Assignee: Shing Wai Chan
Resolution: Unresolved Votes: 4
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

RedHat 6, glassfish v3.1.2.2


Tags: logging

 Description   

In "logging.properties" under "domains/mydomain/config"
If i change
com.sun.enterprise.server.logging.GFFileHandler.file=/TO/MY/LOCATION/file.log

then i can see log getting created, but
"com.sun.enterprise.server.logging.GFFileHandler.maxHistoryFiles=1"
is not honored.

If i change the
com.sun.enterprise.server.logging.GFFileHandler.file=/GF_LOCATION/domains/mydomain/logs/server.log
Then maxHistoryFiles works fine.



 Comments   
Comment by bhuvangu [ 26/Oct/13 ]
nucleus/core/logging/src/main/java/com/sun/enterprise/server/logging/GFFileHandler.java?rev=62871
...
private static final String LOG_FILE_NAME = "server.log";
...
public void cleanUpHistoryLogFiles() {
...
   File[] fset = dir.listFiles();
   ArrayList candidates = new ArrayList();

   for (int i = 0; fset != null && i < fset.length; i++) {

      if (!LOG_FILE_NAME.equals(fset[i].getName()) && fset[i].isFile()
         && fset[i].getName().startsWith(LOG_FILE_NAME)) {  -----This will always be false if log filename is changed in logging.properties file.

         candidates.add(fset[i].getAbsolutePath());
      }
   }
...

Here LOG_FILE_NAME always remain as "server.log" and while cleanup the if condition always fails.

Instead of using "LOG_FILE_NAME" in if condition we should use "absoluteFile.getName()"

Comment by monotoy [ 18/Mar/15 ]

This bug also applies to glassfish v4.1

Comment by MarioLovisi [ 18/Mar/15 ]

On Glassfish 4.1 same problem





[GLASSFISH-21317] Glassfish 4.1 is giving NullPointerException when starting with JDK 9 Created: 26/Feb/15  Updated: 18/Mar/15  Resolved: 18/Mar/15

Status: Resolved
Project: glassfish
Component/s: