[UNITSOFMEASUREMENT-192] Short number support for Quantities Created: 18/Apr/16  Updated: 21/Jun/16  Resolved: 21/Jun/16

Status: Resolved
Project: unitsofmeasurement
Component/s: RI
Affects Version/s: 0.8
Fix Version/s: None

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

Tags: embedded, number
Epic Link: Portability
Sprint: Final Draft

 Description   

See https://github.com/unitsofmeasurement/uom-systems/issues/29 embedded systems tend to use very small numeric types like Short which has no "wrapper" type in the RI (or SE port) right now. Therefore it is cast to some of the closest equivalent types which leads to differrent results/rounding errors.






[UNITSOFMEASUREMENT-153] Portability of TCK Created: 27/Jul/15  Updated: 04/Sep/15  Resolved: 04/Sep/15

Status: Resolved
Project: unitsofmeasurement
Component/s: TCK
Affects Version/s: None
Fix Version/s: 0.8

Type: Task Priority: Major
Reporter: keilw Assignee: keilw
Resolution: Fixed Votes: 0
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Issue Links:
Blocks
blocks UNITSOFMEASUREMENT-101 Create TCK Resolved
Sub-Tasks:
Key
Summary
Type
Status
Assignee
UNITSOFMEASUREMENT-160 Configure Profiles for TCK Sub-task Resolved keilw  
Tags: embedded, portability, test, testing
Epic Link: Test
Sprint: Public Draft

 Description   

At least some utility classes in the initial TCK codebase use BigDecimal. If possible this should be avoided, given the API also does not use types that would be incompatible with target platforms like Java ME.



 Comments   
Comment by keilw [ 04/Sep/15 ]

TestUtils was modified to avoid BigDecimal or other elements of java.math. However, since the TCK itself is not meant to run on Java ME Embedded, there are crucial parts including TCKRunner dependent on reflection. These dependencies are OK since the TCK won't have to run on an Embedded VM, it just has to test artifacts that do in a platform-neutral way.





Portability of RI (UNITSOFMEASUREMENT-3)

[UNITSOFMEASUREMENT-119] Fix L10nPropertyResources Created: 08/Feb/15  Updated: 11/Jun/15  Resolved: 11/Jun/15

Status: Resolved
Project: unitsofmeasurement
Component/s: RI
Affects Version/s: 0.7.1
Fix Version/s: 0.8

Type: Sub-task Priority: Major
Reporter: keilw Assignee: leomrlima
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: embedded, i18n/l10n, l10n, portability
Sprint: Q1/15, Public Draft

 Description   

To get independent of SE ResourceBundle/Locale a small interface L10nBundle is implemented by 2 classes. One works, MapResourceBundle is inspired by Nokia suggestions (see attachments/comments of UNITSOFMEASUREMENT-86), it uses the idea of holding resource data in classes like the JDK class resource bundle.
L10nResources largely based on an ME substitution for bundles backed by Properties files doesn't work.

If there's no performance or size penalty, using properties would be nice, otherwise we may have to select the one that works.



 Comments   
Comment by keilw [ 11/Jun/15 ]

As of now the class-based L10nResources work, so L10nPropertyResources is not really neccessary.





Portability of RI (UNITSOFMEASUREMENT-3)

[UNITSOFMEASUREMENT-86] Getting rid of java.util.Locale and ResourceBundle Created: 15/Dec/14  Updated: 11/Jun/15  Resolved: 11/Jun/15

Status: Resolved
Project: unitsofmeasurement
Component/s: RI
Affects Version/s: 0.7
Fix Version/s: 0.8

Type: Sub-task Priority: Major
Reporter: keilw Assignee: keilw
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File How to use ResourceBundle for localization in Java ME - Wiki.mht    
Issue Links:
Related
is related to UNITSOFMEASUREMENT-7 Getting rid of java.lang.reflect Resolved
is related to UNITSOFMEASUREMENT-116 Refactor UCUMFormat into a locale neu... Resolved
is related to UNITSOFMEASUREMENT-103 Look into Unicode CLDR Resolved
Tags: embedded, format, i18n/l10n
Sprint: Q1/15, Public Draft

 Description   

While the API has already been relieved of remaining references to e.g. Locale there are a few more traces in the RI, especially related to formatting.

A key class used by formatting:
https://github.com/unitsofmeasurement/unit-ri/blob/master/src/main/java/tec/units/ri/format/SymbolMap.java
actually uses the Enumeration<String> of ResourceBundle.getKeys() for all relevant information, so if we pulled that argument out of the internals and pass an Enumeration (alternative could be 2 other methods returning a Set) instead of a ResourceBundle the RI would be free from class references not in ME 8.

Attached is a Nokia/MS page for localization in Java ME (IE format, sorry, but that's the easiest to get a single file, and Microsoft seems eager to get rid of former Nokia J2ME content, so I wanted to save the code snippets should we need them ) This way or similar the information could be retrieved and passed as a Set/Enumeration in a platform neutral way.



 Comments   
Comment by leomrlima [ 16/Dec/14 ]

UNITSOFMEASUREMENT-7 has code from Java ME 8 SDK on this kind of thing...

Comment by keilw [ 16/Dec/14 ]

Contains a similar code example from Java ME 8 SDK





[UNITSOFMEASUREMENT-80] javax.measure.spi.UnitFormatService uses java.util.Locale Created: 29/Nov/14  Updated: 01/Dec/14  Resolved: 01/Dec/14

Status: Resolved
Project: unitsofmeasurement
Component/s: API
Affects Version/s: None
Fix Version/s: None

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

Java ME 8.1 GA


Tags: embedded, format, i18n
Epic Link: Portability
Sprint: Early Draft

 Description   

javax.measure.spi.UnitFormatService uses java.util.Locale, which is not available



 Comments   
Comment by keilw [ 01/Dec/14 ]

Will remove it, thanks. The idea was to retrieve specialized versions of UnitFormat like LocalUnitFormat via Locale but we'll have to consider alternatives, e.g. pass locale strings as optional parameters if necessary. At the moment we'll remove it and see, whether it can be handled implementation-specific in this case or additional ME-compliant arguments are necessary.

Comment by keilw [ 01/Dec/14 ]

When fixing this, JavaDoc should also be adjusted. While UCUM is one option for a format it is not a good default. There are alone 3 variants and people normally expect something human readable like "10 kg" rather than a UCUM code. Thus "see UCUM Full Specification" should be removed from JavaDoc. Same for the getUnitFormat() signature where "Returns the default UCUM unit format." shall be replaced by something more neutral.
getUnitFormat("UCUM") from the same signature could be used as an example in the getUnitFormat(String name) signature, but should not be considered default. That's up to each implementation.





[UNITSOFMEASUREMENT-57] Latest Java 7 and 8 compilers break ME 8 compatibility Created: 19/Sep/14  Updated: 13/Dec/14  Resolved: 13/Dec/14

Status: Resolved
Project: unitsofmeasurement
Component/s: API, RI
Affects Version/s: None
Fix Version/s: 0.7

Type: Bug Priority: Major
Reporter: keilw Assignee: leomrlima
Resolution: Fixed Votes: 0
Labels: jdk8, timewait, unplanned
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File NB_ME8_run.txt    
Issue Links:
Blocks
blocks UNITSOFMEASUREMENT-3 Portability of RI Resolved
Related
is related to UNITSOFMEASUREMENT-10 Java 8 issues Resolved
Tags: embedded, external, inconsistency, jdk
Epic Link: Portability
Sprint: Early Draft

 Description   

I found a serious problem with Java 7 and 8 (likely caused by some recent "security" fix or other changes see SE 8u20 breaking several apps)

Even building against JDK 1.5 with a Java 7 version 55 or later breaks the apps in Java ME 8 (Final emulator) see:

java.lang.UnsupportedClassVersionError

  • java/lang/Class.invoke_verify(), bci=0
  • java/lang/Class.initialize(), bci=110
  • java/lang/Class.forName(), bci=0
  • com/sun/midp/main/CldcMIDletLoader.newInstance(), bci=1
  • com/sun/midp/midlet/MIDletStateHandler.createMIDlet(), bci=63
  • com/sun/midp/midlet/MIDletStateHandler.createAndRegisterMIDlet(), bci=16
  • com/sun/midp/midlet/MIDletStateHandler.startSuite(), bci=25
  • com/sun/midp/main/AbstractMIDletSuiteLoader.startSuite(), bci=38
  • com/sun/midp/main/CldcMIDletSuiteLoader.startSuite(), bci=5
  • com/sun/midp/main/AbstractMIDletSuiteLoader.runMIDletSuite(), bci=132
  • com/sun/midp/main/AppIsolateMIDletSuiteLoader.main(), bci=26

JARs built with earlier JDK versions (up to Feb shortly before ME 8 went Final) still work, both API and the tailored Enum impl (where all SE traces are already gone)

We must build API, RI and special ME implementations (like enum-impl) with an appropriate JDK, ideally Java SE 6u45, the most recent Java 6 version. Optionally an older version of Java 7 might work.

Especially for CI servers (will create a separate ticket if the API on GeoAPI Maven was compromised and not working) this is important for API and all ME 8 compliant artifacts.



 Comments   
Comment by keilw [ 19/Sep/14 ]

This is quite bizarre and worrying. At the moment a combination of Unit-API 0.5 and Enum-Impl 0.4 (both actually built with an EA/OpenJDK version of Java 8) work together in CLDC 8/ME 8.

Everthing built beyond that, especially with later versions of Java 8 consistently fails.

Comment by keilw [ 20/Sep/14 ]

All parts of the ME 8 SDK like MEEP JARs are built with JDK 7

  • CLDC 8: Created-By: 1.7.0 (Sun Microsystems Inc.)
  • MEEP 8: Created-By: 1.7.0 (Oracle Corporation)

Even building Unit-API and Enum-Impl or any other (ME compliant) implementation against exactly the same JDK 1.7.0 fails under ME 8 SDK/emulator.

Comment by keilw [ 20/Sep/14 ]

Console log of NB running the app when error occurs

Comment by otaviojava [ 27/Sep/14 ]

Werner It's happened with many projects that included tomcat, groovy, Jboss Seam, Jboss Forge.
The error was reported, just wait to new update.

Comment by keilw [ 29/Sep/14 ]

Still happens with ME SDK 8.1

Comment by leomrlima [ 10/Oct/14 ]

I verified this to happen in current K70 binaries too...

Comment by keilw [ 11/Oct/14 ]

Thanks for checking. K70 is a product/library of V2COM, right? It's likely not the only one affected then which should build pressure on Oracle to provide a fix soon

Comment by keilw [ 13/Dec/14 ]

According to the JCP Hackathon and Leo's effort with the latest ME 8.1 SDK this problem seems resolved.





[MQ-339] In TransactionLogManager class, DEFAULT_TXNLOG_FILE_SIZE value has an incorrect size unit Created: 13/Aug/13  Updated: 15/Aug/13  Resolved: 14/Aug/13

Status: Resolved
Project: mq
Component/s: broker-core
Affects Version/s: 5.0
Fix Version/s: 5.1 (RI-Bug-Fix)

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

OpenMQ version 5.0 (Build 14-e) running on Windows 8.


Tags: broker, config, default, embedded, jms, log, transaction

 Description   

When starting up an embedded broker, the initialization of the transaction log file fails if the default file size is being used (i.e. not set explicitly in the configuration.properties file). This causes the broker startup to fail (for version 5.0, version 4.5.2 logged an exception but started anyway).

This seems to be because of a bug in com.sun.messaging.jmq.jmsserver.persist.file.TransactionLogManager, within the method initTransactionLogOnStartUp().

When the line...

SizeString filesize = config.getSizeProperty(TXNLOG_FILE_SIZE_PROP, DEFAULT_TXNLOG_FILE_SIZE);

...fails to read a value from the properties file, it uses DEFAULT_TXNLOG_FILE_SIZE. This constant is 10MB, expressed as bytes (10 * 1024 * 1024). The property is interpreted as KB, however, so an attempt is made to set the length of the transaction log file to 10 GB.

Adding a line like this to the config.properties file proved to be an acceptable workaround:
imq.persist.file.txnLog.file.size=1024

A stack trace like is is thrown, presumably because the value being passed to RandomAccessFile.setLength is too big:

[#|2013-08-13T09:56:25.288+0100|SEVERE|5.0|imq.log.Logger|_ThreadID=1;_ThreadName=main;|ERROR [B3101]: Error retrieving persisted data:
com.sun.messaging.jmq.jmsserver.util.BrokerException: [B2096]: Unable to load transaction information.
at com.sun.messaging.jmq.jmsserver.data.TransactionList.<init>(TransactionList.java:235)
at com.sun.messaging.jmq.jmsserver.core.DestinationList.init(DestinationList.java:2714)
at com.sun.messaging.jmq.jmsserver.core.CoreLifecycleImpl.initDestinations(CoreLifecycleImpl.java:110)
at com.sun.messaging.jmq.jmsserver.Broker._start(Broker.java:1233)
at com.sun.messaging.jmq.jmsserver.Broker.start(Broker.java:447)
at com.sun.messaging.jmq.jmsserver.BrokerProcess.start(BrokerProcess.java:164)
at com.sun.messaging.jmq.jmsserver.DirectBrokerProcess.start(DirectBrokerProcess.java:92)
at com.sun.messaging.jmq.jmsclient.runtime.impl.BrokerInstanceImpl.start(BrokerInstanceImpl.java:207)
at com.saaconsultants.jms.test.JmsTestEnvironment.startOpenMQ(JmsTestEnvironment.java:195)
at com.saaconsultants.jms.test.JmsTestEnvironment.start(JmsTestEnvironment.java:101)
at com.saaconsultants.jms.test.JmsTestHelper.startJmsTestEnvironment(JmsTestHelper.java:95)
at com.saaconsultants.jms.test.JmsTestHelper.startJmsTestEnvironment(JmsTestHelper.java:35)
at com.saaconsultants.jms.test.management.ManagementTestsOpenMQ.setUpClass(ManagementTestsOpenMQ.java:31)
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:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:30)
at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: com.sun.messaging.jmq.jmsserver.util.BrokerException: Failed to create transaction log file txnlog
at com.sun.messaging.jmq.jmsserver.persist.file.TransactionLogManager.initTransactionLogOnStartUp(TransactionLogManager.java:567)
at com.sun.messaging.jmq.jmsserver.persist.file.TransactionLogManager.startup(TransactionLogManager.java:256)
at com.sun.messaging.jmq.jmsserver.persist.file.FileStore.init(FileStore.java:478)
at com.sun.messaging.jmq.jmsserver.data.TransactionList.<init>(TransactionList.java:210)
... 28 more
Caused by: java.io.IOException: An attempt was made to move the file pointer before the beginning of the file
at java.io.RandomAccessFile.setLength(Native Method)
at com.sun.messaging.jmq.io.txnlog.file.FileTransactionLogWriter.initNewFile(FileTransactionLogWriter.java:349)
at com.sun.messaging.jmq.io.txnlog.file.FileTransactionLogWriter.init(FileTransactionLogWriter.java:340)
at com.sun.messaging.jmq.io.txnlog.file.FileTransactionLogWriter.<init>(FileTransactionLogWriter.java:283)
at com.sun.messaging.jmq.jmsserver.persist.file.TransactionLogManager.initTransactionLogOnStartUp(TransactionLogManager.java:534)
... 31 more



 Comments   
Comment by amyk [ 14/Aug/13 ]

The broker property imq.persist.file.txnLog.file.size is set in default.properties. It appears that your application didn't configure for the embedded broker to find the default.properties at startup, e.g. -imqhome or -libhome

The size unit in the code for DEFAULT_TXNLOG_FILE_SIZE is now fixed in 5.0.1

Comment by Andrew_Scully [ 14/Aug/13 ]

Just thought I would provide a little background on the scenario I was working on when I ran into this.

I was creating a "standalone" broker instance, that could be run anywhere with no external dependencies. This was so that we could easily test our integration with OpenMQ as part of our automated tests (e.g. in a JUNIT test).

This meant that I couldn't depend on an external OpenMQ installation existing somewhere on the file system. All of the jars came in via Maven, so all I needed to worry about was creating the directory structure (imqhome and varhome) and the configuration files.

I found that, in 4.5.2, just creating empty .properties files worked fine. With 5.0, I found that I had to set the property mentioned above, but no others.

After that, the embedded broker worked fine!

Comment by amyk [ 14/Aug/13 ]

The broker has a set of fallback properties hard-coded. However these fallback properties do not include all properties in default.properties (for this reason, the broker should be configured to locate the default.properties which is under 'IMQ_HOME/lib', as documented in the Java Developer's Guide http://docs.oracle.com/cd/E18930_01/html/821-2440/gjmtr.html#scrolltoc). imq.persist.file.txnLog.file.size default setting is set in TransactionLogManager and 5.0 has a size unit bug, this bug, for that default value.

test case
tonga/jmsclient/direct/direct_bugMQ339





[JPA_SPEC-110] Lift requirement that MappedSuperclass, Entity and Embeddable classes must be top-level classes Created: 21/May/15  Updated: 21/May/15

Status: Open
Project: jpa-spec
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major
Reporter: flutter Assignee: ldemichiel
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

all


Tags: embedded, entity, toplevel

 Description   

Currently, JPA Specification 2.1, section 2.1, paragraph 3, states:

> The entity class must be a top-level class

The section on @Embeddable classes, in turn, refers to that section.
It is my assumption that it would be quite safe also to allow static nested classes without posing too much problems to implementations.
So, I suggest to lift that requirement such that static nested classes are allowed as entities and/or embeddables.






[GRIZZLY-1557] Embedded Grizzly:The FacesServlet cannot have a url-pattern of /*. Created: 30/Jul/13  Updated: 30/Jul/13  Resolved: 30/Jul/13

Status: Closed
Project: grizzly
Component/s: http-servlet
Affects Version/s: 2.3.4
Fix Version/s: None

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

Tags: embedded, jsf, servlet, url-pattern

 Description   

After deploying jsf application on grizzly embedded server navigating to /jsf/ url,
it throws INTERNAL ERROR on browser The FacesServlet cannot have a url-pattern of /*

expected: it should direct to index.xhtml page jsf/index.xhtml page

Same test case can be used as one I provided through email for GRIZZLY#1550 issue.
do let me know if you need test case again?

Initialization code:
=====================
Map<String,String> initmap = new HashMap<String,String>();

initmap.put("javax.faces.PROJECT_STAGE", "Development");
initmap.put("com.sun.faces.forceLoadConfiguration", "true");

ctx.addListener(com.sun.faces.config.ConfigureListener.class);

ServletRegistration reg = ctx.addServlet("Faces Servlet",
javax.faces.webapp.FacesServlet.class);
reg.setInitParameters(initmap);
reg.setAsyncSupported(true);
reg.addMapping(".jsf",".xhtml",".faces","/.xhtml");
ctx.deploy(webServer);

Log:
====
Jul 30, 2013 6:55:12 PM com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Mojarra 2.2.0 ( 20130502-2118 https://svn.java.net/svn/mojarra~svn/tags/2.2.0@11930) for context '/jsf'
Jul 30, 2013 6:55:12 PM com.sun.faces.spi.InjectionProviderFactory createInstance
INFO: JSF1048: PostConstruct/PreDestroy annotations present. ManagedBeans methods marked with these annotations will have said annotations processed.
Jul 30, 2013 6:55:14 PM com.sun.faces.lifecycle.ELResolverInitPhaseListener populateFacesELResolverForJsp
INFO: JSF1027: [null] The ELResolvers for JSF were not registered with the JSP container.
Jul 30, 2013 6:55:14 PM org.primefaces.webapp.PostConstructApplicationEventListener processEvent
INFO: Running on PrimeFaces 3.5
Jul 30, 2013 6:55:14 PM org.glassfish.grizzly.servlet.WebappContext initServlets
INFO: [webapp] Servlet [javax.faces.webapp.FacesServlet] registered for url pattern(s) [[*.jsf, *.xhtml, *.faces, /*.xhtml]].
Jul 30, 2013 6:55:14 PM org.glassfish.grizzly.servlet.WebappContext deploy
INFO: Application [webapp] is ready to service requests. Root: [/jsf].
Application started.
For Jersey tryout: http://localhost:9998/heartbeat
For static html tryout: http://localhost:9998/static/index.html
For JSF tryout http://localhost:9998/jsf/index.xhtml
Enter any key to exit
Jul 30, 2013 6:55:29 PM org.glassfish.grizzly.servlet.ServletHandler loadServlet
INFO: Loading Servlet: javax.faces.webapp.FacesServlet
Jul 30, 2013 6:55:29 PM org.glassfish.grizzly.servlet.ServletHandler doServletService
SEVERE: service exception:
javax.servlet.ServletException: javax.servlet.ServletException: The FacesServlet cannot have a url-pattern of /*. Please define a different url-pattern.
at org.glassfish.grizzly.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:151)
at org.glassfish.grizzly.servlet.FilterChainImpl.invokeFilterChain(FilterChainImpl.java:106)
at org.glassfish.grizzly.servlet.ServletHandler.doServletService(ServletHandler.java:222)
at org.glassfish.grizzly.servlet.ServletHandler.service(ServletHandler.java:170)
at org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:211)
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(Unknown Source)
Caused by: javax.servlet.ServletException: The FacesServlet cannot have a url-pattern of /*. Please define a different url-pattern.
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:659)
at org.glassfish.grizzly.servlet.FilterChainImpl.doFilter(FilterChainImpl.java:147)
... 7 more
Caused by: javax.faces.FacesException: The FacesServlet cannot have a url-pattern of /*. Please define a different url-pattern.
at com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:329)
at com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:153)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:99)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:219)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:647)
... 8 more



 Comments   
Comment by Ryan Lubke [ 30/Jul/13 ]

This error is coming from the Mojarra runtime. It's there to keep the JSP mapping from being clobbered. However, if you're not using JSP for your views, I don't see why it shouldn't be allowed. I would recommend opening an issue with them [1].

[1] https://javaserverfaces.java.net





[GRIZZLY-1556] Embedded Grizzly: Cannot inject Managed Beans in JSF application. Created: 30/Jul/13  Updated: 30/Jul/13  Resolved: 30/Jul/13

Status: Closed
Project: grizzly
Component/s: http-servlet
Affects Version/s: 2.3.4
Fix Version/s: None

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

Tags: embedded, grizzly, injection, jsf, managedbean, servlet

 Description   

Unable to inject managed beans in jsf application, in the logs it shows:
[null] The ELResolvers for JSF were not registered with the JSP container.

Same test case can be used as the one provided for GRIZZLY#1550 issue.
Do let me know if you need me to email it again?

Jul 30, 2013 6:55:12 PM com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Mojarra 2.2.0 ( 20130502-2118 https://svn.java.net/svn/mojarra~svn/tags/2.2.0@11930) for context '/jsf'
Jul 30, 2013 6:55:12 PM com.sun.faces.spi.InjectionProviderFactory createInstance
INFO: JSF1048: PostConstruct/PreDestroy annotations present. ManagedBeans methods marked with these annotations will have said annotations processed.
Jul 30, 2013 6:55:14 PM com.sun.faces.lifecycle.ELResolverInitPhaseListener populateFacesELResolverForJsp
INFO: JSF1027: [null] The ELResolvers for JSF were not registered with the JSP container.
Jul 30, 2013 6:55:14 PM org.primefaces.webapp.PostConstructApplicationEventListener processEvent
INFO: Running on PrimeFaces 3.5
Jul 30, 2013 6:55:14 PM org.glassfish.grizzly.servlet.WebappContext initServlets

Dependencies:
==============
<dependency>
<groupId>org.glassfish.grizzly</groupId>
<artifactId>grizzly-http-servlet</artifactId>
<version>2.3.5-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
</dependency>
<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-grizzly2-servlet</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>3.5</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>com.sun.faces</groupId>
<artifactId>jsf-impl</artifactId>
<version>2.2.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>jsp-api</artifactId>
<version>2.1</version>
</dependency>
<dependency>
<groupId>org.glassfish.web</groupId>
<artifactId>el-impl</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.3</version>
</dependency>



 Comments   
Comment by Ryan Lubke [ 30/Jul/13 ]

Mojarra will only scan for annotated classes in WEB-INF/classes and WEB-INF/lib.

You'll need to structure your application around that fact.

This means:
1) Using the war packaging type in your pom.xml
2) Ensure that your server's root directory is the base directory of the exploded war (simplest way to do this, is to run the JVM from that directory).





[GRIZZLY-1550] cannot deploy jsf on embedded grizzly: servlet initialization couldn't find Factory: javax.faces.context.FacesContextFactory Created: 19/Jul/13  Updated: 30/Jul/13  Resolved: 30/Jul/13

Status: Resolved
Project: grizzly
Component/s: http-servlet
Affects Version/s: 2.3.3
Fix Version/s: 2.3.5, 3.0

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

Attachments: Java Archive File grizzly-http-servlet-2.3.4-SNAPSHOT.jar     Java Archive File grizzly-http-servlet-2.3.4-SNAPSHOT.jar    
Tags: embedded, grizzly, jsf2, servlet-context

 Description   

Unable to deploy a simple JSF application on embedded grizzly,

Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory.

Code:
===============
WebappContext ctx = new WebappContext("webapp", "/testapp");

HttpServer webServer = GrizzlyHttpServerFactory.createHttpServer(BASE_URI, resourceConfig);
//
ctx.addListener(com.sun.faces.config.ConfigureListener.class);
ctx.addContextInitParameter("javax.faces.PROJECT_STAGE", "Development");
ctx.addListener(com.sun.faces.config.ConfigureListener.class);

ServletRegistration reg = ctx.addServlet("Faces Servlet", javax.faces.webapp.FacesServlet.class);//.setLoadOnStartup(1);

reg.addMapping("/faces/",".jsf","*.xhtml");
reg.setInitParameter("Faces Servlet", "*.xhtml");
ctx.deploy(webServer);
===========================

Trace:
============
Jul 19, 2013 1:58:26 PM org.glassfish.jersey.server.ApplicationHandler initialize
INFO: Initiating Jersey application, version Jersey: 2.0 2013-05-14 20:07:34...
Jul 19, 2013 1:58:27 PM org.glassfish.grizzly.http.server.NetworkListener start
INFO: Started listener bound to [localhost:9998]
Jul 19, 2013 1:58:27 PM org.glassfish.grizzly.http.server.HttpServer start
INFO: [HttpServer] Started.
Jul 19, 2013 1:58:27 PM org.glassfish.grizzly.servlet.WebappContext deploy
INFO: Starting application [webapp] ...
Jul 19, 2013 1:58:27 PM com.sun.faces.config.ConfigureListener contextInitialized
INFO: Initializing Mojarra 2.1.11 ( 20120711-1632) for context '/testapp'
Jul 19, 2013 1:58:28 PM com.sun.faces.spi.InjectionProviderFactory createInstance
INFO: JSF1048: PostConstruct/PreDestroy annotations present. ManagedBeans methods marked with these annotations will have said annotations processed.
Jul 19, 2013 1:58:29 PM org.primefaces.webapp.PostConstructApplicationEventListener processEvent
INFO: Running on PrimeFaces 3.5
Jul 19, 2013 1:58:29 PM com.sun.faces.lifecycle.ELResolverInitPhaseListener populateFacesELResolverForJsp
INFO: JSF1027: [null] The ELResolvers for JSF were not registered with the JSP container.
Jul 19, 2013 1:58:29 PM org.glassfish.grizzly.servlet.WebappContext initServlets
INFO: [webapp] Servlet [javax.faces.webapp.FacesServlet] registered for url pattern(s) [[/faces/*, *.jsf, *.xhtml, jsf, xhtml]].
Jul 19, 2013 1:58:29 PM org.glassfish.grizzly.servlet.WebappContext deploy
INFO: Application [webapp] is ready to service requests. Root: [/testapp].
Application started.
Try out http://localhost:9998/rest

Jul 19, 2013 1:59:03 PM org.glassfish.grizzly.servlet.ServletHandler loadServlet
INFO: Loading Servlet: javax.faces.webapp.FacesServlet
Jul 19, 2013 1:59:03 PM javax.faces.FactoryFinder$FactoryManager getFactory
SEVERE: Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory. Attempting to find backup.
Jul 19, 2013 1:59:03 PM org.glassfish.grizzly.servlet.ServletHandler doServletService
SEVERE: service exception:
java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory.
at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:1013)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:345)
at javax.faces.webapp.FacesServlet.init(FacesServlet.java:302)
at org.glassfish.grizzly.servlet.ServletHandler.loadServlet(ServletHandler.java:355)
at org.glassfish.grizzly.servlet.ServletHandler.doServletService(ServletHandler.java:220)
at org.glassfish.grizzly.servlet.ServletHandler.service(ServletHandler.java:189)
at org.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:209)
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(Unknown Source)

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



 Comments   
Comment by oleksiys [ 19/Jul/13 ]

Can you pls. share your project?
Unfortunately attachments don't work, but you can send it to me directly oleksiys [at] java.net

Comment by Ryan Lubke [ 19/Jul/13 ]

No need to provide a test case. As the former lead for Mojarra, I have a good idea of what's going on.

Comment by Ryan Lubke [ 19/Jul/13 ]

Could you please try the attached update and verify if it resolves the issue?

Comment by noelgaur [ 20/Jul/13 ]

Unfortunately getting the same error with grizzly-http-servlet-2.3.4-SNAPSHOT.jar
I have mailed you the test case rlubke & oleksiys at java.net

Comment by Ryan Lubke [ 20/Jul/13 ]

Yeah, looking closer, the ConfigureListener is bailing out very early - the default faces-config isn't even parsed yet, so the issue I fixed wouldn't be visible.

Comment by Ryan Lubke [ 26/Jul/13 ]

Sorry for the delay.

The issue I mentioned with the ConfigureListener is that it can't find the web.xml. It looks for the web.xml to avoid bootstrapping the JSF runtime unless the FacesServlet is defined.

As Grizzly doesn't do anything with the web.xml (keep in mind, the Grizzly Servlet runtime is not a compatible implementation), it doesn't find the mapping and it doesn't initialize the runtime.

This can be worked around by adding:

    ctx.addContextInitParameter("com.sun.faces.forceLoadConfiguration", "true");

You will also need to add commons-fileupload to your pom.xml to avoid NoClassDefFound errors:

    <dependency>
         <groupId>commons-fileupload</groupId>
         <artifactId>commons-fileupload</artifactId>
         <version>1.3</version>
     </dependency>

After adding the above, the Mojarra runtime is successfully bootstrapped and I can view the test page.

Comment by Ryan Lubke [ 26/Jul/13 ]

Note: You will still need to use the attached snapshot jar.

Comment by Ryan Lubke [ 26/Jul/13 ]

Changes applied:

2.3.x: 7b4de2786f36de280af90369ff816882b5f76716
master: 022ba4bae6bb074f400b47796b15a4e2af3f5b51

Comment by noelgaur [ 27/Jul/13 ]

I am facing errors at org.glassfish.grizzly.servlet.WebappContext.getResourcePaths java.lang.IllegalArgumentException at path: project's source folder.

Initialization code:
WebappContext ctx = new WebappContext("webapp", "/"+ JSF_ROOT);

Map<String,String> initMap = new HashMap<String,String>();

initMap.put("javax.faces.PROJECT_STAGE", "Development");
initMap.put("com.sun.faces.forceLoadConfiguration", "true");
initMap.put("javax.faces.CONFIG_FILES", "/WEB-INF");

ctx.addListener(com.sun.faces.config.ConfigureListener.class);
ServletRegistration reg = ctx.addServlet("Faces Servlet", javax.faces.webapp.FacesServlet.class);//.setLoadOnStartup(1);

reg.setInitParameters(initMap);
reg.addMapping("/*");
ctx.deploy(webServer);

If I use Jsf-api 2.2:

INFO: Initializing Mojarra 2.2.0 ( 20130502-2118 https://svn.java.net/svn/mojarra~svn/tags/2.2.0@11930) for context '/jsf'
Jul 27, 2013 7:48:54 PM com.sun.faces.config.ConfigureListener contextInitialized
SEVERE: Critical error during deployment:
com.sun.faces.config.ConfigurationException: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: D:/eclipse_indigo/workspace/GrizzlyJsf-Test/src/
at com.sun.faces.config.ConfigManager.getConfigDocuments(ConfigManager.java:751)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:349)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:214)
at org.glassfish.grizzly.servlet.WebappContext.contextInitialized(WebappContext.java:2009)
at org.glassfish.grizzly.servlet.WebappContext.deploy(WebappContext.java:301)
at com.jsftest.launch.TestJsf.main(TestJsf.java:57)
Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: D:/eclipse_indigo/workspace/GrizzlyJsf-Test/src/
at com.sun.faces.config.ConfigManager.getConfigDocuments(ConfigManager.java:738)
... 5 more
Caused by: java.lang.IllegalArgumentException: D:/eclipse_indigo/workspace/GrizzlyJsf-Test/src/
at org.glassfish.grizzly.servlet.WebappContext.getResourcePaths(WebappContext.java:1065)
at com.sun.faces.config.configprovider.WebAppFlowConfigResourceProvider.inspectDirectory

contd..

Jul 27, 2013 7:48:54 PM org.glassfish.grizzly.servlet.WebappContext contextInitialized
WARNING: GRIZZLY0300: Exception invoking contextInitialized() on ServletContextListener: com.sun.faces.config.ConfigureListener.

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

If I use Jsf-api 2.1:

INFO: Initializing Mojarra 2.1.0 (FCS 20110303) for context '/jsf'
Jul 27, 2013 7:54:59 PM com.sun.faces.spi.InjectionProviderFactory createInstance
INFO: JSF1048: PostConstruct/PreDestroy annotations present. ManagedBeans methods marked with these annotations will have said annotations processed.
Jul 27, 2013 7:55:00 PM org.primefaces.webapp.PostConstructApplicationEventListener processEvent
INFO: Running on PrimeFaces 3.5
Jul 27, 2013 7:55:00 PM com.sun.faces.lifecycle.ELResolverInitPhaseListener populateFacesELResolverForJsp
INFO: JSF1027: [null] The ELResolvers for JSF were not registered with the JSP container.
Jul 27, 2013 7:55:00 PM org.glassfish.grizzly.servlet.WebappContext initServlets
INFO: [webapp] Servlet [javax.faces.webapp.FacesServlet] registered for url pattern(s) [[/faces/*, *.jsf, *.xhtml, jsf, xhtml]].
Jul 27, 2013 7:55:00 PM org.glassfish.grizzly.servlet.WebappContext deploy
INFO: Application [webapp] is ready to service requests. Root: [/jsf].
Application started.
For Jersey tryout: http://localhost:9998/heartbeat
For static html tryout: http://localhost:9998/static/index.html
For JSF tryout http://localhost:9998/jsf/index.xhtml
Enter any key to exit
Jul 27, 2013 7:55:18 PM org.glassfish.grizzly.servlet.ServletHandler loadServlet
INFO: Loading Servlet: javax.faces.webapp.FacesServlet
Jul 27, 2013 7:55:18 PM org.glassfish.grizzly.servlet.ServletHandler doServletService
SEVERE: service exception:
java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory
at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:815)

Comment by Ryan Lubke [ 29/Jul/13 ]

This:

...
Caused by: java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: D:/eclipse_indigo/workspace/GrizzlyJsf-Test/src/
at com.sun.faces.config.ConfigManager.getConfigDocuments(ConfigManager.java:738)
... 5 more
Caused by: java.lang.IllegalArgumentException: D:/eclipse_indigo/workspace/GrizzlyJsf-Test/src/
at org.glassfish.grizzly.servlet.WebappContext.getResourcePaths(WebappContext.java:1065)
at com.sun.faces.config.configprovider.WebAppFlowConfigResourceProvider.inspectDirectory

should be logged under a new issue.

Regarding:

SEVERE: service exception:
java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory
at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:815)

Instead of trying to use the JAR attached to this issue, please reference Grizzly 2.3.5-SNAPSHOT explicitly in your pom.xml:

<dependency>
    <groupId>org.glassfish.grizzly</groupId>
    <artifactId>grizzly-http-servlet</artifactId>
    <version>2.3.5-SNAPSHOT</version>
</dependency>

Make sure it is declared before the jersey dependency.

Comment by Ryan Lubke [ 29/Jul/13 ]

I've logged https://java.net/jira/browse/GRIZZLY-1555 for the issue with getResourcePaths().

Comment by Ryan Lubke [ 29/Jul/13 ]

I've deployed a new grizzly-http-servlet-2.3.5-SNAPSHOT to the java.net maven snapshots repository.

This includes the fix for this issue as well as 1555.

Comment by noelgaur [ 30/Jul/13 ]

Thanks, after using the 2.3.5 snapshot I am no more getting the resource path issue and
am able to see the jsf page.

But I ran into some problem, due to which have raised below issues:

Embedded Grizzly: Cannot inject Managed Beans in JSF application.
https://java.net/jira/browse/GRIZZLY-1556

Embedded Grizzly:The FacesServlet cannot have a url-pattern of /*.
https://java.net/jira/browse/GRIZZLY-1557





[GLASSFISH-21042] Interfaces Specified by RemoteHome or LocalHome Not Resolved in SerialContext.lookup as Business Interfaces on EJB Session Beans, Resulting in NPE in JavaGlobalJndiNamingObjectProxy.create Created: 17/Apr/14  Updated: 03/Jun/14

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

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

Tags: 4_0_1-reviewed, embedded, maven-glassfish-plugin

 Description   

Had the following error in a JUnit test case using the embedded Glassfish 3.1.1 container:

shouldCreateABook(com.coverity.testsuite.ejb.localhome.BookLocalHomeBeanTest):
Communication exception for 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}
BookLocalHomeBeanTest.java
package com.coverity.testsuite.ejb.localhome;

import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.ejb.embeddable.EJBContainer;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.xml.ws.WebServiceRef;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

import com.coverity.testsuite.ejb.Book;
import com.coverity.testsuite.ejb.localhome.BookLocal;

import static org.junit.Assert.*;

/**
 *
 * @author pasc
 */
public class BookLocalHomeBeanTest {

    private static EJBContainer ec=null;
    private static Context ctx=null;

    public BookLocalHomeBeanTest() {}

    @BeforeClass
    public static void initContainer() throws Exception {
        Map<String, Object> props=new HashMap<String, Object>();
        props.put(EJBContainer.MODULES, new File("target/embedded-classes"));
        props.put("org.glassfish.ejb.embedded.glassfish.instance.root","./src/test/testing-domain");
        props.put("org.glassfish.ejb.embedded.glassfish.web.http.port","");
        props.put("javax.enterprise.system.container.web", "FINE");
        ec = EJBContainer.createEJBContainer(props);
        ctx = ec.getContext();
    }

    @AfterClass
    public static void closeContainer() throws Exception {
        if(ctx!=null)
            ctx.close();
        if(ec!=null)
            ec.close();
    }

    @Test
    public void shouldCreateABook() throws Exception {
        Book book = new Book();
        book.setTitle("The Hitchhiker's Guide to the Galaxy");
        book.setPrice(12.5F);
        book.setDescription("Scifi book created by Douglas Adams");
        book.setIsbn("1-84023-742-2");
        book.setNbOfPages(354);
        book.setIllustrations(false);

        Object obj = ctx.lookup("java:global/embedded-classes/BookLocalHomeBean");
        BookLocalHome bookHome = (BookLocalHome) obj;
        BookLocal bookLocal = bookHome.createBook(book);
        book = bookLocal.findBookById(book.getId());
        assertNotNull("Book should not be null", book);
        assertNotNull("ID should not be null", book.getId());
    }
}

The application I'm using is a modified version of embedded-glassfish-example:

BookLocal.java
package com.coverity.testsuite.ejb.localhome;

import java.util.List;
import javax.ejb.EJBLocalObject;

import com.coverity.testsuite.ejb.Book;

public interface BookLocal extends EJBLocalObject {

    void deleteBook(Book book);

    Book findBookById(Long id);

    List<Book> findBooks();

    Book updateBook(Book book);
}
BookLocalHome.java
package com.coverity.testsuite.ejb.localhome;

import javax.ejb.EJBLocalHome;
import javax.ejb.CreateException;

import com.coverity.testsuite.ejb.Book;

public interface BookLocalHome extends EJBLocalHome {

    public BookLocal createBook(Book book) throws CreateException;
}
BookLocalHomeBean.java
package com.coverity.testsuite.ejb.localhome;

import java.util.List;
import javax.ejb.Stateful;
import javax.ejb.LocalHome;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.annotation.Resource;
import javax.ejb.SessionContext;

import com.coverity.testsuite.ejb.Book;

/**
 *
 * @author pasc
 */
@Stateful
@LocalHome(BookLocalHome.class)
public class BookLocalHomeBean {
    @PersistenceContext(unitName = "bookstore-ejb")
    EntityManager em;

    @Resource
    private SessionContext sessionContext;

    public List<Book> findBooks() {
        return em.createNamedQuery("Book.findAllBooks", Book.class).getResultList();
    }

    public Book findBookById(Long id) {
        return em.find(Book.class, id);
    }

    public void ejbCreateBook(Book book) {
        em.persist(book);
    }

    public void deleteBook(Book book) {
        em.remove(em.merge(book));
    }

    public Book updateBook(Book book) {
        return em.merge(book);
    }
}

The above code hasn't been validated another embedded EJB container, therefore it could be incorrect. It seems correct, based on looking at the JBoss quick start EJB test cases.

I enabled logging within Glassfish by specifying the following in a .properties file:

handlers= java.util.logging.ConsoleHandler
java.util.logging.ConsoleHandler.level=FINEST
com.sun.enterprise.naming.level=FINEST

com.sun.enterprise.naming is specified in LogFacade, used as SerialContext's logger. Passing it to Maven as mvn clean test -Djava.util.logging.config.file=src/test/resources/customlogging.properties results in the nice stack trace, trimmed below:

Apr 16, 2014 11:42:55 AM com.sun.enterprise.naming.impl.SerialContext <init>
FINE: SerialContext ==> SerialContext instance created : 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}
Apr 16, 2014 11:42:55 AM com.sun.enterprise.naming.impl.SerialContext <init>
FINE: Serial Context initializing with process environment org.glassfish.api.admin.ProcessEnvironment@7a341251
Apr 16, 2014 11:42:55 AM com.sun.enterprise.naming.impl.SerialContext lookup
FINE: SerialContext ==> lookup( java:global/embedded-classes/BookLocalHomeBean)
Apr 16, 2014 11:42:55 AM com.sun.enterprise.naming.impl.SerialContext lookup
FINE: SerialContext ==> lookup relative name : java:global/embedded-classes/BookLocalHomeBean
Apr 16, 2014 11:42:55 AM com.sun.enterprise.naming.impl.SerialContextProviderImpl lookup
FINE:  SerialContextProviderImpl :: lookup java:global/embedded-classes/BookLocalHomeBean
Apr 16, 2014 11:42:55 AM com.sun.enterprise.naming.impl.SerialContext lookup
FINE: enterprise_naming.serialctx_communication_exception
Apr 16, 2014 11:42:55 AM com.sun.enterprise.naming.impl.SerialContext lookup
FINE:
java.lang.NullPointerException
        at com.sun.ejb.containers.JavaGlobalJndiNamingObjectProxy.create(JavaGlobalJndiNamingObjectProxy.java:65)
        at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:507)
        at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:455)

Kicking up Eclipse and debugging the app showed the following:

com.sun.ejb.containers.JavaGlobalJndiNamingObjectProxy.create(Context)
/*    */   public Object create(Context ic) {
/* 63 */     GenericEJBLocalHome genericLocalHome = this.container.getEJBLocalBusinessHome(this.intfName);
/*    */     
/* 65 */     return genericLocalHome.create(this.intfName);
/*    */   }
  • this.intfName = com.coverity.testsuite.ejb.localhome.BookLocalHome
  • genericLocalHome = null

null is being passed into the create call, which triggers the NPE. Looking into `getEJBLocalBusinessHome`:

com.sun.ejb.containers.BaseContainer.getEJBLocalBusinessHome(String)
/*      */   public final GenericEJBLocalHome getEJBLocalBusinessHome(String clientViewClassName)
/*      */   {
/* 1016 */     return isLocalBeanClass(clientViewClassName) ? this.ejbOptionalLocalBusinessHome : this.ejbLocalBusinessHome;
/*      */   }
  • clientViewClassName = com.coverity.testsuite.ejb.localhome.BookLocalHome
  • this.ejbOptionalLocalBusinessHome = null
  • this.ejbLocalBusinessHome = null

Both are null. Let's see which one should have been picked:

com.sun.ejb.containers.BaseContainer.isLocalBeanClass(String)
/*      */   boolean isLocalBeanClass(String className)
/*      */   {
/* 1023 */     return (this.hasOptionalLocalBusinessView) && ((className.equals(this.ejbClass.getName())) || (className.equals(this.ejbGeneratedOptionalLocalBusinessIntfClass.getName())));
/*      */   }
  • this.hasOptionalLocalBusinessView = false
  • className == com.coverity.testsuite.ejb.localhome.BookLocalHome
  • this.ejbClass.getName() == com.coverity.testsuite.ejb.localhome.BookLocalHomeBean
  • this.ejbGeneratedOptionalLocalBusinessIntfClass.getName() == null

isLocalBeanClass returns false. Assuming the bug isn't lurking above, this.ejbLocalBusinessHome should not be null.

Now, BaseContainer is the abstract class. Eclipse is telling me the actual type is com.sun.ejb.containers.StatefulSessionContainer. StatefulSessionContext doesn't set the field ejbLocalBusinessHome. Grepping around ejbLocalBusinessHome is set in BaseContainer:

com.sun.ejb.containers.BaseContainer.initializeHome()
/* 1444 */       if (this.hasLocalBusinessView) {
/* 1445 */         this.ejbLocalBusinessHomeImpl = instantiateEJBLocalBusinessHomeImpl();
/*      */         
/* 1447 */         this.ejbLocalBusinessHome = ((GenericEJBLocalHome)this.ejbLocalBusinessHomeImpl.getEJBLocalHome());
/*      */       

To get to that point, isLocal} needs to be true, which it is in this run. For the field to be set, {{this.hasLocalBusinessView needs to be true, which it isn't in this run. BaseContainer sets it only in one spot. (StatefulSessionContainer does reference it; it just doesn't set it.):

com.sun.ejb.containers.BaseContainer.BaseContainer(ContainerType, EjbDescriptor, ClassLoader)
/*  650 */         if (this.ejbDescriptor.isLocalBusinessInterfacesSupported()) {
/*  651 */           this.isLocal = true;
/*  652 */           this.hasLocalBusinessView = true;
  • this.ejbDescriptor = com.sun.enterprise.deployment.EjbSessionDescriptor

And digging into isLocalBusinessInterfacesSupported:

com.sun.enterprise.deployment.EjbAbstractDescriptor.isLocalBusinessInterfacesSupported()
/*     */   public boolean isLocalBusinessInterfacesSupported()
/*     */   {
/* 278 */     return this.localBusinessClassNames.size() > 0;
/*     */   }
  • this.ejbDescriptor.localBusinessClassNames == []

Well, shucks. localBusinessClassNames is set in a ctor and also com.sun.enterprise.deployment.EjbAbstractDescriptor.addLocalBusinessClassName(String):

com.sun.enterprise.deployment.EjbAbstractDescriptor.addLocalBusinessClassName(String)
/*     */   public void addLocalBusinessClassName(String className) {
/* 185 */     this.localBusinessClassNames.add(className);
/*     */   }

Eclipse is saying it's only called by org.glassfish.ejb.deployment.annotation.handlers.AbstractEjbHandler.setBusinessAndHomeInterfaces(EjbDescriptor, AnnotationInfo), whoop. Debugging that method shows this:

org.glassfish.ejb.deployment.annotation.handlers.AbstractEjbHandler.setBusinessAndHomeInterfaces(EjbDescriptor, AnnotationInfo)
...
/* 452 */     if (localBusIntfs.size() > 0) {
/* 453 */       for (Class next : localBusIntfs) {
/* 454 */         ejbDesc.addLocalBusinessClassName(next.getName());
/*     */       }
/*     */     }

And since the EJB bean doesn't have any business interfaces implemented, (as defined by JSR), localBusIntfs is null. From JSR 318:

While it is expected that the bean class will typically implement its business inter- face(s), if the bean class uses annotations or the deployment descriptor to designate its business interface(s), it is not required that the bean class also be specified as imple- menting the interface(s).

In my test case the EJB doesn't implement the interface. But the only way the logic above would not cause the NPE is if a business interface is found. To me that seems like a bug in Glassfish. I'd think the Local interface would have been returned. I dunno what the right thing is, though. Assuming the code above is valid, then yeah, it's a bug.






[GLASSFISH-20811] Classpath issues with embedded Glassfish 4.0 and Guava 15.0 (Google Collection library) Created: 16/Sep/13  Updated: 03/Oct/13

Status: Open
Project: glassfish
Component/s: classloader, embedded, packaging
Affects Version/s: 4.0
Fix Version/s: None

Type: Bug Priority: Major
Reporter: truemmer666 Assignee: Sanjeeb Sahoo
Resolution: Unresolved Votes: 9
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Maven 3.0.5, glassfish-embedded-all 4.0, arquillian 1.1.1.FINAL, arquillian-glassfish-embedded-3.1 1.0.0.CR4, Guava 15.0


Tags: classpath, embedded, guava

 Description   

We're unable to run Unit Tests with Arquillian and embedded Glassfish 4.0 if an application under test is using Guava 15.0.
The tests work with older versions of Guava (for example 13.01). The problem seems to originate in Glassfish using its own version of the Googles Collection library, which is subject to change and has been moved into the Guava project.

Can you guys suggest a solution to this problem, or do you know any good workarounds?

This is mentioned on the Guava-Homepage:

Guava contains a strictly compatible superset of the old, deprecated Google Collections Library. You should not use that library anymore.

This is the stack trace which occurs during deployment:

Sep 16, 2013 10:37:50 AM com.sun.enterprise.v3.server.ApplicationLifecycle deploy
SEVERE: Exception during lifecycle processing
java.lang.IllegalAccessError: tried to access method com.google.common.collect.MapMaker.makeComputingMap(Lcom/google/common/base/Function;)Ljava/util/concurrent/ConcurrentMap; from class org.jboss.weld.logging.WeldMessageConveyor
	at org.jboss.weld.logging.WeldMessageConveyor.<init>(WeldMessageConveyor.java:61)
	at org.jboss.weld.logging.WeldMessageConveyerFactory.getDefaultMessageConveyer(WeldMessageConveyerFactory.java:27)
	at org.jboss.weld.logging.LoggerFactory.<init>(LoggerFactory.java:37)
	at org.jboss.weld.logging.LoggerFactory.loggerFactory(LoggerFactory.java:53)
	at org.jboss.weld.bootstrap.WeldBootstrap.<clinit>(WeldBootstrap.java:164)
	at org.glassfish.weld.WeldDeployer.load(WeldDeployer.java:441)
	at org.glassfish.weld.WeldDeployer.load(WeldDeployer.java:100)
	at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:206)
	at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:313)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:493)
	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
	at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:356)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
	at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:133)
	at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:109)
	at org.jboss.arquillian.container.glassfish.embedded_3_1.GlassFishContainer.deploy(GlassFishContainer.java:227)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:161)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$3.call(ContainerDeployController.java:128)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.executeOperation(ContainerDeployController.java:271)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deploy(ContainerDeployController.java:127)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
	at org.jboss.arquillian.container.impl.client.container.DeploymentExceptionHandler.verifyExpectedExceptionDuringDeploy(DeploymentExceptionHandler.java:50)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
	at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createDeploymentContext(ContainerDeploymentContextHandler.java:78)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
	at org.jboss.arquillian.container.impl.client.ContainerDeploymentContextHandler.createContainerContext(ContainerDeploymentContextHandler.java:57)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
	at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:95)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController$1.perform(ContainerDeployController.java:80)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachDeployment(ContainerDeployController.java:263)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.forEachManagedDeployment(ContainerDeployController.java:239)
	at org.jboss.arquillian.container.impl.client.container.ContainerDeployController.deployManaged(ContainerDeployController.java:79)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
	at org.jboss.arquillian.core.impl.EventImpl.fire(EventImpl.java:67)
	at org.jboss.arquillian.container.test.impl.client.ContainerEventController.execute(ContainerEventController.java:101)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
	at org.jboss.arquillian.core.impl.EventContextImpl.invokeObservers(EventContextImpl.java:99)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:81)
	at org.jboss.arquillian.test.impl.TestContextHandler.createSuiteContext(TestContextHandler.java:60)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
	at org.jboss.arquillian.test.impl.TestContextHandler.createClassContext(TestContextHandler.java:75)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.jboss.arquillian.core.impl.ObserverImpl.invoke(ObserverImpl.java:94)
	at org.jboss.arquillian.core.impl.EventContextImpl.proceed(EventContextImpl.java:88)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:135)
	at org.jboss.arquillian.core.impl.ManagerImpl.fire(ManagerImpl.java:115)
	at org.jboss.arquillian.test.impl.EventTestRunnerAdaptor.beforeClass(EventTestRunnerAdaptor.java:80)
	at org.jboss.arquillian.junit.Arquillian$2.evaluate(Arquillian.java:182)
	at org.jboss.arquillian.junit.Arquillian.multiExecute(Arquillian.java:314)
	at org.jboss.arquillian.junit.Arquillian.access$100(Arquillian.java:46)
	at org.jboss.arquillian.junit.Arquillian$3.evaluate(Arquillian.java:199)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.jboss.arquillian.junit.Arquillian.run(Arquillian.java:147)
	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:53)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:123)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:104)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:164)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:110)
	at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:175)
	at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcessWhenForked(SurefireStarter.java:107)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:68)


 Comments   
Comment by Yser [ 16/Sep/13 ]

I had the same problem with testing a EJB-Archive with the embedded EJBContainer.
As a workaround I just removed the beans.xml from the archive and it worked for me, maybe that helps you.

Comment by obfischer [ 17/Sep/13 ]

The problem is that embedded Glassfish is a uberjar therefore we are not able to take influence on the dependencies provided by it. I had similar issues with embedded Glassfish and created GLASSFISH-20806 as RFE.

Comment by truemmer666 [ 17/Sep/13 ]

The problem is that MapMaker is deprecated and methods have been removed or moved to CacheBuilder.

makeComputingMap(Function<? super K,? extends V> computingFunction)

Deprecated.
Caching functionality in MapMaker is being moved to CacheBuilder, with makeComputingMap(com.google.common.base.Function<? super K, ? extends V>) being replaced by CacheBuilder.build(com.google.common.cache.CacheLoader<? super K1, V1>). See the MapMaker Migration Guide for more details. This method is scheduled for deletion in February 2013.

Comment by javaneze [ 03/Oct/13 ]

We have the same issue with Emb. GlassFish 3.1.2 and Guava 1.5 (it hit us just after I updated the version). It would be nice for GlassFish to remove this
restriction and make sure is using Guava as a proper dependency.

Thanks!





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

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

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

Glassfish embedded 4.0


Tags: embedded, glassfish4, jax-rs, jersey

 Description   

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

@Stateless
public class AuthService {}

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

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



 Comments   
Comment by Wasomumba [ 17/Jun/13 ]

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

Comment by Marek Potociar [ 14/Aug/13 ]

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

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





[GLASSFISH-20438] Missing Bean Validator Provider in Embedded GlassFish Created: 30/Apr/13  Updated: 20/Dec/16

Status: Open
Project: glassfish
Component/s: bean-validator, embedded
Affects Version/s: 4.0_dev
Fix Version/s: 4.1.1

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

Embedded GlassFish


Tags: beanvalidation, embedded, glassfish_4_0-approved

 Description   

In Embedded GlassFish when deploying JAX-RS applications, there is an exception raised, which follows:

"C:\Program Files\Java\jdk1.7.0_17\bin\java" -Didea.launcher.port=7533 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 12.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 12.1\lib\idea_rt.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 12.1\plugins\junit\lib\junit-rt.jar;C:\Program Files\Java\jdk1.7.0_17\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.7.0_17\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.7.0_17\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.7.0_17\jre\lib\jce.jar;C:\Program Files\Java\jdk1.7.0_17\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.7.0_17\jre\lib\jfxrt.jar;C:\Program Files\Java\jdk1.7.0_17\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.7.0_17\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.7.0_17\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.7.0_17\jre\lib\resources.jar;C:\Program Files\Java\jdk1.7.0_17\jre\lib\rt.jar;C:\Program Files\Java\jdk1.7.0_17\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.7.0_17\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.7.0_17\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.7.0_17\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.7.0_17\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.7.0_17\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.7.0_17\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.7.0_17\jre\lib\ext\zipfs.jar;C:\Users\peter\Documents\IdeaProjects\javaee7-handbook\ch08\jaxrs-basic\out\test\jaxrs-basic;C:\Users\peter\Documents\IdeaProjects\javaee7-handbook\ch08\jaxrs-basic\out\production\jaxrs-basic;C:\Users\peter\.gradle\caches\artifacts-23\filestore\javax\javaee-api\7.0-bpeter-private\jar\9fa61bc3c788afba981ee07fa39e6b4c7e657546\javaee-api-7.0-bpeter-private.jar;C:\Users\peter\.m2\repository\com\javaeehandbook\book1\glassfish-embedded-runner\1.0\glassfish-embedded-runner-1.0.jar;C:\Users\peter\.gradle\caches\artifacts-23\filestore\org.jboss.shrinkwrap\shrinkwrap-api\1.0.1\jar\83ee2ca1702d79ceda73634e33b0fac8e73acced\shrinkwrap-api-1.0.1.jar;C:\Users\peter\.gradle\caches\artifacts-23\filestore\org.jboss.shrinkwrap\shrinkwrap-impl-base\1.0.1\jar\feb8c9e875222fae065b4c81937797b00c7ff347\shrinkwrap-impl-base-1.0.1.jar;C:\Users\peter\.gradle\caches\artifacts-23\filestore\javax\javaee-web-api\7.0-bpeter-private\jar\100d0af33717b582e057607811df66f1b4531d38\javaee-web-api-7.0-bpeter-private.jar;C:\Users\peter\.gradle\caches\artifacts-23\filestore\org.glassfish.main.extras\glassfish-embedded-all\4.0-b72\jar\942b982d5c005806a08843d2a1f411f278c04077\glassfish-embedded-all-4.0-b72.jar;C:\Users\peter\.gradle\caches\artifacts-23\filestore\javax.activation\activation\1.1\jar\e6cb541461c2834bdea3eb920f1884d1eb508b50\activation-1.1.jar;C:\Users\peter\.gradle\caches\artifacts-23\filestore\com.sun.mail\javax.mail\1.5.0-b01\jar\3f83e464cf9e42e31230d503e011d314755c02eb\javax.mail-1.5.0-b01.jar;C:\Users\peter\.gradle\caches\artifacts-23\filestore\org.jboss.shrinkwrap\shrinkwrap-spi\1.0.1\jar\4bcb163157366c0f690362594dfa4baed67a6152\shrinkwrap-spi-1.0.1.jar;C:\Users\peter\.gradle\caches\artifacts-23\filestore\junit\junit\4.11\jar\4e031bb61df09069aeb2bffb4019e7a5034a4ee0\junit-4.11.jar;C:\Users\peter\.gradle\caches\artifacts-23\filestore\org.hamcrest\hamcrest-core\1.3\jar\42a25dc3219429f0e5d060061f71acb49bf010a0\hamcrest-core-1.3.jar" com.intellij.rt.execution.application.AppMain com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 je7hb.jaxrs.basic.RestfulBookAsyncServiceClientTest
classpath[0] = C:\Program Files (x86)\JetBrains\IntelliJ IDEA 12.1\lib\idea_rt.jar
classpath[1] = C:\Program Files (x86)\JetBrains\IntelliJ IDEA 12.1\plugins\junit\lib\junit-rt.jar
classpath[2] = C:\Program Files\Java\jdk1.7.0_17\jre\lib\charsets.jar
classpath[3] = C:\Program Files\Java\jdk1.7.0_17\jre\lib\deploy.jar
classpath[4] = C:\Program Files\Java\jdk1.7.0_17\jre\lib\javaws.jar
classpath[5] = C:\Program Files\Java\jdk1.7.0_17\jre\lib\jce.jar
classpath[6] = C:\Program Files\Java\jdk1.7.0_17\jre\lib\jfr.jar
classpath[7] = C:\Program Files\Java\jdk1.7.0_17\jre\lib\jfxrt.jar
classpath[8] = C:\Program Files\Java\jdk1.7.0_17\jre\lib\jsse.jar
classpath[9] = C:\Program Files\Java\jdk1.7.0_17\jre\lib\management-agent.jar
classpath[10] = C:\Program Files\Java\jdk1.7.0_17\jre\lib\plugin.jar
classpath[11] = C:\Program Files\Java\jdk1.7.0_17\jre\lib\resources.jar
classpath[12] = C:\Program Files\Java\jdk1.7.0_17\jre\lib\rt.jar
classpath[13] = C:\Program Files\Java\jdk1.7.0_17\jre\lib\ext\access-bridge-64.jar
classpath[14] = C:\Program Files\Java\jdk1.7.0_17\jre\lib\ext\dnsns.jar
classpath[15] = C:\Program Files\Java\jdk1.7.0_17\jre\lib\ext\jaccess.jar
classpath[16] = C:\Program Files\Java\jdk1.7.0_17\jre\lib\ext\localedata.jar
classpath[17] = C:\Program Files\Java\jdk1.7.0_17\jre\lib\ext\sunec.jar
classpath[18] = C:\Program Files\Java\jdk1.7.0_17\jre\lib\ext\sunjce_provider.jar
classpath[19] = C:\Program Files\Java\jdk1.7.0_17\jre\lib\ext\sunmscapi.jar
classpath[20] = C:\Program Files\Java\jdk1.7.0_17\jre\lib\ext\zipfs.jar
classpath[21] = C:\Users\peter\Documents\IdeaProjects\javaee7-handbook\ch08\jaxrs-basic\out\test\jaxrs-basic
classpath[22] = C:\Users\peter\Documents\IdeaProjects\javaee7-handbook\ch08\jaxrs-basic\out\production\jaxrs-basic
classpath[23] = C:\Users\peter\.gradle\caches\artifacts-23\filestore\javax\javaee-api\7.0-bpeter-private\jar\9fa61bc3c788afba981ee07fa39e6b4c7e657546\javaee-api-7.0-bpeter-private.jar
classpath[24] = C:\Users\peter\.m2\repository\com\javaeehandbook\book1\glassfish-embedded-runner\1.0\glassfish-embedded-runner-1.0.jar
classpath[25] = C:\Users\peter\.gradle\caches\artifacts-23\filestore\org.jboss.shrinkwrap\shrinkwrap-api\1.0.1\jar\83ee2ca1702d79ceda73634e33b0fac8e73acced\shrinkwrap-api-1.0.1.jar
classpath[26] = C:\Users\peter\.gradle\caches\artifacts-23\filestore\org.jboss.shrinkwrap\shrinkwrap-impl-base\1.0.1\jar\feb8c9e875222fae065b4c81937797b00c7ff347\shrinkwrap-impl-base-1.0.1.jar
classpath[27] = C:\Users\peter\.gradle\caches\artifacts-23\filestore\javax\javaee-web-api\7.0-bpeter-private\jar\100d0af33717b582e057607811df66f1b4531d38\javaee-web-api-7.0-bpeter-private.jar
classpath[28] = C:\Users\peter\.gradle\caches\artifacts-23\filestore\org.glassfish.main.extras\glassfish-embedded-all\4.0-b72\jar\942b982d5c005806a08843d2a1f411f278c04077\glassfish-embedded-all-4.0-b72.jar
classpath[29] = C:\Users\peter\.gradle\caches\artifacts-23\filestore\javax.activation\activation\1.1\jar\e6cb541461c2834bdea3eb920f1884d1eb508b50\activation-1.1.jar
classpath[30] = C:\Users\peter\.gradle\caches\artifacts-23\filestore\com.sun.mail\javax.mail\1.5.0-b01\jar\3f83e464cf9e42e31230d503e011d314755c02eb\javax.mail-1.5.0-b01.jar
classpath[31] = C:\Users\peter\.gradle\caches\artifacts-23\filestore\org.jboss.shrinkwrap\shrinkwrap-spi\1.0.1\jar\4bcb163157366c0f690362594dfa4baed67a6152\shrinkwrap-spi-1.0.1.jar
classpath[32] = C:\Users\peter\.gradle\caches\artifacts-23\filestore\junit\junit\4.11\jar\4e031bb61df09069aeb2bffb4019e7a5034a4ee0\junit-4.11.jar
classpath[33] = C:\Users\peter\.gradle\caches\artifacts-23\filestore\org.hamcrest\hamcrest-core\1.3\jar\42a25dc3219429f0e5d060061f71acb49bf010a0\hamcrest-core-1.3.jar
Found populator: org.glassfish.kernel.embedded.EmbeddedDomainXml
Apr 30, 2013 11:01:26 AM org.glassfish.security.services.impl.authorization.AuthorizationServiceImpl initialize
INFO: Authorization Service has successfully initialized.
Apr 30, 2013 11:01:26 AM com.sun.enterprise.v3.admin.CommandRunnerImpl doCommand
SEVERE: Exception while running a command
javax.validation.ValidationException: Unable to load Bean Validation provider
at javax.validation.Validation$GetValidationProviderList.run(Validation.java:346)
at javax.validation.Validation$GetValidationProviderList.getValidationProviderList(Validation.java:310)
at javax.validation.Validation$DefaultValidationProviderResolver.getValidationProviders(Validation.java:292)
at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:252)
at javax.validation.Validation.buildDefaultValidatorFactory(Validation.java:107)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.initBeanValidator(CommandRunnerImpl.java:462)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.checkAgainstBeanConstraints(CommandRunnerImpl.java:472)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.injectParameters(CommandRunnerImpl.java:444)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1190)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:109)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1760)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1676)
at com.sun.enterprise.admin.cli.embeddable.CommandExecutorImpl.executeCommand(CommandExecutorImpl.java:168)
at com.sun.enterprise.admin.cli.embeddable.CommandExecutorImpl.run(CommandExecutorImpl.java:93)
at com.sun.enterprise.glassfish.bootstrap.ConfiguratorImpl.configure(ConfiguratorImpl.java:68)
at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.configure(GlassFishImpl.java:71)
at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.<init>(GlassFishImpl.java:65)
at com.sun.enterprise.glassfish.bootstrap.StaticGlassFishRuntime$1.<init>(StaticGlassFishRuntime.java:115)
at com.sun.enterprise.glassfish.bootstrap.StaticGlassFishRuntime.newGlassFish(StaticGlassFishRuntime.java:115)
at je7hb.common.webcontainer.embedded.glassfish.AbstractEmbeddedRunner.init(AbstractEmbeddedRunner.java:46)
at je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFile(SimpleEmbeddedRunner.java:58)
at je7hb.jaxrs.basic.RestfulBookAsyncServiceClientTest.assembleDeployAndStartServer(RestfulBookAsyncServiceClientTest.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:77)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
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.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.util.ServiceConfigurationError: javax.validation.spi.ValidationProvider: Provider org.hibernate.validator.HibernateValidator not found
at java.util.ServiceLoader.fail(ServiceLoader.java:231)
at java.util.ServiceLoader.access$300(ServiceLoader.java:181)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:365)
at java.util.ServiceLoader$1.next(ServiceLoader.java:445)
at javax.validation.Validation$GetValidationProviderList.run(Validation.java:343)
... 40 more

org.glassfish.embeddable.GlassFishException: PlainTextActionReporterFAILUREjavax.validation.ValidationException: Unable to load Bean Validation providerDescription: set commandUnable to load Bean Validation provider
Usage: set [?|-help[=<help(default:false)>]]
(dotted-attribute-name=value)+

at com.sun.enterprise.glassfish.bootstrap.ConfiguratorImpl.configure(ConfiguratorImpl.java:71)
at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.configure(GlassFishImpl.java:71)
at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.<init>(GlassFishImpl.java:65)
at com.sun.enterprise.glassfish.bootstrap.StaticGlassFishRuntime$1.<init>(StaticGlassFishRuntime.java:115)
at com.sun.enterprise.glassfish.bootstrap.StaticGlassFishRuntime.newGlassFish(StaticGlassFishRuntime.java:115)
at je7hb.common.webcontainer.embedded.glassfish.AbstractEmbeddedRunner.init(AbstractEmbeddedRunner.java:46)
at je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFile(SimpleEmbeddedRunner.java:58)
at je7hb.jaxrs.basic.RestfulBookAsyncServiceClientTest.assembleDeployAndStartServer(RestfulBookAsyncServiceClientTest.java:43)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:77)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

java.lang.NullPointerException
at je7hb.jaxrs.basic.RestfulBookAsyncServiceClientTest.stopServer(RestfulBookAsyncServiceClientTest.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:77)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

java.lang.NullPointerException
at je7hb.jaxrs.basic.RestfulBookAsyncServiceClientTest.stopServer(RestfulBookAsyncServiceClientTest.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:77)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

Process finished with exit code -1

Embedded GlassFish does not have a default bean validator configured by default.
There is a work around for this error, which is to configure in the application.

Create an empty project file called `src/main/resources/META-INF/services/javax.validation.spi.ValidationProvider' and add this configuration line:

org.hibernate.validator.HibernateValidator

This should be part of the embedded GF itself though.



 Comments   
Comment by peter_pilgrim [ 30/Apr/13 ]

Oops! The work around does not work for GlassFish-b86 or my personal 4.0 SNAPSHOT.

Comment by Dhiru Pandey [ 30/Apr/13 ]

Assigning to JJ Snyder for investigation

Comment by mtaube [ 30/Apr/13 ]

I'm having a difficult time reproducing this, I have confirmed that the META-INF/services/javax.validation.spi.ValidationProvider file exists along with the hibernate-validator classes in glassfish-embedded-all.jar ..

Additionally, when I start via java -jar glassfish-embedded-all.jar I see that it is able to bootstrap hibernate-validator (which it clearly does not do in your output):

$ java -jar glassfish-embedded-all.jar
Found populator: org.glassfish.kernel.embedded.EmbeddedDomainXml
Apr 30, 2013 4:24:18 PM com.sun.enterprise.v3.services.impl.GrizzlyService createNetworkProxy
INFO: Network listener http-listener on port 0 disabled per domain.xml
Apr 30, 2013 4:24:18 PM com.sun.enterprise.v3.services.impl.GrizzlyService createNetworkProxy
INFO: Network listener https-listener on port 0 disabled per domain.xml

Apr 30, 2013 4:24:18 PM org.hibernate.validator.internal.util.Version <clinit>
INFO: HV000001: Hibernate Validator 5.0.0.Final
Apr 30, 2013 4:24:18 PM org.glassfish.security.services.impl.authorization.AuthorizationServiceImpl initialize
INFO: Authorization Service has successfully initialized.
Apr 30, 2013 4:24:18 PM org.glassfish.jersey.server.ApplicationHandler initialize
INFO: Initiating Jersey application, version Jersey: 2.0-rc2 2013-04-23 12:04:25...

Could you provide reproduction steps along with a test case?

Comment by peter_pilgrim [ 01/May/13 ]

Here is the code. You need to change the build setting in the gradle to point to the newest GlassFish snapshot (-b87), which fixes the missing JSONP bug

// RestfulBookService.java
package je7hb.jaxrs.basic;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import java.util.Arrays;
import java.util.List;

/**

  • The type RestfulBookService
    *
  • @author Peter Pilgrim (peter)
    */
    @Path("/books")
    public class RestfulBookService {

private List<Book> products = Arrays.asList(
new Book("Sir Arthur Dolan Coyle", "Sherlock Holmes and the Hounds of the Baskerville"),
new Book("Dan Brown", "Da Vinci Code"),
new Book("Charles Dickens", "Great Expectations"),
new Book("Robert Louis Stevenson", "Treasure Island"));

@GET
@Produces(MediaType.TEXT_PLAIN)
public String getList() {
StringBuffer buf = new StringBuffer();
for (Book b: products)

{ buf.append(b.title); buf.append('\n'); }

return buf.toString();
}

@PostConstruct
public void acquireResource()

{ System.out.println( this.getClass().getSimpleName()+"#acquireResource()" ); }

@PreDestroy
public void releaseResource()

{ System.out.println( this.getClass().getSimpleName()+"#releaseResource()" ); }

static class Book {
public final String author;
public final String title;

Book(String author, String title)

{ this.author = author; this.title = title; }

}
}

// RestfulBookServiceTest.java
package je7hb.jaxrs.basic;

import je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.asset.EmptyAsset;
import org.jboss.shrinkwrap.api.spec.WebArchive;
import org.jboss.shrinkwrap.impl.base.exporter.zip.ZipExporterImpl;
import org.junit.Test;

import java.io.BufferedReader;
import java.io.File;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;

import static org.junit.Assert.*;

/**

  • Verifies the operation of the RestfulBookService
    *
  • @author Peter Pilgrim
    */
    public class RestfulBookServiceTest {

@Test
public void shouldAssembleAndRetrieveBookList() throws Exception {
WebArchive webArchive = ShrinkWrap.create(WebArchive.class, "test.war")
.addClasses(RestfulBookService.class)
.addAsWebInfResource(
EmptyAsset.INSTANCE, "beans.xml");

System.out.println(webArchive.toString(true));

File warFile = new File(webArchive.getName());
new ZipExporterImpl(webArchive).exportTo(warFile, true);
SimpleEmbeddedRunner runner =
SimpleEmbeddedRunner.launchDeployWarFile(
warFile, "mywebapp", 8080);
try {
URL url = new URL(
"http://localhost:8080/mywebapp/rest/books");
InputStream inputStream = url.openStream();
BufferedReader reader = new BufferedReader(
new InputStreamReader(inputStream));
List<String> lines = new ArrayList<>();
String text = null;
int count=0;
while ( ( text = reader.readLine()) != null )

{ lines.add(text); ++count; System.out.printf("**** OUTPUT **** text[%d] = %s\n", count, text ); }

assertFalse( lines.isEmpty() );
assertEquals("Sherlock Holmes and the Hounds of the Baskerville", lines.get(0));
assertEquals("Da Vinci Code", lines.get(1));
assertEquals("Great Expectations", lines.get(2));
assertEquals( "Treasure Island", lines.get(3) );
}
finally

{ runner.stop(); }

}
}

// build.gradle
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'idea'

// Define equivalent Maven GAV coordinates.
group = 'com.javaeehandbook.book1'
archivesBaseName = 'ch08-jaxrs-basic'
version = '1.0'

repositories {
maven

{ url 'https://maven.java.net/content/groups/promoted' }

maven

{ url 'http://repository.jboss.org/nexus/content/groups/public' }

mavenCentral()
mavenLocal()
}

dependencies

{ providedCompile 'org.glassfish.main.extras:glassfish-embedded-all:4.0-b86' providedCompile 'javax:javaee-api:7.0-b86' providedCompile 'javax:javaee-web-api:7.0-b86' providedCompile 'com.javaeehandbook.book1:glassfish-embedded-runner:1.0' compile 'org.glassfish.main.extras:glassfish-embedded-all:4.0-b86' compile 'javax:javaee-api:7.0-b86' compile 'com.javaeehandbook.book1:glassfish-embedded-runner:1.0' compile 'org.jboss.shrinkwrap:shrinkwrap-api:1.0.1' compile 'org.jboss.shrinkwrap:shrinkwrap-impl-base:1.0.1' testCompile 'junit:junit:4.11' }

task wrapper(type: Wrapper)

{ gradleVersion = '1.5' }

// Override Gradle defaults - a force an exploded JAR view
sourceSets {
main

{ output.resourcesDir = 'build/classes/main' output.classesDir = 'build/classes/main' }

test

{ output.resourcesDir = 'build/classes/test' output.classesDir = 'build/classes/test' }

}

idea {
module

{ downloadSources = true }

}

Comment by mtaube [ 01/May/13 ]

I cannot resolve com.javaeehandbook.book1:glassfish-embedded-runner:1.0, could you pass along SimpleEmbeddedRunner.java as well?

Comment by peter_pilgrim [ 01/May/13 ]

Here are the Utility classes

// SimpleEmbeddedRunner.java
package je7hb.common.webcontainer.embedded.glassfish;

import java.io.File;
import java.util.Scanner;

/**

  • The type SimpleEmbeddedRunner
    *
  • @author Peter Pilgrim (peter)
    */
    public class SimpleEmbeddedRunner extends AbstractEmbeddedRunner {

/**

  • Default embedded server port number
    */
    public final static int DEFAULT_PORT=8080;

/**

  • Default pause time in milliseconds after deploying the war file
    */
    public static final long DEFAULT_PAUSE_TIME = 1000L;

public SimpleEmbeddedRunner(int port)

{ super(port); }

public static void launchDeployWarFileAndWait( String warFile, String webContext ) throws Exception

{ launchDeployWarFileAndWait(warFile, webContext, DEFAULT_PORT ); }

public static void launchDeployWarFileAndWait( String warFile, String webContext, int port ) throws Exception { launchDeployWarFileAndWait(new File(warFile), webContext, port, DEFAULT_PAUSE_TIME); }

public static void launchDeployWarFileAndWait( String warFile, String webContext, int port, long milliseconds ) throws Exception { launchDeployWarFileAndWait(new File(warFile), webContext, port, milliseconds); }

public static void launchDeployWarFileAndWait( File warFile, String webContext ) throws Exception { launchDeployWarFileAndWait(warFile, webContext, DEFAULT_PORT ); }

public static void launchDeployWarFileAndWait( File warFile, String webContext, int port ) throws Exception

{ launchDeployWarFileAndWait(warFile, webContext, port, DEFAULT_PAUSE_TIME); }

public static void launchDeployWarFileAndWait( File warFile, String webContext, int port, long milliseconds ) throws Exception

{ SimpleEmbeddedRunner runner = (SimpleEmbeddedRunner)new SimpleEmbeddedRunner(port).init().start(); runner.deployWithRename(warFile, webContext); Thread.sleep(milliseconds); System.out.printf("**** Press the ENTER key to stop the server ****"); Scanner sc = new Scanner(System.in); while(!sc.nextLine().equals("")); runner.stop(); }

public static SimpleEmbeddedRunner launchDeployWarFile( File warFile, String webContext, int port ) throws Exception

{ SimpleEmbeddedRunner runner = (SimpleEmbeddedRunner)new SimpleEmbeddedRunner(port).init().start(); runner.deployWithRename(warFile, webContext); return runner; }

}

// AbstractEmbeddedRunner.java
package je7hb.common.webcontainer.embedded.glassfish;

import org.glassfish.embeddable.*;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Scanner;
import java.util.concurrent.atomic.AtomicBoolean;

/**

  • The type AbstractEmbeddedRunner
    *
  • @author Peter Pilgrim
    */
    public class AbstractEmbeddedRunner {

private int port;
private AtomicBoolean initialized = new AtomicBoolean();
private AtomicBoolean running = new AtomicBoolean();
private GlassFish glassfish;

public AbstractEmbeddedRunner(int port)

{ this.port = port; }

public AbstractEmbeddedRunner init() throws Exception{
if ( initialized.get() )

{ throw new RuntimeException("runner was already initialized"); }

BootstrapProperties bootstrapProperties = new BootstrapProperties();
GlassFishRuntime glassfishRuntime = GlassFishRuntime.bootstrap(bootstrapProperties);

GlassFishProperties glassfishProperties = new GlassFishProperties();
glassfishProperties.setPort("http-listener", port);
// glassfishProperties.setPort("https-listener", port+1);
String [] paths = System.getProperty("java.class.path").split(File.pathSeparator);
for (int j=0; j<paths.length; ++j)

{ System.out.printf("classpath[%d] = %s\n", j, paths[j]); }

glassfish = glassfishRuntime.newGlassFish(glassfishProperties);
initialized.set(true);
return this;
}

private void check() {
if ( !initialized.get() )

{ throw new RuntimeException("runner was not initialised"); }

}

public AbstractEmbeddedRunner start() throws Exception

{ check(); glassfish.start(); running.set(true); return this; }

public AbstractEmbeddedRunner stop() throws Exception

{ check(); glassfish.stop(); running.set(false); return this; }

public AbstractEmbeddedRunner deploy( String args[]) throws Exception{
Deployer deployer = glassfish.getDeployer();
for (String s: args)

{ File f = new File(s); sanityCheckFile(f); String application = deployer.deploy(f); System.out.printf("deploying "+application); }

return this;
}

/**

  • Deploy the WAR file and also override the web context name
  • @param warfile the war file path
  • @param newContext the web context name
  • @return embedded runner
  • @throws Exception
    */
    public AbstractEmbeddedRunner deployWithRename( String warfile, String newContext ) throws Exception { return deployWithRename( new File(warfile), newContext ); }

/**

  • Deploy the WAR file and also override the web context name
  • @param warfile the war file
  • @param newContext the web context name
  • @return embedded runner
  • @throws Exception
    */
    public AbstractEmbeddedRunner deployWithRename( File warfile, String newContext ) throws Exception { Deployer deployer = glassfish.getDeployer(); sanityCheckFile(warfile); deployer.deploy(warfile, "--name="+newContext, "--contextroot="+newContext, "--force=true"); return this; }

private void sanityCheckFile(File f) throws IOException {
if ( !f.exists() )

{ throw new FileNotFoundException("The WAR file: ["+f.getPath()+"] does not exist."); }

if ( !f.canRead() )

{ throw new IOException("The WAR file: ["+f.getPath()+"] is not readable."); }

if ( !f.isFile() )

{ throw new IOException("The WAR file: ["+f.getPath()+"] is a regular file."); }

}

public AbstractEmbeddedRunner undeploy( String webContextName ) throws Exception {
Deployer deployer = glassfish.getDeployer();
Collection<String> deployedApplications = deployer.getDeployedApplications();
if ( deployedApplications.contains(webContextName))

{ deployer.undeploy(webContextName); }

return this;
}

public AbstractEmbeddedRunner undeployAll() throws Exception {
Deployer deployer = glassfish.getDeployer();
for ( String s: deployer.getDeployedApplications())

{ deployer.undeploy(s); }

return this;
}

public boolean isRunning()

{ return running.get(); }

public boolean isInitialized()

{ return initialized.get(); }

public List<String> getDeployments() throws GlassFishException {
List<String> deployments = new ArrayList<>();
Deployer deployer = glassfish.getDeployer();
for ( String s: deployer.getDeployedApplications())

{ deployments.add(s); }

return deployments;
}
}

Comment by mtaube [ 01/May/13 ]

Running this against the latest trunk, I do not see any problems relating to javax.validation.

Here is the output of the test, from the validator initialization onward:

May 01, 2013 4:20:02 PM org.hibernate.validator.internal.util.Version <clinit>
INFO: HV000001: Hibernate Validator 5.0.0.Final
May 01, 2013 4:20:04 PM com.sun.enterprise.v3.services.impl.GrizzlyProxy start
INFO: Grizzly Framework 2.3.1 started in: 130ms - bound to [/0.0.0.0:8,085]
May 01, 2013 4:20:04 PM com.sun.enterprise.v3.services.impl.GrizzlyService createNetworkProxy
INFO: Network listener https-listener on port 0 disabled per domain.xml
May 01, 2013 4:20:04 PM com.sun.enterprise.v3.admin.adapter.AdminEndpointDecider setGuiContextRoot
INFO: Admin Console Adapter: context root: /admin
May 01, 2013 4:20:04 PM com.sun.enterprise.v3.admin.adapter.AdminEndpointDecider setGuiContextRoot
INFO: Admin Console Adapter: context root: /admin
May 01, 2013 4:20:04 PM com.sun.enterprise.v3.admin.adapter.AdminEndpointDecider setGuiContextRoot
INFO: Admin Console Adapter: context root: /admin
May 01, 2013 4:20:06 PM com.sun.enterprise.v3.server.AppServerStartup postStartupJob
INFO: Undefined Product Name - define product and version info in config/branding 0.0.0 (0) startup time : Embedded (9,427ms), startup services(3,624ms), total(13,051ms)
May 01, 2013 4:20:07 PM org.glassfish.jersey.server.ApplicationHandler initialize
INFO: Initiating Jersey application, version Jersey: 2.0-rc2 2013-04-23 12:04:25...
May 01, 2013 4:20:07 PM org.glassfish.admin.mbeanserver.JMXStartupService$JMXConnectorsStarterThread run
INFO: JMXStartupService has disabled JMXConnector system
May 01, 2013 4:20:08 PM com.sun.enterprise.connectors.jms.util.JmsRaUtil getInstalledMqVersion
WARNING: RAR7000 : Check for a new version of MQ installation failed : /var/folders/pl/fpwcfc_92dg7c5sgc5kgfhgc0000gn/T/gfembed4600368697654124458tmp/lib/install/applications/jmsra/../imqjmsra.rar (No such file or directory):/var/folders/pl/fpwcfc_92dg7c5sgc5kgfhgc0000gn/T/gfembed4600368697654124458tmp/lib/install/applications/jmsra/imqjmsra.rar
May 01, 2013 4:20:09 PM com.sun.enterprise.security.SecurityLifecycle <init>
INFO: security.secmgroff
May 01, 2013 4:20:09 PM com.sun.enterprise.security.SecurityLifecycle onInitialization
INFO: sec.service.startup.enter
May 01, 2013 4:20:09 PM com.sun.enterprise.security.PolicyLoader loadPolicy
INFO: policy.loading
May 01, 2013 4:20:10 PM com.sun.enterprise.security.auth.realm.Realm doInstantiate
INFO: realm.loaded.successfully
May 01, 2013 4:20:10 PM com.sun.enterprise.security.auth.realm.Realm doInstantiate
INFO: realm.loaded.successfully
May 01, 2013 4:20:10 PM com.sun.enterprise.security.auth.realm.Realm doInstantiate
INFO: realm.loaded.successfully
May 01, 2013 4:20:10 PM com.sun.enterprise.security.SecurityLifecycle onInitialization
INFO: sec.service.startup.exit
May 01, 2013 4:20:11 PM com.sun.enterprise.web.WebContainer createHttpListener
INFO: Created HTTP listener http-listener on host/port 0.0.0.0:8085
May 01, 2013 4:20:11 PM com.sun.enterprise.web.VirtualServer addProbes
SEVERE: Error adding HttpProbes. NetworkListener https-listeners GrizzlyProxy is NULL
May 01, 2013 4:20:11 PM com.sun.enterprise.web.WebContainer createHosts
INFO: Created virtual server server
May 01, 2013 4:20:12 PM org.apache.catalina.realm.JAASRealm setContainer
INFO: Setting JAAS app name glassfish-web
May 01, 2013 4:20:12 PM com.sun.enterprise.web.WebContainer loadSystemDefaultWebModules
INFO: Virtual server server loaded default web module
May 01, 2013 4:20:13 PM org.jboss.weld.bootstrap.WeldBootstrap <clinit>
INFO: WELD-000900 SNAPSHOT
May 01, 2013 4:20:15 PM com.sun.enterprise.v3.server.ApplicationLifecycle deploy
SEVERE: Exception during lifecycle processing
org.glassfish.deployment.common.DeploymentException: CDI definition failure:Exception List with 1 exceptions:
Exception 0 :
javax.enterprise.event.ObserverException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at org.jboss.weld.security.NewInstanceAction.run(NewInstanceAction.java:33)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:37)
at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:75)
at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:101)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:274)
at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:121)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:261)
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.notifyObservers(ObserverNotifier.java:129)
at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:103)
at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:63)
at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:35)
at org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBeanDiscoveryImpl.java:53)
at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:515)
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:213)
at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:328)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:493)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:133)
at je7hb.common.webcontainer.embedded.glassfish.AbstractEmbeddedRunner.deployWithRename(AbstractEmbeddedRunner.java:104)
at je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFile(SimpleEmbeddedRunner.java:59)
at je7hb.jaxrs.basic.RestfulBookServiceTest.shouldAssembleAndRetrieveBookList(RestfulBookServiceTest.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
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.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.NoSuchMethodError: javax.enterprise.inject.spi.BeanManager.getInjectionTargetFactory(Ljavax/enterprise/inject/spi/AnnotatedType;)Ljavax/enterprise/inject/spi/InjectionTargetFactory;
at org.glassfish.jms.injection.JMSCDIExtension.createLocalBean(JMSCDIExtension.java:78)
at org.glassfish.jms.injection.JMSCDIExtension.afterBeanDiscovery(JMSCDIExtension.java:84)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93)
... 57 more

at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:225)
at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:328)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:493)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:133)
at je7hb.common.webcontainer.embedded.glassfish.AbstractEmbeddedRunner.deployWithRename(AbstractEmbeddedRunner.java:104)
at je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFile(SimpleEmbeddedRunner.java:59)
at je7hb.jaxrs.basic.RestfulBookServiceTest.shouldAssembleAndRetrieveBookList(RestfulBookServiceTest.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
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.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: org.jboss.weld.exceptions.DefinitionException: Exception List with 1 exceptions:
Exception 0 :
javax.enterprise.event.ObserverException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at org.jboss.weld.security.NewInstanceAction.run(NewInstanceAction.java:33)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:37)
at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:75)
at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:101)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:274)
at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:121)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:261)
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.notifyObservers(ObserverNotifier.java:129)
at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:103)
at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:63)
at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:35)
at org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBeanDiscoveryImpl.java:53)
at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:515)
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:213)
at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:328)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:493)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:133)
at je7hb.common.webcontainer.embedded.glassfish.AbstractEmbeddedRunner.deployWithRename(AbstractEmbeddedRunner.java:104)
at je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFile(SimpleEmbeddedRunner.java:59)
at je7hb.jaxrs.basic.RestfulBookServiceTest.shouldAssembleAndRetrieveBookList(RestfulBookServiceTest.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
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.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.NoSuchMethodError: javax.enterprise.inject.spi.BeanManager.getInjectionTargetFactory(Ljavax/enterprise/inject/spi/AnnotatedType;)Ljavax/enterprise/inject/spi/InjectionTargetFactory;
at org.glassfish.jms.injection.JMSCDIExtension.createLocalBean(JMSCDIExtension.java:78)
at org.glassfish.jms.injection.JMSCDIExtension.afterBeanDiscovery(JMSCDIExtension.java:84)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93)
... 57 more

at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:37)
at org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBeanDiscoveryImpl.java:53)
at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:515)
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:213)
... 45 more

May 01, 2013 4:20:15 PM org.glassfish.api.ActionReport failure
SEVERE: Exception while loading the app
May 01, 2013 4:20:15 PM com.sun.enterprise.web.WebContainer unloadWebModule
SEVERE: Undeployment failed for context /mywebapp
May 01, 2013 4:20:15 PM org.glassfish.deployment.admin.DeployCommand execute
SEVERE: Exception while loading the app : CDI definition failure:Exception List with 1 exceptions:
Exception 0 :
javax.enterprise.event.ObserverException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at org.jboss.weld.security.NewInstanceAction.run(NewInstanceAction.java:33)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:37)
at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:75)
at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:101)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:274)
at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:121)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:261)
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.notifyObservers(ObserverNotifier.java:129)
at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:103)
at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:63)
at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:35)
at org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBeanDiscoveryImpl.java:53)
at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:515)
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:213)
at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:328)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:493)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:133)
at je7hb.common.webcontainer.embedded.glassfish.AbstractEmbeddedRunner.deployWithRename(AbstractEmbeddedRunner.java:104)
at je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFile(SimpleEmbeddedRunner.java:59)
at je7hb.jaxrs.basic.RestfulBookServiceTest.shouldAssembleAndRetrieveBookList(RestfulBookServiceTest.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
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.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.NoSuchMethodError: javax.enterprise.inject.spi.BeanManager.getInjectionTargetFactory(Ljavax/enterprise/inject/spi/AnnotatedType;)Ljavax/enterprise/inject/spi/InjectionTargetFactory;
at org.glassfish.jms.injection.JMSCDIExtension.createLocalBean(JMSCDIExtension.java:78)
at org.glassfish.jms.injection.JMSCDIExtension.afterBeanDiscovery(JMSCDIExtension.java:84)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93)
... 57 more

org.jboss.weld.exceptions.DefinitionException: Exception List with 1 exceptions:
Exception 0 :
javax.enterprise.event.ObserverException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at org.jboss.weld.security.NewInstanceAction.run(NewInstanceAction.java:33)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:37)
at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:75)
at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:101)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:274)
at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:121)
at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:261)
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.notifyObservers(ObserverNotifier.java:129)
at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:103)
at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:63)
at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:35)
at org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBeanDiscoveryImpl.java:53)
at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:515)
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:213)
at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:328)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:493)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:133)
at je7hb.common.webcontainer.embedded.glassfish.AbstractEmbeddedRunner.deployWithRename(AbstractEmbeddedRunner.java:104)
at je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFile(SimpleEmbeddedRunner.java:59)
at je7hb.jaxrs.basic.RestfulBookServiceTest.shouldAssembleAndRetrieveBookList(RestfulBookServiceTest.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
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.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
Caused by: java.lang.NoSuchMethodError: javax.enterprise.inject.spi.BeanManager.getInjectionTargetFactory(Ljavax/enterprise/inject/spi/AnnotatedType;)Ljavax/enterprise/inject/spi/InjectionTargetFactory;
at org.glassfish.jms.injection.JMSCDIExtension.createLocalBean(JMSCDIExtension.java:78)
at org.glassfish.jms.injection.JMSCDIExtension.afterBeanDiscovery(JMSCDIExtension.java:84)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:93)
... 57 more

at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:37)
at org.jboss.weld.bootstrap.events.AfterBeanDiscoveryImpl.fire(AfterBeanDiscoveryImpl.java:53)
at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:515)
at org.glassfish.weld.WeldDeployer.event(WeldDeployer.java:213)
at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:131)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:328)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:493)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:133)
at je7hb.common.webcontainer.embedded.glassfish.AbstractEmbeddedRunner.deployWithRename(AbstractEmbeddedRunner.java:104)
at je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFile(SimpleEmbeddedRunner.java:59)
at je7hb.jaxrs.basic.RestfulBookServiceTest.shouldAssembleAndRetrieveBookList(RestfulBookServiceTest.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
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.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

JdbcRuntimeExtension, getAllSystemRAResourcesAndPools = [GlassFishConfigBean.org.glassfish.jdbc.config.JdbcResource, GlassFishConfigBean.org.glassfish.jdbc.config.JdbcResource, GlassFishConfigBean.org.glassfish.jdbc.config.JdbcConnectionPool, GlassFishConfigBean.org.glassfish.jdbc.config.JdbcConnectionPool]

java.io.IOException: Server returned HTTP response code: 502 for URL: http://localhost:8085/mywebapp/rest/books
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1612)
at java.net.URL.openStream(URL.java:1035)
at je7hb.jaxrs.basic.RestfulBookServiceTest.shouldAssembleAndRetrieveBookList(RestfulBookServiceTest.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:76)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:195)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)

May 01, 2013 4:20:16 PM org.glassfish.admin.mbeanserver.JMXStartupService shutdown
INFO: JMXStartupService and JMXConnectors have been shut down.
May 01, 2013 4:20:17 PM com.sun.enterprise.v3.server.AppServerStartup stop
INFO: Shutdown procedure finished

Comment by peter_pilgrim [ 01/May/13 ]

This is weird. Now the JAX-RS example will not deploy and therefore the unit test fails. There is no requirement on CDI 1.1 in these examples and yet that it is what is failing in the output above.

Are you running with Gradle 1.5? I saw this in the IntelliJ orginally and reproduced the error from the command line with gradle e.g

$ gradle -Dtest.single=RestfulBookServiceTest test --info

I have bad suspicion that this could be class path ordering thing.
And if you say that the Hibernate Validation JAR are already set up for Embedded Glassfish 4.0 b86 then I do not know what else it can be. Something could be wrong with class path?

// build.gradle
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'idea'

// Define equivalent Maven GAV coordinates.
group = 'com.javaeehandbook.book1'
archivesBaseName = 'ch08-jaxrs-basic'
version = '1.0'

repositories {
maven

{ url 'https://maven.java.net/content/groups/promoted' }

maven

{ url 'http://repository.jboss.org/nexus/content/groups/public' }

mavenCentral()
mavenLocal()
}

dependencies

{ providedCompile 'org.glassfish.main.extras:glassfish-embedded-all:4.0-b86' providedCompile 'javax:javaee-api:7.0-b86' providedCompile 'javax:javaee-web-api:7.0-b86' providedCompile 'com.javaeehandbook.book1:glassfish-embedded-runner:1.0' compile 'org.glassfish.main.extras:glassfish-embedded-all:4.0-b86' compile 'javax:javaee-api:7.0-b86' compile 'com.javaeehandbook.book1:glassfish-embedded-runner:1.0' compile 'org.jboss.shrinkwrap:shrinkwrap-api:1.0.1' compile 'org.jboss.shrinkwrap:shrinkwrap-impl-base:1.0.1' testCompile 'junit:junit:4.11' }

task wrapper(type: Wrapper)

{ gradleVersion = '1.5' }

// Override Gradle defaults - a force an exploded JAR view
sourceSets {
main

{ output.resourcesDir = 'build/classes/main' output.classesDir = 'build/classes/main' }

test

{ output.resourcesDir = 'build/classes/test' output.classesDir = 'build/classes/test' }

}

Here is the exact output from running the Gradle build against -b86.

C:\Users\peter\Documents\IdeaProjects\javaee7-handbook\ch08\jaxrs-basic>gradle -Dtest.single=RestfulBookServiceTest test --info
Starting Build
Settings evaluated using empty settings script.
Projects loaded. Root project using build file 'C:\Users\peter\Documents\IdeaProjects\javaee7-handbook\ch08\jaxrs-basic\build.gradle'.
Included projects: [root project 'jaxrs-basic']
Evaluating root project 'jaxrs-basic' using build file 'C:\Users\peter\Documents\IdeaProjects\javaee7-handbook\ch08\jaxrs-basic\build.gradle'.
All projects evaluated.
Selected primary task 'test'
Tasks to be executed: [task ':compileJava', task ':processResources', task ':classes', task ':compileTestJava', task ':processTestResources', task ':testClasses', task ':test']
:compileJava
:: loading settings :: url = jar:file:/C:/opt/gradle-1.5/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
Skipping task ':compileJava' as it is up-to-date.
Skipping task ':compileJava' as it is up-to-date
:compileJava UP-TO-DATE
:processResources
Skipping task ':processResources' as it is up-to-date.
Skipping task ':processResources' as it is up-to-date
:processResources UP-TO-DATE
:classes
Skipping task ':classes' as it has no actions.
:classes UP-TO-DATE
:compileTestJava
Skipping task ':compileTestJava' as it is up-to-date.
Skipping task ':compileTestJava' as it is up-to-date
:compileTestJava UP-TO-DATE
:processTestResources
Skipping task ':processTestResources' as it has no source files.
:processTestResources UP-TO-DATE
:testClasses
Skipping task ':testClasses' as it has no actions.
:testClasses UP-TO-DATE
:test
Executing task ':test' due to:
No history is available for task ':test'.
Running single tests with pattern: [**/RestfulBookServiceTest*.class]
Starting process 'Gradle Worker 1'. Working directory: C:\Users\peter\Documents\IdeaProjects\javaee7-handbook\ch08\jaxrs-basic Command: C:\Program Files\Java\jdk1.7.0_17\bin\java.exe -Djava.security.manager=jarjar.org.gradle.process.internal.child.Bootstra
pSecurityManager -Dfile.encoding=windows-1252 -ea -cp C:\Users\peter\.gradle\caches\1.5\workerMain\gradle-worker.jar jarjar.org.gradle.process.internal.launcher.GradleWorkerMain
An attempt to initialize for well behaving parent process finished.
Successfully started process 'Gradle Worker 1'
Gradle Worker 1 executing tests.

je7hb.jaxrs.basic.RestfulBookServiceTest > shouldAssembleAndRetrieveBookList STANDARD_OUT
test.war:
/WEB-INF/
/WEB-INF/beans.xml
/WEB-INF/web.xml
/WEB-INF/classes/
/WEB-INF/classes/je7hb/
/WEB-INF/classes/je7hb/jaxrs/
/WEB-INF/classes/je7hb/jaxrs/basic/
/WEB-INF/classes/je7hb/jaxrs/basic/SimpleServlet.class
/WEB-INF/classes/je7hb/jaxrs/basic/RestfulBookService.class
/WEB-INF/classes/je7hb/jaxrs/basic/RestfulBookService$Book.class
classpath[0] = C:\Users\peter\Documents\IdeaProjects\javaee7-handbook\ch08\jaxrs-basic\build\classes\test
classpath[1] = C:\Users\peter\Documents\IdeaProjects\javaee7-handbook\ch08\jaxrs-basic\build\classes\main
classpath[2] = C:\Users\peter\.gradle\caches\artifacts-23\filestore\org.glassfish.main.extras\glassfish-embedded-all\4.0-b86\jar\38b7a3ec6b8e4abd3a6ecaa6250db9a2275862da\glassfish-embedded-all-4.0-b86.jar
classpath[3] = C:\Users\peter\.gradle\caches\artifacts-23\filestore\javax\javaee-api\7.0-b86\jar\bac7671c884f183e8d2c174b1f1fecd746a2f514\javaee-api-7.0-b86.jar
classpath[4] = C:\Users\peter\.m2\repository\com\javaeehandbook\book1\glassfish-embedded-runner\1.0\glassfish-embedded-runner-1.0.jar
classpath[5] = C:\Users\peter\.gradle\caches\artifacts-23\filestore\org.jboss.shrinkwrap\shrinkwrap-api\1.0.1\jar\83ee2ca1702d79ceda73634e33b0fac8e73acced\shrinkwrap-api-1.0.1.jar
classpath[6] = C:\Users\peter\.gradle\caches\artifacts-23\filestore\org.jboss.shrinkwrap\shrinkwrap-impl-base\1.0.1\jar\feb8c9e875222fae065b4c81937797b00c7ff347\shrinkwrap-impl-base-1.0.1.jar
classpath[7] = C:\Users\peter\.gradle\caches\artifacts-23\filestore\javax\javaee-web-api\7.0-b86\jar\7fa02cd22bac4d0ec5be6211df9960dfcbae171a\javaee-web-api-7.0-b86.jar
classpath[8] = C:\Users\peter\.gradle\caches\artifacts-23\filestore\junit\junit\4.11\jar\4e031bb61df09069aeb2bffb4019e7a5034a4ee0\junit-4.11.jar
classpath[9] = C:\Users\peter\.gradle\caches\artifacts-23\filestore\javax.activation\activation\1.1\jar\e6cb541461c2834bdea3eb920f1884d1eb508b50\activation-1.1.jar
classpath[10] = C:\Users\peter\.gradle\caches\artifacts-23\filestore\com.sun.mail\javax.mail\1.5.0\jar\ec2410fdf7e0a3022e7c2a2e6241039d1abc1e98\javax.mail-1.5.0.jar
classpath[11] = C:\Users\peter\.gradle\caches\artifacts-23\filestore\org.jboss.shrinkwrap\shrinkwrap-spi\1.0.1\jar\4bcb163157366c0f690362594dfa4baed67a6152\shrinkwrap-spi-1.0.1.jar
classpath[12] = C:\Users\peter\.gradle\caches\artifacts-23\filestore\org.hamcrest\hamcrest-core\1.3\jar\42a25dc3219429f0e5d060061f71acb49bf010a0\hamcrest-core-1.3.jar
Found populator: org.glassfish.kernel.embedded.EmbeddedDomainXml

je7hb.jaxrs.basic.RestfulBookServiceTest > shouldAssembleAndRetrieveBookList STANDARD_ERROR
May 01, 2013 11:47:30 PM org.glassfish.security.services.impl.authorization.AuthorizationServiceImpl initialize
INFO: Authorization Service has successfully initialized.
May 01, 2013 11:47:30 PM org.hibernate.validator.internal.util.Version <clinit>
INFO: HV000001: Hibernate Validator 5.0.0.Final
May 01, 2013 11:47:30 PM com.sun.enterprise.v3.services.impl.GrizzlyProxy start
INFO: Grizzly Framework 2.3.1 started in: 13ms - bound to [/0.0.0.0:8,080]
May 01, 2013 11:47:30 PM com.sun.enterprise.v3.services.impl.GrizzlyService createNetworkProxy
INFO: Network listener https-listener on port 0 disabled per domain.xml
May 01, 2013 11:47:30 PM com.sun.enterprise.v3.admin.adapter.AdminEndpointDecider setGuiContextRoot
INFO: Admin Console Adapter: context root: /admin
May 01, 2013 11:47:30 PM com.sun.enterprise.v3.admin.adapter.AdminEndpointDecider setGuiContextRoot
INFO: Admin Console Adapter: context root: /admin
May 01, 2013 11:47:30 PM com.sun.enterprise.v3.admin.adapter.AdminEndpointDecider setGuiContextRoot
INFO: Admin Console Adapter: context root: /admin
May 01, 2013 11:47:31 PM com.sun.enterprise.v3.server.AppServerStartup postStartupJob
INFO: Undefined Product Name - define product and version info in config/branding 0.0.0 (0) startup time : Embedded (3,177ms), startup services(836ms), total(4,013ms)
May 01, 2013 11:47:31 PM org.glassfish.jersey.server.ApplicationHandler initialize
INFO: Initiating Jersey application, version Jersey: 2.0-rc2 2013-04-23 12:04:25...
May 01, 2013 11:47:31 PM org.glassfish.admin.mbeanserver.JMXStartupService$JMXConnectorsStarterThread run
INFO: JMXStartupService has disabled JMXConnector system
May 01, 2013 11:47:31 PM com.sun.enterprise.connectors.jms.util.JmsRaUtil getInstalledMqVersion
WARNING: RAR7000 : Check for a new version of MQ installation failed : C:\Users\peter\AppData\Local\Temp\gfembed9033409685331329967tmp\lib\install\applications\jmsra\..\imqjmsra.rar (The system cannot find the file specified):C:\Users\peter\AppData\Loc
al\Temp\gfembed9033409685331329967tmp\lib\install\applications\jmsra\imqjmsra.rar
May 01, 2013 11:47:31 PM com.sun.enterprise.security.SecurityLifecycle <init>
INFO: security.secmgroff
May 01, 2013 11:47:31 PM com.sun.enterprise.security.SecurityLifecycle onInitialization
INFO: sec.service.startup.enter
May 01, 2013 11:47:31 PM com.sun.enterprise.security.PolicyLoader loadPolicy
INFO: policy.loading
May 01, 2013 11:47:31 PM com.sun.enterprise.security.auth.realm.Realm doInstantiate
INFO: realm.loaded.successfully
May 01, 2013 11:47:31 PM com.sun.enterprise.security.auth.realm.Realm doInstantiate
INFO: realm.loaded.successfully
May 01, 2013 11:47:31 PM com.sun.enterprise.security.auth.realm.Realm doInstantiate
INFO: realm.loaded.successfully
May 01, 2013 11:47:31 PM com.sun.enterprise.security.SecurityLifecycle onInitialization
INFO: sec.service.startup.exit
May 01, 2013 11:47:32 PM com.sun.enterprise.web.WebContainer createHttpListener
INFO: Created HTTP listener http-listener on host/port 0.0.0.0:8080
May 01, 2013 11:47:32 PM com.sun.enterprise.web.VirtualServer addProbes
SEVERE: Error adding HttpProbes. NetworkListener https-listeners GrizzlyProxy is NULL
May 01, 2013 11:47:32 PM com.sun.enterprise.web.WebContainer createHosts
INFO: Created virtual server server
May 01, 2013 11:47:32 PM org.apache.catalina.realm.JAASRealm setContainer
INFO: Setting JAAS app name glassfish-web
May 01, 2013 11:47:32 PM com.sun.enterprise.web.WebContainer loadSystemDefaultWebModules
INFO: Virtual server server loaded default web module
May 01, 2013 11:47:32 PM org.jboss.weld.bootstrap.WeldBootstrap <clinit>
INFO: WELD-000900 SNAPSHOT
May 01, 2013 11:47:33 PM org.jboss.weld.bootstrap.Validator validateCustomBean
WARNING: WELD-001473 javax.enterprise.inject.spi.Bean implementation org.glassfish.jms.injection.JMSCDIExtension$LocalBean@4dac2b20 declared a normal scope but does not implement javax.enterprise.inject.spi.PassivationCapable. It won't be possible to i
nject this bean into a bean with passivating scope (@SessionScoped, @ConversationScoped). This can be fixed by assigning the Bean implementation a unique id by implementing the PassivationCapable interface.
May 01, 2013 11:47:33 PM org.glassfish.jersey.servlet.init.JerseyServletContainerInitializer addServletWithDefaultConfiguration
INFO: Registering the Jersey servlet application, named javax.ws.rs.core.Application, with the following root resource and provider classes: [class je7hb.jaxrs.basic.RestfulBookService]
May 01, 2013 11:47:33 PM org.glassfish.jersey.server.ApplicationHandler initialize
INFO: Initiating Jersey application, version Jersey: 2.0-rc2 2013-04-23 12:04:25...
May 01, 2013 11:47:33 PM org.apache.catalina.core.StandardContext log
SEVERE: WebModule[/mywebapp]StandardWrapper.Throwable
java.lang.NoClassDefFoundError: org/glassfish/json/jaxrs/JsonStructureBodyReader
at org.glassfish.jersey.jsonp.JsonProcessingFeature.configure(JsonProcessingFeature.java:66)
at org.glassfish.jersey.model.internal.CommonConfig.configureFeatures(CommonConfig.java:617)
at org.glassfish.jersey.model.internal.CommonConfig.configureMetaProviders(CommonConfig.java:558)
at org.glassfish.jersey.server.ResourceConfig.configureMetaProviders(ResourceConfig.java:768)
at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:341)
at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:157)
at org.glassfish.jersey.server.ApplicationHandler$3.run(ApplicationHandler.java:280)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:289)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:286)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:286)
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:277)
at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:262)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:167)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:349)
at javax.servlet.GenericServlet.init(GenericServlet.java:244)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1583)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1382)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5670)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5912)
at com.sun.enterprise.web.WebModule.start(WebModule.java:691)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1041)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:1024)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:747)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2278)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1924)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:139)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:133)
at je7hb.common.webcontainer.embedded.glassfish.AbstractEmbeddedRunner.deployWithRename(AbstractEmbeddedRunner.java:103)
at je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFile(SimpleEmbeddedRunner.java:59)
at je7hb.jaxrs.basic.RestfulBookServiceTest.shouldAssembleAndRetrieveBookList(RestfulBookServiceTest.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
Gradle Worker 1 finished executing tests.
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:55)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:42)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:71)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Process 'Gradle Worker 1' finished with exit value 0 (state: SUCCEEDED)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:103)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:355)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)

May 01, 2013 11:47:33 PM org.apache.catalina.core.StandardContext log
SEVERE: WebModule[/mywebapp]Servlet /mywebapp threw load() exception
java.lang.NoClassDefFoundError: org/glassfish/json/jaxrs/JsonStructureBodyReader
at org.glassfish.jersey.jsonp.JsonProcessingFeature.configure(JsonProcessingFeature.java:66)
at org.glassfish.jersey.model.internal.CommonConfig.configureFeatures(CommonConfig.java:617)
at org.glassfish.jersey.model.internal.CommonConfig.configureMetaProviders(CommonConfig.java:558)
at org.glassfish.jersey.server.ResourceConfig.configureMetaProviders(ResourceConfig.java:768)
at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:341)
at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:157)
at org.glassfish.jersey.server.ApplicationHandler$3.run(ApplicationHandler.java:280)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:289)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:286)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:286)
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:277)
at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:262)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:167)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:349)
at javax.servlet.GenericServlet.init(GenericServlet.java:244)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1583)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1382)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5670)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5912)
at com.sun.enterprise.web.WebModule.start(WebModule.java:691)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1041)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:1024)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:747)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2278)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1924)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:139)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:133)
at je7hb.common.webcontainer.embedded.glassfish.AbstractEmbeddedRunner.deployWithRename(AbstractEmbeddedRunner.java:103)
at je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFile(SimpleEmbeddedRunner.java:59)
at je7hb.jaxrs.basic.RestfulBookServiceTest.shouldAssembleAndRetrieveBookList(RestfulBookServiceTest.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:55)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:42)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:71)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:103)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:355)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)

May 01, 2013 11:47:33 PM org.apache.catalina.core.StandardContext start
SEVERE: Startup of context /mywebapp failed due to previous errors
May 01, 2013 11:47:33 PM org.apache.catalina.core.ContainerBase addChildInternal
SEVERE: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: org/glassfish/json/jaxrs/JsonStructureBodyReader
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5920)
at com.sun.enterprise.web.WebModule.start(WebModule.java:691)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:1041)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:1024)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:747)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:2278)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1924)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:139)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:133)
at je7hb.common.webcontainer.embedded.glassfish.AbstractEmbeddedRunner.deployWithRename(AbstractEmbeddedRunner.java:103)
at je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFile(SimpleEmbeddedRunner.java:59)
at je7hb.jaxrs.basic.RestfulBookServiceTest.shouldAssembleAndRetrieveBookList(RestfulBookServiceTest.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:55)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:42)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:71)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:103)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:355)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: org/glassfish/json/jaxrs/JsonStructureBodyReader
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5678)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:5912)
... 69 more
Caused by: java.lang.NoClassDefFoundError: org/glassfish/json/jaxrs/JsonStructureBodyReader
at org.glassfish.jersey.jsonp.JsonProcessingFeature.configure(JsonProcessingFeature.java:66)
at org.glassfish.jersey.model.internal.CommonConfig.configureFeatures(CommonConfig.java:617)
at org.glassfish.jersey.model.internal.CommonConfig.configureMetaProviders(CommonConfig.java:558)
at org.glassfish.jersey.server.ResourceConfig.configureMetaProviders(ResourceConfig.java:768)
at org.glassfish.jersey.server.ApplicationHandler.initialize(ApplicationHandler.java:341)
at org.glassfish.jersey.server.ApplicationHandler.access$500(ApplicationHandler.java:157)
at org.glassfish.jersey.server.ApplicationHandler$3.run(ApplicationHandler.java:280)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:289)
at org.glassfish.jersey.internal.Errors$2.call(Errors.java:286)
at org.glassfish.jersey.internal.Errors.process(Errors.java:315)
at org.glassfish.jersey.internal.Errors.process(Errors.java:297)
at org.glassfish.jersey.internal.Errors.processWithException(Errors.java:286)
at org.glassfish.jersey.server.ApplicationHandler.<init>(ApplicationHandler.java:277)
at org.glassfish.jersey.servlet.WebComponent.<init>(WebComponent.java:262)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:167)
at org.glassfish.jersey.servlet.ServletContainer.init(ServletContainer.java:349)
at javax.servlet.GenericServlet.init(GenericServlet.java:244)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1583)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1382)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5670)
... 70 more

May 01, 2013 11:47:33 PM com.sun.enterprise.web.WebApplication start
WARNING: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: org/glassfish/json/jaxrs/JsonStructureBodyReader
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: org/glassfish/json/jaxrs/JsonStructureBodyReader
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:2278)
at com.sun.enterprise.web.WebContainer.loadWebModule(WebContainer.java:1924)
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:139)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:133)
at je7hb.common.webcontainer.embedded.glassfish.AbstractEmbeddedRunner.deployWithRename(AbstractEmbeddedRunner.java:103)
at je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFile(SimpleEmbeddedRunner.java:59)
at je7hb.jaxrs.basic.RestfulBookServiceTest.shouldAssembleAndRetrieveBookList(RestfulBookServiceTest.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:55)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:42)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:71)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:103)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:355)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)

May 01, 2013 11:47:33 PM org.glassfish.internal.data.ModuleInfo start
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: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: org/glassfish/json/jaxrs/JsonStructureBodyReader
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:168)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:133)
at je7hb.common.webcontainer.embedded.glassfish.AbstractEmbeddedRunner.deployWithRename(AbstractEmbeddedRunner.java:103)
at je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFile(SimpleEmbeddedRunner.java:59)
at je7hb.jaxrs.basic.RestfulBookServiceTest.shouldAssembleAndRetrieveBookList(RestfulBookServiceTest.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:55)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:42)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:71)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:103)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:355)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)

May 01, 2013 11:47:33 PM com.sun.enterprise.v3.server.ApplicationLifecycle deploy
SEVERE: Exception during lifecycle processing
java.lang.Exception: java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: org/glassfish/json/jaxrs/JsonStructureBodyReader
at com.sun.enterprise.web.WebApplication.start(WebApplication.java:168)
at org.glassfish.internal.data.EngineRef.start(EngineRef.java:122)
at org.glassfish.internal.data.ModuleInfo.start(ModuleInfo.java:291)
at org.glassfish.internal.data.ApplicationInfo.start(ApplicationInfo.java:352)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:497)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:219)
at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:491)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:527)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2$1.run(CommandRunnerImpl.java:523)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:356)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$2.execute(CommandRunnerImpl.java:522)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:546)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1423)
at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1500(CommandRunnerImpl.java:108)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1762)
at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1674)
at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:133)
at je7hb.common.webcontainer.embedded.glassfish.AbstractEmbeddedRunner.deployWithRename(AbstractEmbeddedRunner.java:103)
at je7hb.common.webcontainer.embedded.glassfish.SimpleEmbeddedRunner.launchDeployWarFile(SimpleEmbeddedRunner.java:59)
at je7hb.jaxrs.basic.RestfulBookServiceTest.shouldAssembleAndRetrieveBookList(RestfulBookServiceTest.java:39)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:55)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:42)
at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:71)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:49)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy2.processTestClass(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:103)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:355)
at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)

May 01, 2013 11:47:33 PM org.glassfish.api.ActionReport failure
SEVERE: Exception while loading the app
May 01, 2013 11:47:33 PM com.sun.enterprise.web.WebContainer unloadWebModule
SEVERE: Undeployment failed for context /mywebapp
May 01, 2013 11:47:33 PM org.glassfish.deployment.admin.DeployCommand execute
SEVERE: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: java.lang.NoClassDefFoundError: org/glassfish/json/jaxrs/JsonStruc
tureBodyReader
May 01, 2013 11:47:33 PM org.glassfish.admin.mbeanserver.JMXStartupService shutdown
INFO: JMXStartupService and JMXConnectors have been shut down.

je7hb.jaxrs.basic.RestfulBookServiceTest > shouldAssembleAndRetrieveBookList STANDARD_OUT
JdbcRuntimeExtension, getAllSystemRAResourcesAndPools = [GlassFishConfigBean.org.glassfish.jdbc.config.JdbcResource, GlassFishConfigBean.org.glassfish.jdbc.config.JdbcResource, GlassFishConfigBean.org.glassfish.jdbc.config.JdbcConnectionPool, GlassFis
hConfigBean.org.glassfish.jdbc.config.JdbcConnectionPool]

je7hb.jaxrs.basic.RestfulBookServiceTest > shouldAssembleAndRetrieveBookList STANDARD_ERROR
May 01, 2013 11:47:33 PM com.sun.enterprise.v3.server.AppServerStartup stop
INFO: Shutdown procedure finished

je7hb.jaxrs.basic.RestfulBookServiceTest > shouldAssembleAndRetrieveBookList FAILED
java.io.FileNotFoundException: http://localhost:8080/mywebapp/rest/books
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1623)
at java.net.URL.openStream(URL.java:1037)
at je7hb.jaxrs.basic.RestfulBookServiceTest.shouldAssembleAndRetrieveBookList(RestfulBookServiceTest.java:45)

1 test completed, 1 failed
Finished generating test XML results (0.047 secs)
Generating HTML test report...
Finished generating test html results (0.041 secs)
:test FAILED

FAILURE: Build failed with an exception.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output.

BUILD FAILED

Total time: 12.428 secs

C:\Users\peter\Documents\IdeaProjects\javaee7-handbook\ch08\jaxrs-basic>

This is the failure for the missing JSON-P library. Perhaps the Validation Configuration has been fixed against the trunk already and we are chasing shadows? Here is a suggestion, let's wait until B87 is released and then try again.

Comment by mtaube [ 02/May/13 ]

The CDI issue I've run into is due to the inclusion of cdi-api 1.1 PRD, which is a bug. I will check in a fix once checkins to the trunk are allowed again.





[GLASSFISH-19477] Embedded GlassFish cannot deploy application when more than one persistence unit is present Created: 21/Dec/12  Updated: 21/Dec/12

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

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

Tags: deployment, embedded, jpa

 Description   

A simple ScatteredArchive containing a META-INF/persistence.xml and a stateless session bean referring to one of its two persistence units cannot be deployed by embedded GlassFish. Removing one of the persistence units from the META-INF/persistence.xml resolves the issue.



 Comments   
Comment by Hong Zhang [ 21/Dec/12 ]

Assign to Bhavani to take a look.

Comment by ljnelson [ 21/Dec/12 ]

I have a test case, but cannot see how to attach it in JIRA (maybe I don't have enough permissions?). Happy to Dropbox it or email it as appropriate.





[GLASSFISH-19451] Allow JDBC driver to be loaded from application archive Created: 15/Dec/12  Updated: 23/Feb/14

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

Type: New Feature Priority: Major
Reporter: arjan tijms Assignee: Shalini
Resolution: Unresolved Votes: 7
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: datasource, ear, embedded, jdbc, war

 Description   

As one of the few application servers, GlassFish does not allow a JDBC driver to be loaded from a .war or .ear (see http://henk53.wordpress.com/2012/06/30/the-state-of-datasourcedefinition-in-java-ee). Instead, the driver is required to be stored inside the GlassFish installation directory.

Especially for applications that use an embedded database and an application scoped datasource (specifically those using @DataSourceDefinition), this is not convenient. Those applications can be coded to be almost portable, with the exception that for GlassFish a jar (the JDBC driver) has to be copied from the archive to the AS installation directory.

I would like to ask for the ability to load said JDBC driver directly from an application archive such as .war and .ear.



 Comments   
Comment by Darious3 [ 20/Dec/12 ]

You can now include glassfish-resources.xml in your war, where you can define JDBC resources. These resources have a lifetime scoped to the WAR (created and destroyed when the WAR is deployed/undeployed).

This behavior really should apply to the JDBC driver as well.

Comment by Darious3 [ 04/Apr/13 ]

Has anything happened for this yet?

Comment by arjan tijms [ 16/Dec/13 ]

This seems to have been "silently" fixed in GlassFish 4. The following unit test in the Java EE samples project shows this: https://github.com/javaee-samples/javaee7-samples/blob/master/jpa/datasourcedefinition/src/test/java/org/javaee7/jpa/datasourcedefinition/DataSourceDefinitionTest.java

This test addresses the exact use case this issue is about and puts the JDBC driver into the application archive. The test passes on a stock (embedded) GlassFish 4.

Maybe it should also be tested on a standalone GlassFish 4, but hopefully this shouldn't make any difference.

Comment by martinandersson.com [ 23/Feb/14 ]

The github example you give inject the datasource. I must use a persistence.xml file to declare the persistence unit that relies on my @DataSourceDefinition. With this requirement I can't get my application to work. Another way for me since Java EE 7 is to use the default data source, but then of course, my application still don't deploy deploy and work properly since GlassFish doesn't start his Derby database automatically. For me, I refuse to manually copy-paste jar files to the glassfish installation direction as much as I refuse to manually start the derby database. I can happily do that for a production environment, but until then, as what is my issue now, I'm using Arquillian to do real proper integration tests.

Comment by arjan tijms [ 23/Feb/14 ]

I must use a persistence.xml file to declare the persistence unit that relies on my @DataSourceDefinition. With this requirement I can't get my application to work.

You're most likely being affected by this bug: GLASSFISH-20944

The driver seems to load, but then because of a timing issue of some sorts, or maybe a scoping issue, the JPA boot code can't locate the datasource. Very unfortunate indeed! (please vote for that issue if you think it impacts you). See also JAVAEE_SPEC-30

my applications still don't deploy deploy and work properly since GlassFish doesn't start his Derby database automatically. For me, I refuse to manually copy-paste jar files to the glassfish installation direction as much as I refuse to manually start the derby database.

I agree. This shouldn't be required. I logged issue JAVAEE_SPEC-34 for precisely this a short while ago. There's a corresponding GlassFish specific issue at GLASSFISH-20666

If you care for getting those solved, please vote for them as well

Comment by martinandersson.com [ 23/Feb/14 ]

Thank you Arjan for your feedback, you seem to be a real good spirit. Keep it up! Yeah I did vote for those other issues =)

Comment by reza_rahman [ 23/Feb/14 ]

I think this could be a pretty nice community contribution .





[GLASSFISH-19028] missing glassfish-embedded-all Created: 21/Aug/12  Updated: 27/Sep/12

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

Type: Bug Priority: Major
Reporter: vins4java Assignee: Bhavanishankar
Resolution: Unresolved Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: embedded, glassfish, maven

 Description   

could you provide glassfish-embedded-all distribution for maven users for current version 3.1.2.2 ?
The laster I was able to find is at:
https://maven.java.net/content/repositories/releases/org/glassfish/main/extras/glassfish-embedded-all/



 Comments   
Comment by Romain Grécourt [ 21/Aug/12 ]

3.1.2.2 maven artifacts are not yet available on maven central / maven.java.net release repo.
You can find them here: https://maven.java.net/content/groups/glassfish-release-110/org/glassfish/main/extras/glassfish-embedded-all/

Comment by rzhevskiy [ 27/Sep/12 ]

sources necessary too!!!





[GLASSFISH-17417] Embedded Glassfish is hard-coded to print reporting output to stdout Created: 12/Oct/11  Updated: 20/Dec/16  Resolved: 22/Nov/11

Status: Resolved
Project: glassfish
Component/s: embedded
Affects Version/s: 3.1.2_dev
Fix Version/s: 3.1.2, 4.0

Type: Bug Priority: Major
Reporter: atomicknight Assignee: sakshi.jain
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Java 6u27


Attachments: Zip Archive EmbeddedTest.zip    
Tags: 3_1_2-review, embedded

 Description   

Original forum thread: http://www.java.net/forum/topic/glassfish/glassfish/disabling-reporting-output-when-running-embedded-glassfish

Starting with 3.1.1-b07, the embedded container always prints reporting output to stdout, which interferes with applications that print data to stdout to be consumed by other programs (e.g. in a pipeline). This is a regression from 3.1, where no such output was emitted.

A test case is attached, with profiles for 3.1.1 (the final release), 3.1.1-b07 (the initial build exhibiting the issue), 3.1.1-b06 (the latest build not exhibiting the issue), and 3.1. Running 'mvn package' with the appropriate profile executes the test case. The expected output is a single line with "Hello!" during the execution of the exec:exec goal.



 Comments   
Comment by Tom Mueller [ 13/Oct/11 ]

The output is coming from the following line in DeployerImpl.java (line
134):

actionReport.writeReport(System.out);

The reason that this started showing up in 3.1.1-b07 is probably due to revision 47307 in which the EJBContainerImpl was modified to use a different embedded API, specifically, the embedded API that uses DeployerImpl. So even though the output to System.out was there all along, it only started getting used with this revision.

Comment by scatari [ 04/Nov/11 ]

Please review this for potential inclusion into 3.1.2.

Comment by Bhavanishankar [ 16/Nov/11 ]

Assigning to Sakshi

Comment by atomicknight [ 11/Oct/12 ]

Sorry for the extremely delayed feedback, but it looks like the fix committed as r51062 only partially resolves the issue. DeployerImpl contains another print statement in the #undeploy method (line 158 in trunk at r56366), which causes the same problem.

Can this issue be re-opened? Thanks.





[GLASSFISH-17179] Security configuration files are not copied when embedded container is started using EJBContainer#createEJBContainer Created: 10/Aug/11  Updated: 01/Dec/11

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

Type: Bug Priority: Major
Reporter: atomicknight Assignee: sakshi.jain
Resolution: Unresolved Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

JDK 6u26, Windows 7 Professional 64-bit, glassfish-embedded-all 3.1.1 Maven artifact


Tags: 3_1_2-exclude, ejb, embedded

 Description   

When the embedded container is started using javax.ejb.embeddable.EJBContainer#createEJBContainer, security files like the keystores (e.g. cacerts.jks) are not being copied. This appears to be a regression from 3.1, as these files are copied correctly by the 3.1 version of the glassfish-embedded-all artifact.

The problem seems to be caused by revision 47307, which introduced the use of com.sun.enterprise.security.EmbeddedSecurity when determining whether to copy the files. The root cause of the problem is that the org.glassfish.server.ServerEnvironmentImpl that is constructed and checked by com.sun.enterprise.security.embedded.EmbeddedSecurityUtil has a RuntimeType of "DAS" rather than "EMBEDDED."

In my particular case, there is an additional CA certificate that needs to be added to the CA certificate keystore. Attempting to override the javax.net.ssl.trustStore property from outside the container (whether setting it as a JVM property or passing it as an entry in the Properties object passed to createEJBContainer) doesn't work because the property is being set programmatically from within the embedded container runtime.

I'm starting the container with the following properties set:

org.glassfish.ejb.embedded.glassfish.installation.root=/path/to/install/root
org.glassfish.ejb.embedded.glassfish.instance.root=/path/to/install/root/domains/domain1
org.glassfish.ejb.embedded.glassfish.configuration.file=/path/to/install/root/domains/domain1/config/domain.xml
org.glassfish.ejb.embedded.glassfish.keep-temporary-files=true

My modified version of cacerts.jks lives in /path/to/install/root/domains/domain1/config/. However, the version of cacerts.jks actually being used (i.e. in the temporary folder) is the version included with the glassfish-embedded-all artifact.



 Comments   
Comment by Cheng Fang [ 10/Aug/11 ]

assign to security team to check why EmbeddedSecurityUtil has a RuntimeType of "DAS" rather than "EMBEDDED."

Comment by Nithya Ramakrishnan [ 24/Aug/11 ]

This seems to happen because type argument is not being passed as an argument when the Embedded EJB container is created. In ServerEnvironmentImpl, the serverType seems to default to DAS, since the typeString argument is null. Transferring this issue to the Embedded team for fixing this.

Comment by Bhavanishankar [ 14/Nov/11 ]

It is the correct behaviour of embedded GlassFish to return the serverType as DAS. Internal code should never depend on whether the server is running in EMBEDDED mode or standalone mode.

Comment by Bhavanishankar [ 01/Dec/11 ]

assigning.





[GLASSFISH-17154] Unable to access role-protected remote bean using maven-embedded-glassfish-plugin Created: 05/Aug/11  Updated: 08/Mar/12

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

Type: Bug Priority: Major
Reporter: ljnelson Assignee: sakshi.jain
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Zip Archive remote-authentication.zip    
Tags: 3_1_2-exclude, community, embedded, security

 Description   

I'm using the maven-embedded-glassfish-plugin to do some integration testing.

I have an .ear file with an ejb.jar file in it. The ejb.jar file contains a single, remote, role-protected EJB in it. This .ear file deploys fine to embedded Glassfish v3.1.1.

Prior to deployment, I use the plugin to set up a user named "scott" with a password "tiger" and assign him to the group "superuser". I get the password in there by using the (recently added, as of Glassfish embedded 3.1.1) --passwordfile option (see http://java.net/jira/browse/GLASSFISH-16277). It is my understanding from looking at the domain.xml that ships as part of embedded-all that default Principal-to-role mapping is turned on. These setup commands, using the AdminMojo, complete normally with an odd-to-decipher but presumably OK SUCCESS message.

In my .ear file Maven project, I have a single unit test that attempts to look up this bean from an embedded Glassfish instance that has been started by the maven-embedded-glassfish-plugin. This lookup fails. The lookup string is correct, as the lookup succeeds if I unprotect the bean by removing the @RolesAllowed annotation.

To perform the lookup, I first do a ProgrammaticLogin. I take care to make sure that the login configuration file is passed as a system property, containing the proper configuration for the default realm. The ProgrammaticLogin of course doesn't actually log anyone in at this point; it just stashes the credentials. This completes normally.

But the lookup fails with a CORBA NO_PERMISSION error.

I'm going to attach a Maven project that demonstrates the issue.



 Comments   
Comment by Bhavanishankar [ 08/Mar/12 ]

assigning to Sakshi.





[GLASSFISH-17145] Cannot use deploymentParams to specify application name as documentation suggests Created: 03/Aug/11  Updated: 08/Mar/12

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

Type: Bug Priority: Minor
Reporter: ljnelson Assignee: sakshi.jain
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: community, embedded

 Description   

The maven-embedded-glassfish-plugin documentation clearly prefers we use <deploymentParams> wherever possible.

One cannot supply an application name in this manner, however:

<deploymentParams>
<param>--name=foo</param>
</deploymentParams>

This is because the Maven plugin property "name" has a default value. The result is that if you omit it, "myapp" is used instead, and (in the example above) both "foo" and "myapp" are passed as name values to the deployment. This is of course an error and you get a nasty message that says that repeated parameter values (in this case it's probably --name) are not allowed.

The workaround is to simply use the <name> property and to not use a deployment param for this case.



 Comments   
Comment by Bhavanishankar [ 08/Mar/12 ]

Similar to the 'name', the 'context root' can also be specified exclusively using <contextRoot> element of the deploy goal. The exclusive elements should take precedence over what is specified in the <deploymentParams> for backward compatibility reasons.

As a fix, while processing <deployParams> values, the above precedence should be taken care of.

Assigning to Sakshi.

Comment by Bhavanishankar [ 08/Mar/12 ]

assigning to Sakshi





[GLASSFISH-17144] Missing dependency in maven-embedded-glassfish-plugin Created: 03/Aug/11  Updated: 14/Nov/11  Resolved: 14/Nov/11

Status: Resolved
Project: glassfish
Component/s: embedded
Affects Version/s: 3.1.1
Fix Version/s: 3.1.2, 4.0

Type: Bug Priority: Major
Reporter: ljnelson Assignee: Bhavanishankar
Resolution: Fixed Votes: 5
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: 3_1-fishcat, embedded

 Description   

Setting up the maven-embedded-glassfish-plugin according to http://blogs.oracle.com/alexismp/entry/glassfish_embedded_and_javadb_embedded results in a WARNING spit to the console complaining about a missing OSGI class (ServiceException). A thread in the Glassfish forums (http://www.java.net/forum/topic/glassfish/glassfish/glassfish-embedded-all-v311-b11-could-not-instantiate-service-class-orgglassfishosgicdiimplosgis) details the issue as well as a workaround.



 Comments   
Comment by Bhavanishankar [ 03/Aug/11 ]

Please ignore this WARNING message. This message has no consequences. Also, no need to add OSGi artifact to dependencies, just ignore the stacktrace.

Comment by toomanyryans [ 04/Aug/11 ]

To clarify, I experience this with 'glassfish-embedded-all'. I'm not using 'maven-embedded-glassfish-plugin'.

Also, I assume you mean ignore the stacktrace for now (until it's cleaned up), right?

Comment by Bhavanishankar [ 04/Aug/11 ]

Yes, I mean ignore the stacktrace...

Comment by Bhavanishankar [ 14/Nov/11 ]

This has been fixed in both 3.1.2 and trunk.





[GLASSFISH-16264] Embedded GF 3.1 (re)deployment with EJBContainer causes exception: Error linking security policy for ejb-timer-service-app Created: 24/Mar/11  Updated: 21/Sep/15

Status: Reopened
Project: glassfish
Component/s: security
Affects Version/s: 3.1
Fix Version/s: 4.1.1

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

Windows 7 Premium 64 bit; Glassfish 3.1; JDK 1.6.0_22 32 bit


Tags: 3_1-next, 3_1_1-scrubbed, 3_1_2-exclude, bug, ejb31, embedded

 Description   

I have a JUnit test that starts up embedded glassfish 3.1 and deploys a module which contains EJBs. I placed the container init code in a @Before method so that it will be started fresh for each test like so:

//Set up the embedded EJB containers env properties
Map<String, Object> p = new HashMap<String, Object>();
p.put(EJBContainer.APP_NAME, "myapp");
p.put(EJBContainer.MODULES, new File("out/production/myapp"));
p.put("org.glassfish.ejb.embedded.glassfish.installation.root", "C:/glassfish3/glassfish");
ejbC = EJBContainer.createEJBContainer(p);

I also have a @After method which closes the container after each test like :

@After
public void tearDown() throws Exception

{ if (ejbC != null) ejbC.close(); }

The problem I am having is that the first test method deploys and runs fine, however, subsequent test methods fail on deployment with the following exception thrown by the EJBContainer.createEJBContainer(p) line of code above:

Mar 24, 2011 10:21:32 AM com.sun.ejb.containers.EjbContainerUtilImpl deployEJBTimerService
INFO: Loading EJBTimerService. Please wait.
classLoader = WebappClassLoader (delegate=true; repositories=WEB-INF/classes/)
SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@167a209
Mar 24, 2011 10:21:32 AM org.hibernate.validator.engine.resolver.DefaultTraversableResolver detectJPA
INFO: Instantiated an instance of org.hibernate.validator.engine.resolver.JPATraversableResolver.
Mar 24, 2011 10:21:32 AM org.eclipse.persistence.session.file:/C:/Users/nwhite/AppData/Local/Temp/gfembed8734725078398943370tmp/applications/ejb-timer-service-app/WEB-INF/classes/___EJB__Timer__App
INFO: EclipseLink, version: Eclipse Persistence Services - 2.2.0.v20110202-r8913
Mar 24, 2011 10:21:36 AM org.eclipse.persistence.session.file:/C:/Users/nwhite/AppData/Local/Temp/gfembed8734725078398943370tmp/applications/ejb-timer-service-app/WEB-INF/classes/___EJB__Timer__App
INFO: file:/C:/Users/nwhite/AppData/Local/Temp/gfembed8734725078398943370tmp/applications/ejb-timer-service-app/WEB-INF/classes/___EJB__Timer__App login successful
Mar 24, 2011 10:21:36 AM com.sun.ejb.containers.TimerBeanContainer <init>
INFO: [TimerBeanContainer] Created TimerBeanContainer: TimerBean
Mar 24, 2011 10:21:36 AM com.sun.ejb.containers.BaseContainer initializeHome
INFO: Portable JNDI names for EJB TimerBean : [java:global/ejb-timer-service-app/TimerBean, java:global/ejb-timer-service-app/TimerBean!com.sun.ejb.containers.TimerLocal]
classLoader = WebappClassLoader (delegate=true; repositories=WEB-INF/classes/)
SharedSecrets.getJavaNetAccess()=java.net.URLClassLoader$7@167a209
Mar 24, 2011 10:21:36 AM org.glassfish.api.ActionReport failure
SEVERE: Exception while loading the app
Mar 24, 2011 10:21:36 AM org.eclipse.persistence.session.file:/C:/Users/nwhite/AppData/Local/Temp/gfembed8734725078398943370tmp/applications/ejb-timer-service-app/WEB-INF/classes/___EJB__Timer__App
INFO: file:/C:/Users/nwhite/AppData/Local/Temp/gfembed8734725078398943370tmp/applications/ejb-timer-service-app/WEB-INF/classes/___EJB__Timer__App logout successful
Mar 24, 2011 10:21:36 AM com.sun.ejb.containers.EjbContainerUtilImpl deployEJBTimerService
WARNING: Cannot deploy or load EJBTimerService:
org.glassfish.deployment.common.DeploymentException: Error in linking security policy for ejb-timer-service-app – Inconsistent Module State
at com.sun.enterprise.security.SecurityUtil.linkPolicyFile(SecurityUtil.java:335)
at com.sun.enterprise.security.SecurityDeployer.linkPolicies(SecurityDeployer.java:279)
at com.sun.enterprise.security.SecurityDeployer.access$100(SecurityDeployer.java:81)
at com.sun.enterprise.security.SecurityDeployer$AppDeployEventListener.event(SecurityDeployer.java:114)
at org.glassfish.kernel.event.EventsImpl.send(EventsImpl.java:128)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:262)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:460)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at com.sun.ejb.containers.EjbContainerUtilImpl.deployEJBTimerService(EjbContainerUtilImpl.java:547)
at com.sun.ejb.containers.EjbContainerUtilImpl.getEJBTimerService(EjbContainerUtilImpl.java:289)
at com.sun.ejb.containers.EjbContainerUtilImpl.getEJBTimerService(EjbContainerUtilImpl.java:284)
at com.sun.ejb.containers.EjbContainerUtilImpl.getEJBTimerService(EjbContainerUtilImpl.java:269)
at com.sun.ejb.containers.BaseContainer.<init>(BaseContainer.java:755)
at com.sun.ejb.containers.AbstractSingletonContainer.<init>(AbstractSingletonContainer.java:141)
at com.sun.ejb.containers.CMCSingletonContainer.<init>(CMCSingletonContainer.java:77)
at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:115)
at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:234)
at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:290)
at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:101)
at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:186)
at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:249)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:460)
at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
at org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:193)
at org.glassfish.kernel.embedded.EmbeddedDeployerImpl.deploy(EmbeddedDeployerImpl.java:142)
at org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:135)
at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:132)
at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:127)

During the shutdown process after the first test runs I noticed the following:

Mar 24, 2011 10:21:19 AM com.sun.ejb.containers.TimerBeanContainer doConcreteContainerShutdown
INFO: [TimerBeanContainer] Shutdown() called....
Mar 24, 2011 10:21:19 AM com.sun.ejb.containers.EJBTimerService onShutdown
INFO: EJB5122:EJB Timer Service shutdown at [2011/03/24 10:21:19]
Mar 24, 2011 10:21:19 AM com.sun.enterprise.web.WebContainer unloadWebModule
SEVERE: WEB0162: [WebContainer] Undeployment failed for context [/ejb-timer-service-app]
Mar 24, 2011 10:21:19 AM org.eclipse.persistence.session.file:/C:/Users/nwhite/AppData/Local/Temp/gfembed671660783214676050tmp/applications/ejb-timer-service-app/WEB-INF/classes/___EJB__Timer__App
INFO: file:/C:/Users/nwhite/AppData/Local/Temp/gfembed671660783214676050tmp/applications/ejb-timer-service-app/WEB-INF/classes/___EJB__Timer__App logout successful



 Comments   
Comment by marina vatkina [ 24/Mar/11 ]

Note that the same error can be observed by uncommenting lines marked "** Run the 2nd time **" in client/Client.java under v2/appserv-tests/devtests/ejb/ejb31/embedded/timertest (updated today) and do 'ant all'

Comment by kumarjayanti [ 18/May/11 ]

Please provide us a testcase.

Comment by scatari [ 25/Jun/11 ]

Closing this issue as a reproducible test case hasn't been provided. Please reopen once you have the test case.

Comment by emailnbw [ 25/Jun/11 ]

I am confused by scatari's actions. It appears from that history that kumarjayanti has marked this bug as fixed in 3.1.1 with checkin 14740. Is this not the case?

If this is not the case then there are plenty of details in the original bug report to set up your own test case. In addition Marina has also described how to reproduce this issue.

What more needs to be spoon fed?

This bug makes it impossible to effective unit test with isolated JUnit tests using Embedded Glassfish. Considering one of Embedded Glassfish's important use cases is to make unit testing your EJB easier I think this is a rather important bug to fix.

Comment by scatari [ 25/Jun/11 ]

No updates to the bug since 18/May with the final comment being a request to send a test case. I don't see a comment about 14740 in this tool.

Comment by emailnbw [ 25/Jun/11 ]

@scatari If you click on the 'All' tab in JIRA (I assume you must being using the same JIRA web interface?!) you will see on May 18th right below kumarjayanti's comment about requesting a test case he set the "Fix Version/s" field to 3.1.1 [14740]. To me, that implies a fix was checked in. Does it not?

Once again, there is plenty of detail in my original submission for kumarjayanti (or anyone else) to write a test for this. And again, Marina's comments on 3/24 also spell out how to reproduce this issue using your own devtests!

Comment by kumarjayanti [ 26/Jun/11 ]

The security team and Marina are actively discussing how to fix this...

Comment by marina vatkina [ 27/Jun/11 ]

As everybody said, it was wrong to close it

Comment by scatari [ 27/Jun/11 ]

Can we update the bug as when we have information to show the progress? Not seeing any update to the bug for a month does not prove that it is being worked on.

Comment by marina vatkina [ 06/Jul/11 ]

patch for static refs in the ejb-container

Comment by marina vatkina [ 06/Jul/11 ]

With the currant security hack in 3.1.1, and my patch attached to this issue, the 2nd TS start fails with:

[java] Jul 6, 2011 2:07:11 PM com.sun.enterprise.security.provider.BasePolicyWrapper logMsg
[java] INFO: JACC Policy Provider:Failed Permission Check: context (" ejb-timer-service-app/ejb-timer-service-app_internal ") , permission (" (javax.security.jacc.EJBMethodPermission TimerBean findActiveTimersOwnedByThisServer,Local,) ")
[java] Jul 6, 2011 2:07:11 PM com.sun.ejb.containers.BaseContainer postInvoke
[java] WARNING: A system exception occurred during an invocation on EJB TimerBean method public java.util.Set com.sun.ejb.containers.TimerBean.findActiveTimersOwnedByThisServer()
[java] javax.ejb.AccessLocalException: Client not authorized for this invocation.

Comment by marina vatkina [ 06/Jul/11 ]

The patch is checked in into trunk with rev 47893.

Comment by marina vatkina [ 07/Jul/11 ]

The patch is checked in with rev 47907 to 3.1.1 branch

Comment by scatari [ 11/Jul/11 ]

Fixed in B11.

Comment by marina vatkina [ 11/Jul/11 ]

The security part is not fixed. The EJB part is.

Comment by Cheng Fang [ 13/Jul/11 ]

Assign it to me.

Comment by Cheng Fang [ 15/Jul/11 ]

Stacktrace for the permission check error:

     [java] WARNING: A system exception occurred during an invocation on EJB TimerBean method public java.util.Set com.sun.ejb.containers.TimerBean.findActiveTimersOwnedByThisServer()
     [java] javax.ejb.AccessLocalException: Client not authorized for this invocation.
     [java] 	at com.sun.ejb.containers.BaseContainer.preInvoke(BaseContainer.java:1885)
     [java] 	at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:212)
     [java] 	at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:88)
     [java] 	at $Proxy130.findActiveTimersOwnedByThisServer(Unknown Source)
     [java] 	at com.sun.ejb.containers.EJBTimerService.restoreEJBTimers(EJBTimerService.java:486)
     [java] 	at com.sun.ejb.containers.EjbContainerUtilImpl.getEJBTimerService(EjbContainerUtilImpl.java:307)
     [java] 	at com.sun.ejb.containers.EjbContainerUtilImpl.getEJBTimerService(EjbContainerUtilImpl.java:289)
     [java] 	at com.sun.ejb.containers.EjbContainerUtilImpl.getEJBTimerService(EjbContainerUtilImpl.java:274)
     [java] 	at com.sun.ejb.containers.BaseContainer.<init>(BaseContainer.java:755)
     [java] 	at com.sun.ejb.containers.StatelessSessionContainer.<init>(StatelessSessionContainer.java:155)
     [java] 	at com.sun.ejb.containers.StatelessSessionContainer.<init>(StatelessSessionContainer.java:149)
     [java] 	at com.sun.ejb.containers.ContainerFactoryImpl.createContainer(ContainerFactoryImpl.java:105)
     [java] 	at org.glassfish.ejb.startup.EjbApplication.loadContainers(EjbApplication.java:230)
     [java] 	at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:290)
     [java] 	at org.glassfish.ejb.startup.EjbDeployer.load(EjbDeployer.java:101)
     [java] 	at org.glassfish.internal.data.ModuleInfo.load(ModuleInfo.java:186)
     [java] 	at org.glassfish.internal.data.ApplicationInfo.load(ApplicationInfo.java:257)
     [java] 	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:461)
     [java] 	at com.sun.enterprise.v3.server.ApplicationLifecycle.deploy(ApplicationLifecycle.java:240)
     [java] 	at org.glassfish.deployment.admin.DeployCommand.execute(DeployCommand.java:382)
     [java] 	at com.sun.enterprise.v3.admin.CommandRunnerImpl$1.execute(CommandRunnerImpl.java:355)
     [java] 	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:370)
     [java] 	at com.sun.enterprise.v3.admin.CommandRunnerImpl.doCommand(CommandRunnerImpl.java:1064)
     [java] 	at com.sun.enterprise.v3.admin.CommandRunnerImpl.access$1200(CommandRunnerImpl.java:96)
     [java] 	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1244)
     [java] 	at com.sun.enterprise.v3.admin.CommandRunnerImpl$ExecutionContext.execute(CommandRunnerImpl.java:1232)
     [java] 	at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:129)
     [java] 	at com.sun.enterprise.admin.cli.embeddable.DeployerImpl.deploy(DeployerImpl.java:105)
     [java] 	at org.glassfish.ejb.embedded.EJBContainerImpl.deploy(EJBContainerImpl.java:140)
     [java] 	at org.glassfish.ejb.embedded.EJBContainerProviderImpl.createEJBContainer(EJBContainerProviderImpl.java:134)
     [java] 	at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:127)
     [java] 	at javax.ejb.embeddable.EJBContainer.createEJBContainer(EJBContainer.java:102)
     [java] 	at com.acme.Client.test(Client.java:81)
     [java] 	at com.acme.Client.main(Client.java:70)
Comment by Cheng Fang [ 15/Jul/11 ]

After applying Kumar's hack (related to inService check) to 3.1.1 build, the ejbdev test embedded/timertest passed when running the second timer tests. I tried the test run several times w/ the same result.

The ejb error Kumar was seeing before (Caused by: java.lang.NoSuchFieldError: moduleName) looks like a setup issue. moduleName field was recently added to 3.2, but not to 3.1.1. When runnign w/ 3.1.1, there should be no trace of it. With 3.2, it should be resolved correctly.

Re-assign to security team to pursue a formal fix.

Comment by syvalta [ 15/Jun/12 ]

Could the "Fix version" be updated as this is still open and 3.1.2 has already been released?

Comment by markds [ 10/Jan/13 ]

Can I ask what is happening with this bug? It still occurs in 3.1.2.2





[GLASSFISH-16138] Stuck thread after server stop prevents JVM stop Created: 03/Mar/11  Updated: 25/Oct/11  Resolved: 26/May/11

Status: Closed
Project: glassfish
Component/s: embedded
Affects Version/s: 3.1
Fix Version/s: None

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

Windows 2003 Server
jdk 1.6.0_18


Attachments: File j2ee.ear     Java Source File server-start.java    
Tags: 3_1_2-exclude, CORBA, JVM, embedded, glassfish-3-1, stuck

 Description   

Non-daemon com.sun.corba.ee.impl.javax.rmi.CORBA.Util.KeepAlive thread prevents JVM from exiting.
This thread is launched when an application with an EJB is deployed on an embedded server. After the undeployment and server stop the thread continues to run.



 Comments   
Comment by marina vatkina [ 03/Mar/11 ]

GF Embedded API are used to run the test

Comment by Bhavanishankar [ 26/May/11 ]

This is a duplicate of http://java.net/jira/browse/GLASSFISH-14877





[GLASSFISH-15884] Unable to use a custom Keystore for SSL with embedded version Created: 08/Feb/11  Updated: 20/Dec/16  Resolved: 08/Feb/11

Status: Resolved
Project: glassfish
Component/s: web_container
Affects Version/s: 3.1_dev
Fix Version/s: 3.1.1_dev

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

Windows XP SP3
Java 1.6 for business u18
Glassfish-embedded-all-b41.jar


Tags: 3_1-exclude, embedded, ssl

 Description   

Hello,

I'm trying to use a custom keystore to configure a HTTPS listener in glassfish with the following code :

GlassFish glassfish = GlassFishRuntime.bootstrap().newGlassFish();
glassfish.start();

// Create a web container, and https listener.
WebContainer webcontainer = glassfish.getService(WebContainer.class);
HttpsListener listener = new HttpsListener();
listener.setPort(9191);
listener.setId("https-listener-2");
listener.setProtocol("https"); // enable security
SslConfig sslConfig = new SslConfig();
sslConfig.setKeyStore("C:\\temp
mykeystore.jks");
sslConfig.setKeyPassword("Abcd1234");
sslConfig.setTrustStore(new File("C:\\temp
mykeystore.jks"));
listener.setSslConfig(sslConfig);
webcontainer.addWebListener(listener);

When a connect to my server in the 9191 port, the certificate used is not the one in my keystore, but the one located in

{instanceRoot}

/config/keystore.jks

After digging in the open and resolved issues on Embedded-Glassfish, it appears that the issue is caused by the fix of "GLASSFISH-14572 - Unable to create https listeners in embedded glassfish" which force the value of the KeyStore/TrustStore properties through the jvm-options in the embedded domain.xml (in org.glassfish.embed package)

After doing a rollback of the change (i.e removing the 2 jvm-options lines from the domain.xml) the glassfish server correctly use the system properties defined.

However, setting the KeyStore/TrustStore/Password through the org.glassfish.embeddable.web.config.SslConfig object does not seem to have any impact. If the system properties are set, they take precedence. If they are not set, the following error is thrown :

SEVERE: Failed to load keystore type JKS with path null due to null
java.lang.NullPointerException
at java.io.File.<init>(File.java:222)
at com.sun.grizzly.util.net.jsse.JSSESocketFactory.getStore(JSSESocketFactory.java:326)
at com.sun.grizzly.util.net.jsse.JSSESocketFactory.getKeystore(JSSESocketFactory.java:272)
at com.sun.grizzly.util.net.jsse.JSSE14SocketFactory.getKeyManagers(JSSE14SocketFactory.java:203)
...

Once the SslConfig usage is fixed, it would be nice to be able to change the KeyStore type to something else than JKS through the same object.



 Comments   
Comment by Bhavanishankar [ 08/Feb/11 ]

The fix for 14572 was to made so that HTTPS listener creation works out of the box. As you rightly pointed out, you can always specify -Djavax.net.ssl.keyStore and -Djavax.net.ssl.trustStore when launching your embedded program.

Assigning to web container to look into why the configurations specified programmatically via SslConfig don't take precedence over the system properties.

Comment by gastush [ 08/Feb/11 ]

The problem with setting -Djavax.net.ssl.keyStore when launching the program is that it gets overrideng by the "default" values taken from the domain.xml file.
Just do the following to see it in action :

System.out.println(System.getProperty("javax.net.ssl.keyStore"));
GlassFishRuntime gfr = GlassFishRuntime.bootstrap();
GlassFish glassfish = gfr.newGlassFish();
glassfish.start();
System.out.println(System.getProperty("javax.net.ssl.keyStore"));

run with java -Djavax.net.ssl.keyStore=somekeystore.jks argument

And you will see that the value before and after are different, which is not what I was expecting.
After starting the glassfish server, the javax.net.ssl.keyStore property contains the value defined in the domain.xml and not the one given on the command line.

Comment by Bhavanishankar [ 08/Feb/11 ]

Okay, I see. So, basically we have 2 issues here:

1. keyStore & trustStore settings from domain.xml is always getting used.

2. listener.setSslConfig(sslConfig) is not working as expected.

Workaround for #1 is to get the domain.xml from http://embedded-glassfish.java.net/domain.xml and change keystore/truststore vm options and use it while embedding GlassFish, like this:

GlassFishRuntime gfr = GlassFishRuntime.bootstrap();
GlassFishProperties gfProps = new GlassFishProperties();
gfProps.setConfigFileURI(new File("modified-domain.xml").toURI().toString());
GlassFish glassfish = gfr.newGlassFish(gfProps);
glassfish.start();

IMO, #1 is a generic issue in the sense that any vm options supplied by the user should always take precedence over what is in domain.xml. So, I will file a separate issue for #1, and leave this issue for addressing #2.

Comment by Bhavanishankar [ 08/Feb/11 ]

I meant "#1 is a generic issue in the sense that any 'system property' supplied by the user should always take precedence over what is in domain.xml's jvm-options."

Comment by Amy Roh [ 08/Feb/11 ]

The ability to configure SSL connector over the system properties will be implemented in 3.2.

Comment by Amy Roh [ 08/Feb/11 ]

Fixed

Sending web-embed/api/src/main/java/org/glassfish/embeddable/web/HttpsListener.java
Sending web-embed/api/src/main/java/org/glassfish/embeddable/web/config/SslConfig.java
Sending web-embed/impl/src/main/java/org/glassfish/web/embed/impl/WebContainerImpl.java
Transmitting file data ...
Committed revision 45006.





[EMBEDDED_GLASSFISH-146] ClassCastException with JAXRPC webservice Created: 21/May/14  Updated: 21/May/14

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

Type: Bug Priority: Major
Reporter: manohar.akula Assignee: Bhavanishankar
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

JDK7, OSX 10.9.2


Tags: embedded, jax-ws

 Description   

I have a JAXRPC webservice as part of a EAR that I'm trying to deploy as a ScatteredEAR. The endpoint is successfully exposed, however when I invoke it with some data, I get a ClassCastException with the following stacktrace.

SEVERE: ws.error_next_pipe
java.lang.ClassCastException: org.glassfish.webservices.monitoring.JAXRPCEndpointImpl cannot be cast to org.glassfish.webservices.monitoring.JAXWSEndpointImpl
at org.glassfish.webservices.MonitoringPipe.process(MonitoringPipe.java:123)
at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:119)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:1136)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:1050)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:1019)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:877)
at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeImpl.java:136)
at com.sun.enterprise.security.webservices.CommonServerSecurityPipe.processRequest(CommonServerSecurityPipe.java:210)
at com.sun.enterprise.security.webservices.CommonServerSecurityPipe.process(CommonServerSecurityPipe.java:142)
at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter.java:119)
at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:1136)
at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:1050)
at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:1019)
at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:877)
at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:420)
at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:687)
at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:266)
at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:169)
at org.glassfish.webservices.JAXWSServlet.doPost(JAXWSServlet.java:169)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
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:357)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:260)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:246)
at org.glassfish.grizzly.http.server.HttpHandler.runService(HttpHandler.java:191)
at org.glassfish.grizzly.http.server.HttpHandler.doHandle(HttpHandler.java:168)
at org.glassfish.grizzly.http.server.HttpServerFilter.handleRead(HttpServerFilter.java:189)
at org.glassfish.grizzly.filterchain.ExecutorResolver$9.execute(ExecutorResolver.java:119)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeFilter(DefaultFilterChain.java:288)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.executeChainPart(DefaultFilterChain.java:206)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.execute(DefaultFilterChain.java:136)
at org.glassfish.grizzly.filterchain.DefaultFilterChain.process(DefaultFilterChain.java:114)
at org.glassfish.grizzly.ProcessorExecutor.execute(ProcessorExecutor.java:77)
at org.glassfish.grizzly.nio.transport.TCPNIOTransport.fireIOEvent(TCPNIOTransport.java:838)
at org.glassfish.grizzly.strategies.AbstractIOStrategy.fireIOEvent(AbstractIOStrategy.java:113)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.run0(WorkerThreadIOStrategy.java:115)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy.access$100(WorkerThreadIOStrategy.java:55)
at org.glassfish.grizzly.strategies.WorkerThreadIOStrategy$WorkerThreadRunnable.run(WorkerThreadIOStrategy.java:135)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:564)
at org.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:544)
at java.lang.Thread.run(Thread.java:744)






[EMBEDDED_GLASSFISH-133] Junit test case works only in jdbc/__default datasource Created: 03/Dec/11  Updated: 03/Dec/11

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

Type: Bug Priority: Critical
Reporter: abinmd Assignee: Bhavanishankar
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: 1 week
Time Spent: Not Specified
Original Estimate: 1 week
Environment:

Windows,


Issuezilla Id: 15,430
Tags: Junit, embedded, glassfish-3-1-1, jpa, persistence

 Description   

I wrote a testcase with embedded GlassFish for testing an EJB.
When I tried to test it using jdbc/mydb as datasource (in persistence.xml) I got the following error

Exception while preparing the app : Invalid resource : jdbc/mydb_pm com.sun.appserv.connectors. internal.api.ConnectorRuntimeException: Invalid resource : jdbc/mydb_pm

When I changed the datasource to jdbc/__default with the same connection pool as of jdbc/mydb it worked perfect.
Why is it so? What is the difference between these two datasources?






[EMBEDDED_GLASSFISH-128] Unsupported deployment descriptors elements Created: 13/Apr/11  Updated: 14/Apr/11

Status: Open
Project: embedded-glassfish
Component/s: API
Affects Version/s: 3.1
Fix Version/s: None

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

Tags: deployment, descriptors, ejb, element, embedded, endpoint, glassfish-ejb-jar, sun-ajb-jar, unsupported, webservice

 Description   

In Junit integration test I'm trying to deploy an EAR application with one EJB JAR module onto embedded glassfish instance. In the module is sun-ejb-jar.xml for SGES2_1_1, but the "endpoint-address-uri" is ignored and the webservice is listening in another context. So I created the glassfish-ejb-jar.xml with the same settings - but it does not work either.

Apr 13, 2011 2:42:49 PM com.sun.enterprise.deployment.archivist.Archivist readRuntimeDeploymentDescriptor
WARNING: DPL8027: Ignore META-INF/sun-ejb-jar.xml in archive .../ear/target/glassfish/instanceroot/applications/my-1.1.0-SNAPSHOT/my-ejb_jar/, as GlassFish counterpart runtime xml META-INF/glassfish-ejb-jar.xml is present in the same archive.
Apr 13, 2011 2:42:49 PM com.sun.enterprise.deployment.node.DeploymentDescriptorNode setElementValue
WARNING: DPL8007: Unsupported deployment descriptors element debugging-enabled value true
Apr 13, 2011 2:42:49 PM com.sun.enterprise.deployment.node.runtime.WebServiceEndpointRuntimeNode setElementValue
SEVERE: DPL5041:Unknown port-component-name MyWS port, all sub elements will be ignored"
Apr 13, 2011 2:42:49 PM com.sun.enterprise.deployment.node.DeploymentDescriptorNode setElementValue
WARNING: DPL8007: Unsupported deployment descriptors element endpoint-address-uri value /webservice/MyWS
Apr 13, 2011 2:42:49 PM com.sun.enterprise.deployment.node.DeploymentDescriptorNode setElementValue
WARNING: DPL8007: Unsupported deployment descriptors element auth-method value BASIC
Apr 13, 2011 2:42:49 PM com.sun.enterprise.deployment.node.DeploymentDescriptorNode setElementValue
WARNING: DPL8007: Unsupported deployment descriptors element transport-guarantee value NONE

....

INFO: WS00019: EJB Endpoint deployed
my-1.1.0-SNAPSHOT listening at address at http://mymachine:8080/MyWS/MyWSBean



 Comments   
Comment by dmatej [ 14/Apr/11 ]

Forget it ... maybe ...

It was my fault - the problem was in port-component-name - if it is incorrect, I can see these tragic messages - I have only one desire - could these messages be more descriptive? It took nearly whole day to find where the problem is ... At first I thought that some settings are not supported and so I cannot use embedded glassfish at all.
Finally I made it work perfectly as I wanted.





Generated at Mon May 01 02:24:11 UTC 2017 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.