This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 199389 - There's no ObjectFactory with an @XmlElementDecl for the element
Summary: There's no ObjectFactory with an @XmlElementDecl for the element
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Web Project (show other bugs)
Version: 7.0
Hardware: All All
: P1 normal (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-13 20:37 UTC by BradCox
Modified: 2011-11-16 16:42 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Glassfish log (33.27 KB, application/octet-stream)
2011-06-13 23:52 UTC, BradCox
Details
Glassfish log (33.27 KB, application/octet-stream)
2011-06-13 23:52 UTC, BradCox
Details
Source folder zipped (50.82 KB, application/x-java-archive)
2011-06-13 23:58 UTC, BradCox
Details

Note You need to log in before you can comment on or make changes to this bug.
Description BradCox 2011-06-13 20:37:33 UTC
Product Version = NetBeans IDE Dev (Build 201106110600)
Operating System = Mac OS X version 10.6.7 running on x86_64
Java; VM; Vendor = 1.6.0_24
Runtime = Java HotSpot(TM) 64-Bit Server VM 19.1-b02-334
Comment 1 BradCox 2011-06-13 20:49:37 UTC
Deploying web service modified from maven calculator service to use SAML-P and XACML types in lieu of int compile fine but fail during deploy with these lines in the log. This has been reported elsewhere but the workaround described there doesn't work. 

I've attached the failing project and the schema directory its based on in the hope someone there can spare a clue. In particular I added @XMLSeeAlso in AttributeService.java. But the project fails to load whether that's included or not. 

These are heavily used schema straight from W3C and Oasis so Netbeans/Glassfish should be able to handle them without so much debugging and tinkering at such low levels.

Caused by: java.security.PrivilegedActionException: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
There's no ObjectFactory with an @XmlElementDecl for the element {urn:oasis:names:tc:xacml:2.0:profile:saml2.0:v2:schema:assertion:wd-13}ReferencedPolicies.
	this problem is related to the following location:
		at protected java.util.List oasis.names.tc.xacml._2_0.profile.saml2_0.v2.schema.protocol.wd_13.XACMLAuthzDecisionQueryType.rest
		at oasis.names.tc.xacml._2_0.profile.saml2_0.v2.schema.protocol.wd_13.XACMLAuthzDecisionQueryType

	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.xml.ws.model.AbstractSEIModelImpl.createJAXBContext(AbstractSEIModelImpl.java:158)
	... 49 more
Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1 counts of IllegalAnnotationExceptions
There's no ObjectFactory with an @XmlElementDecl for the element {urn:oasis:names:tc:xacml:2.0:profile:saml2.0:v2:schema:assertion:wd-13}ReferencedPolicies.
	this problem is related to the following location:
		at protected java.util.List oasis.names.tc.xacml._2_0.profile.saml2_0.v2.schema.protocol.wd_13.XACMLAuthzDecisionQueryType.rest
		at oasis.names.tc.xacml._2_0.profile.saml2_0.v2.schema.protocol.wd_13.XACMLAuthzDecisionQueryType

	at com.sun.xml.bind.v2.runtime.IllegalAnnotationsException$Builder.check(IllegalAnnotationsException.java:106)
	at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getTypeInfoSet(JAXBContextImpl.java:489)
	at com.sun.xml.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:319)
	at com.sun.xml.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1170)
	at com.sun.xml.bind.v2.ContextFactory.createContext(ContextFactory.java:188)
	at com.sun.xml.bind.api.JAXBRIContext.newInstance(JAXBRIContext.java:111)
	at com.sun.xml.ws.developer.JAXBContextFactory$1.createJAXBContext(JAXBContextFactory.java:113)
	at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:166)
	at com.sun.xml.ws.model.AbstractSEIModelImpl$1.run(AbstractSEIModelImpl.java:159)
	... 51 more
Comment 2 BradCox 2011-06-13 20:51:21 UTC
PS: The problem occurs with Netbeans 7 main and/or nightly. This report is with the latest nighly I could find.
Comment 3 BradCox 2011-06-13 21:40:25 UTC
Sorry, the @XMLSeeAlso was in another service that I didn't send. 

Add this to AttributeService.java and notice it has no effect.

@XmlSeeAlso(
	{ReferencedPoliciesType.class}
)

Nor does using XACMLAuthzDecisionQueryType instead of ReferencedPolicies.

Nor does adding this at the end as recommended on another report of this bug.

	// See http://stackoverflow.com/questions/5627173/specify-jaxb-packages-in-slsb-and-jax-ws
	public static class MyJaxbContext implements JAXBContextFactory
	{
		@Override
		public JAXBRIContext createJAXBContext(SEIModel sei,
			List<Class> classesToBind, List<TypeReference> typeReferences)
			throws JAXBException
		{
			List<Class> classList = new ArrayList<Class>();
			classList.addAll(classesToBind);
			classList.add(ReferencedPoliciesType.class);

			List<TypeReference> refList = new ArrayList<TypeReference>();
			refList.addAll(typeReferences);
			refList.add(new TypeReference(
				new QName("urn:oasis:names:tc:xacml:2.0:profile:saml2.0:v2:schema:assertion:wd-13", "ReferencedPoliciesType"),
				XACMLAuthzDecisionQueryType.class));

			return JAXBRIContext.newInstance(classList.toArray(new Class[classList.size()]),
				refList, null, sei.getTargetNamespace(), false, null);
		}
	}
}
Comment 4 BradCox 2011-06-13 23:22:52 UTC
Tried adding jaxws-api-2.2.3.jar and jaxws-rt-2.2.3.jar to glassfish/lib/endorsed. 

No change. I'm flat out of bright ideas. Could I use one of yours please? ;)

NetBeans: Deploying on GlassFish Server 3.x
    profile mode: false
    debug mode: true
    force redeploy: true
In-place deployment at /Users/Brad/HgClones/pbac-pdp/AttributeService/AttributeService-Svc/target/AttributeService-Svc
Initializing...
deploy?DEFAULT=/Users/Brad/HgClones/pbac-pdp/AttributeService/AttributeService-Svc/target/AttributeService-Svc&name=Technica-PBAC_AttributeService-Svc_war_1.0-SNAPSHOT&force=true failed on GlassFish Server 3.x 
 Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: Servlet web service endpoint '' failure. Please see server.log for more details.
The module has not been deployed.
	at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:210)
	at org.netbeans.modules.maven.j2ee.ExecutionChecker.performDeploy(ExecutionChecker.java:173)
	at org.netbeans.modules.maven.j2ee.ExecutionChecker.executionResult(ExecutionChecker.java:125)
	at org.netbeans.modules.maven.execute.MavenCommandLineExecutor.run(MavenCommandLineExecutor.java:202)
	at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
Comment 5 BradCox 2011-06-13 23:52:22 UTC
Created attachment 108881 [details]
Glassfish log
Comment 6 BradCox 2011-06-13 23:52:47 UTC
I've updated this service with all known bright ideas and attached the working copy. 

The console log follows. The glassfish log is attached. 

This attempt was with NB 7 release build, not the nightly build.

------------------------------------------------------------------------
Building AttributeService-Svc 1.0-SNAPSHOT
------------------------------------------------------------------------
The POM for axis2:axis2:jar:1.0 is missing, no dependency information available

[incremental-build-plugin:incremental-build]
Verifying module descriptor ...
Verifying parent modules...
Verifying resources...
Verifying sources...

[dependency:copy]

[resources:resources]
Using 'UTF-8' encoding to copy filtered resources.
Copying 1 resource

[compiler:compile]
Nothing to compile - all classes are up to date

[resources:testResources]
Using 'UTF-8' encoding to copy filtered resources.
Copying 2 resources

[compiler:testCompile]
Compiling 3 source files to /Users/Brad/HgClones/pbac-pdp/AttributeService/AttributeService-Svc/target/test-classes

[surefire:test]
Tests are skipped.

[war:war]
Packaging webapp
Assembling webapp [AttributeService-Svc] in [/Users/Brad/HgClones/pbac-pdp/AttributeService/AttributeService-Svc/target/AttributeService-Svc]
Processing war project
Copying webapp resources [/Users/Brad/HgClones/pbac-pdp/AttributeService/AttributeService-Svc/src/main/webapp]
Webapp assembled in [782 msecs]
Building war: /Users/Brad/HgClones/pbac-pdp/AttributeService/AttributeService-Svc/target/AttributeService-Svc.war
WEB-INF/web.xml already added, skipping
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 7.349s
Finished at: Mon Jun 13 19:47:38 EDT 2011
Final Memory: 12M/81M
------------------------------------------------------------------------
NetBeans: Deploying on GlassFish Server 3.x
    profile mode: false
    debug mode: true
    force redeploy: true
In-place deployment at /Users/Brad/HgClones/pbac-pdp/AttributeService/AttributeService-Svc/target/AttributeService-Svc
Initializing...
deploy?DEFAULT=/Users/Brad/HgClones/pbac-pdp/AttributeService/AttributeService-Svc/target/AttributeService-Svc&name=Technica-PBAC_AttributeService-Svc_war_1.0-SNAPSHOT&force=true failed on GlassFish Server 3.x 
 Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: Servlet web service endpoint '' failure. Please see server.log for more details.
The module has not been deployed.
	at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:210)
	at org.netbeans.modules.maven.j2ee.ExecutionChecker.performDeploy(ExecutionChecker.java:173)
	at org.netbeans.modules.maven.j2ee.ExecutionChecker.executionResult(ExecutionChecker.java:125)
	at org.netbeans.modules.maven.execute.MavenCommandLineExecutor.run(MavenCommandLineExecutor.java:202)
	at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
Comment 7 BradCox 2011-06-13 23:52:54 UTC
Created attachment 108882 [details]
Glassfish log
Comment 8 David Konecny 2011-06-13 23:53:31 UTC
Sorry I have no idea - it is not a NetBeans specific error but rather server runtime issue. Ask on GlassFish mailing/bugzilla.
Comment 9 BradCox 2011-06-13 23:58:01 UTC
Doesn't look like the source folder made it. Attaching again.

WTF does "mid-air collision" mean? Does it want a zip?
Comment 10 BradCox 2011-06-13 23:58:08 UTC
Created attachment 108883 [details]
Source folder zipped
Comment 11 BradCox 2011-06-14 00:30:05 UTC
Just updated GF to include all latest development versions. No improvement:

NetBeans: Deploying on GlassFish Server 3.x
    profile mode: false
    debug mode: true
    force redeploy: true
In-place deployment at /Users/Brad/HgClones/pbac-pdp/AttributeService/AttributeService-Svc/target/AttributeService-Svc
Initializing...
deploy?DEFAULT=/Users/Brad/HgClones/pbac-pdp/AttributeService/AttributeService-Svc/target/AttributeService-Svc&name=Technica-PBAC_AttributeService-Svc_war_1.0-SNAPSHOT&force=true failed on GlassFish Server 3.x 
 Error occurred during deployment: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: Servlet web service endpoint '' failure. Please see server.log for more details.
The module has not been deployed.
	at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:210)
	at org.netbeans.modules.maven.j2ee.ExecutionChecker.performDeploy(ExecutionChecker.java:173)
	at org.netbeans.modules.maven.j2ee.ExecutionChecker.executionResult(ExecutionChecker.java:125)
Comment 12 BradCox 2011-06-14 21:50:03 UTC
Changed status to REOPENED from RESOLVED. WTF??
Comment 13 David Konecny 2011-06-14 23:40:36 UTC
See my comment #8 - that's the one which caused you mid-air collision and also the one in which I closed this issue.
Comment 14 David Konecny 2011-06-15 01:38:30 UTC
Closing as INVALID again. Or please explain why you think NetBeans is at fault here. As I said earlier I have no idea/experience with this particular error otherwise I would be happy to help.
Comment 15 BradCox 2011-06-15 10:06:40 UTC
Because GF is bundled with NB and the problem is triggered by NB wizards. If the problem is elsewhere, don't just close the report and walk away without even a pointer to someone that can help.
Comment 16 David Konecny 2011-06-16 08:10:11 UTC
(In reply to comment #15)
> If the problem is elsewhere, don't just close the report and walk away without
> even a pointer to someone that can help.

Try http://glassfish.java.net/ - they have their own bugzilla and user forums. Might be better to post question on user forums as it is not clear whether problem is in the server or in the code or ....