How to set elementFormDefault when publising a javax.jws.WebService in JBoss EAP 7 - xsd

I've just switched my webapp from Weblogic 10.3.6 to JBoss EAP 7.3 and it tourns out that when asking for wsdl once the app is deployed the wsdl is generated with elementFormDefault="unqualified" :
xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://business.fornitori.infogroup.it/"
elementFormDefault="unqualified"
targetNamespace="http://business.fornitori.infogroup.it/"
version="1.0">
where the same WS deployed on WebLogic doesn't appear.
This cause the error at runtime :
SEVERE [com.sun.xml.messaging.saaj.soap.impl] (default task-7) SAAJ0131: HeaderElements must be namespace qualified
does any one runned into this error and knows how to solve it ?
I've tryied switching from Jaxws-rt 2.1.7 to Jaxws-rt 2.2.8 but didn't sole the problem

Related

JSF faces flow throws the error "Flow already exists"

My environment:
JSF 2.3, Mojarra 2.3.9.payara-p2
PrimeFaces 7.0
Payara 5.192
OmniFaces 3.3
Project Java EE 8 Maven
NetBeans 11.1
I have created a Faces flow:
folder "flotTransfer" containing only 2 files (for the moment) flotTransfert-flow.xml and flotTransfert.xhtml.
I can't deploy the application. I receive this message:
"
Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: java.lang.RuntimeException: java.lang.IllegalStateException: Flow with id "flotTransfert" and definingDocumentId "" already exists.|#]
".
I don't understand why I get this error (why "already exists"?). No other application deployed on the server.
The content of flotTransfert-flow.xml:
<faces-config version="2.3"
xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-facesconfig_2_3.xsd">
<flow-definition id="flotTransfert">
<flow-return id="sortieFlot">
<from-outcome>/listeComptes</from-outcome>
</flow-return>
</flow-definition>
</faces-config>
If I rename this file, no more error and the application is deployed on the server but, obviously, the faces flow does not work.
If I keep the file but remove all the content of the file (I comment out all the lines), I get the same error.
I have almost the same faces flow (just more pages in the folder) in another application but with Java EE 7 and Payara 5.184 and without OmniFaces and the flow works.
Sorry, I made a mistake: I added the file flotTransfert-flow.xml with a wizard of my IDE and I didn't notice that this wizard added a <context-param> in the file web.xml, referencing the definition file of the flow. If I remove this <context-param>, all is working.
The lines I removed from web.xml:
<context-param>
<param-name>javax.faces.CONFIG_FILES</param-name>
<param-value>/flotTransfert/flotTransfert-flow.xml</param-value>
</context-param>

OmniFaces complains about missing CDI and empty beans.xml

I like to add omnifaces to my tomcat8 webapp but omnifaces seems to complain either about a missing CDI implementation or about not being able to parse beans.xml (some SAXParserException). Currently I have the following libraries under WEB-INF/lib:
BootsFaces-OSP-0.8.1-dist-default.jar
cdi-api-1.2.jar
javax.el-api-3.0.1-b04.jar
javax.inject-1.jar
javax.interceptor-api-1.2.jar
jsf-api-2.2.11.jar
jsf-impl-2.2.11.jar
jstl-1.2.jar
omnifaces-2.2.jar
primefaces-5.3.jar
weld-core-2.3.3.Final.jar
weld-servlet-2.3.3.Final.jar
weld-servlet-core-2.3.3.Final.jar
Currently I have two issues with this setup:
a real emtpy beans.xml leads to the "nope, please install CDI" error
the following "empty" beans.xml leads to a "cannot parse beans.xml" error
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org /xml/ns/javaee/beans_1_2.xsd"
bean-discovery-mode="annotated"></beans>
The documentation how to install CDI is from 2013 which is kind of outdated in my eyes.
What is wrong or missing in my setup and where to read on how to get omnifaces running in tomcat8?

Is it possible to deploy JSF-Web-Apps in WSO2 AS 5.2?

I tried the following steps:
At first I installed the feature "WSO2 Carbon - J2EE Runtime Environment" in the AS. Then I created a new dynamic web project in Eclipse with Servlet Module 2.5 and a configuration for JSF 1.2 using Myfaces 1.2.9 and a JSF-HTML-Template. After I had written "hello" in the view, I tested it with "run on server" in Eclipse and it runs. Then I created a WAR-File and deployed it in the AS with pasting the file in "asroot/repository/deployment/server/webapps".
Then I tried the page and it throws this error:
"/NewFile.jsp(2,57) PWC6188: The absolute uri: http://java.sun.com/jsf/core cannot be resolved in either web.xml or the jar files deployed with this application
Caused by:
org.apache.jasper.JasperException - /NewFile.jsp(2,57) PWC6188: The absolute uri: http://java.sun.com/jsf/core cannot be resolved in either web.xml or the jar files deployed with this application"
I tried it also on a local Tomcat-Server with the same result like in Eclipse.
The libs in the WAR are:
javax.servlet.jsp.jstl-1.2.1.jar
javax.servlet.jsp.jstl-api-1.2.1.jar
commons-beanutils-1.7.0.jar
commons-codec-1.3.jar
commons-collections-3.2.jar
commons-digester-1.8.jar
commons-discovery-0.4.jar
commons-logging-1.1.1.jar
myfaces-api-1.2.9.jar
myfaces-impl-1.2.9.jar
This could be a classloading issue. Please put webapp-classloading.xml file in META-INF directory of your web application with following configurations
<?xml version="1.0" encoding="ISO-8859-1"?>
<Classloading xmlns="http://wso2.org/projects/as/classloading">
<Environments>Tomcat</Environments>
</Classloading>
Refer http://docs.wso2.org/display/AS520/Webapp+ClassLoading

JSF how upgrade to Mojarra 2.1.21 in Netbeans7.1 (just sub jsf-api.jar and jsf-impl.jar fails)

I want to upgrade from JSF implementation Mojarra 2.1.3 in Netbeans7.1 (Glassfish 3.1.1).
You might ask first why I don't just upgrade to Netbeans7.3, and the reasons include that it it runs Glassfish 3.1.2.2 and that I have some other 3rd party software in my web application that is not yet compatible with Glassfish higher than 3.1.1, and besides it only has Mojarra 2.1.6 anyway.
I used to be able to upgrade Mojarra by simply replacing jsf-api.jar and jsf-impl.jar under /glassfish/modules, but that does not work with:
https://maven.java.net/content/repositories/releases/com/sun/faces/jsf-api/2.1.21/jsf-api-2.1.21.jar
https://maven.java.net/content/repositories/releases/com/sun/faces/jsf-impl/2.1.21/jsf-impl-2.1.21.jar
I get the following error:
SEVERE: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain.main(GlassFishMain.java:97)
at com.sun.enterprise.glassfish.bootstrap.ASMain.main(ASMain.java:55)
Caused by: com.sun.enterprise.module.ResolveError: Failed to start Bundle Id [301] State [INSTALLED] [org.glassfish.web.weld-integration(Weld integration for glassfish):3.1.1]
at org.jvnet.hk2.osgiadapter.OSGiModuleImpl.start(OSGiModuleImpl.java:177)
at org.jvnet.hk2.osgiadapter.OSGiModuleImpl$2$1$1.loadClass(OSGiModuleImpl.java:344)
at com.sun.hk2.component.LazyInhabitant.loadClass(LazyInhabitant.java:124)
at com.sun.hk2.component.LazyInhabitant.fetch(LazyInhabitant.java:111)
at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:135)
at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
at org.jvnet.hk2.component.Habitat$5.get(Habitat.java:701)
at java.util.AbstractList$Itr.next(AbstractList.java:345)
at java.util.AbstractCollection.toArray(AbstractCollection.java:124)
at java.util.ArrayList.addAll(ArrayList.java:472)
at com.sun.enterprise.v3.server.SnifferManagerImpl.getSniffers(SnifferManagerImpl.java:92)
at com.sun.enterprise.v3.server.SnifferManagerImpl.getSniffer(SnifferManagerImpl.java:120)
at com.sun.enterprise.v3.server.ApplicationLifecycle.getSniffersFromApp(ApplicationLifecycle.java:2140)
at com.sun.enterprise.v3.server.ApplicationLoaderService.processApplication(ApplicationLoaderService.java:375)
at com.sun.enterprise.v3.server.ApplicationLoaderService.postConstruct(ApplicationLoaderService.java:219)
at com.sun.hk2.component.AbstractCreatorImpl.inject(AbstractCreatorImpl.java:131)
at com.sun.hk2.component.ConstructorCreator.initialize(ConstructorCreator.java:91)
at com.sun.hk2.component.AbstractCreatorImpl.get(AbstractCreatorImpl.java:82)
at com.sun.hk2.component.SingletonInhabitant.get(SingletonInhabitant.java:67)
at com.sun.hk2.component.EventPublishingInhabitant.get(EventPublishingInhabitant.java:139)
at com.sun.hk2.component.AbstractInhabitantImpl.get(AbstractInhabitantImpl.java:76)
at com.sun.enterprise.v3.server.AppServerStartup.run(AppServerStartup.java:253)
at com.sun.enterprise.v3.server.AppServerStartup.doStart(AppServerStartup.java:145)
at com.sun.enterprise.v3.server.AppServerStartup.start(AppServerStartup.java:136)
at com.sun.enterprise.glassfish.bootstrap.GlassFishImpl.start(GlassFishImpl.java:79)
at com.sun.enterprise.glassfish.bootstrap.GlassFishDecorator.start(GlassFishDecorator.java:63)
at com.sun.enterprise.glassfish.bootstrap.osgi.OSGiGlassFishImpl.start(OSGiGlassFishImpl.java:69)
at com.sun.enterprise.glassfish.bootstrap.GlassFishMain$Launcher.launch(GlassFishMain.java:117)
... 6 more
Caused by: org.osgi.framework.BundleException: Unresolved constraint in bundle org.glassfish.web.weld-integration [301]: Unable to resolve 301.0: missing requirement [301.0] package; (&(package=com.sun.faces.spi)(version>=2.1.0)) [caused by: Unable to resolve 213.1: missing requirement [213.1] package; (package=javax.faces) [caused by: Unable to resolve 211.1: missing requirement [211.1] package; (&(package=javax.el)(version>=2.2.1))]]
at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3443)
at org.apache.felix.framework.Felix.startBundle(Felix.java:1727)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:922)
at org.jvnet.hk2.osgiadapter.OSGiModuleImpl.start(OSGiModuleImpl.java:169)
I tried web app specific JSF but that also fails:
glassfish change default jsf impl
Added to web.xml:
<class-loader delegate="false" />
<property name="useBundledJsf" value="true" />
I get the error:
Error occurred during deployment: Exception while loading the app :
java.lang.IllegalStateException: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: java.lang.RuntimeException:
com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED!
org.glassfish.weld.jsf.WeldFacesConfigProvider cannot be cast to
com.sun.faces.spi.ConfigurationResourceProvider. Please see server.log for more details.
Grateful for suggestions.
Try following steps
Download jsf 2.1.21 jar from here
Rename it to javax.faces.jar .
Take backup of javax.faces.jar available at docroot\glassfish\modules
Paste and replace the old javax.faces.jar with downloaded javax.faces.jar available at docroot\glassfish\modules
Delete the osgi cache glassfish3\glassfish\osgi for the changes to
take effect
OK I finally have 2 workarounds (only) for getting Mojarra-2.1.21 running with Netbeans7.1.
Firstly, the following recommended approach does not as far as I can tell work in Netbeans7.1, it stubbornly refuses to recognise the server installed javax.faces.jar.
From https://weblogs.java.net/blog/edburns/archive/2011/09/26/try-out-mojarra-220-snapshot?force=714:
Once you download the javax.faces.jar, you must take some steps to install it in GlassFish 3.1 or 3.1.1.
Remove jsf-api.jar and jsf-impl.jar from the modules directory.
Put javax.faces.jar in the modules directory.
You must modify the default-web.xml file in domains/domain1/config and lib/templates. In
each directory, remove any mention of jsf-api.jar and jsf-impl.jar from the default.web.xml file.
In place of the two jars, add a reference to javax.faces.jar.
No matter what I do with Netbeans7.1 (and no matter whether clear osgi-cache and netbeans cache or whether remove then re-add server in Netbeans7.1 or how many times I restart glassfish3.1.1 and/or netbeans7.1), Netbeans7.1 will NOT see javax.faces.jar.
If you try to add the javax.faces.jar (only) to your web app libs and use this in glassfish-web.xml to for it to use web-app specific JSF, it will prevent import errors in your Netbeans7.1 project, but it still will not run:
<class-loader delegate="false" />
<property name="useBundledJsf" value="true" />
I get this error:
Error occurred during deployment: Exception while loading the app :
java.lang.IllegalStateException: ContainerBase.addChild: start:
org.apache.catalina.LifecycleException: java.lang.RuntimeException:
com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED!
org.glassfish.weld.jsf.WeldFacesConfigProvider cannot be cast to
com.sun.faces.spi.ConfigurationResourceProvider.
The reason is described here: http://java.dzone.com/articles/upgrading-latest-mojarra
The issue seems to be that there are two versions of
ConfigurationResourceProvider on the class path: one at the web app
level (your bundled jar file) and a second at the parent class loader
level (provided by GlassFish). WeldFacesConfigProvider extends
ConfigurationResourceProvider at the parent class loader, but it ends
up casting this to ConfigurationResourceProvider at the web app class
loader. ...
Workaround: Adding the missing dependency to your app If you can't cast across class loaders you have to make the missing part available
to the right class-loader. Not replacing the javax.faces.jar in your
server's modules leads to adding the magic WeldFacesConfigProvider to
your app. It is contained in the
glassfish3\glassfish\modules\weld-integration.jar and by simply
putting that as an additional library to your application you also
solve the issue.
You now have 2 workaround choices:
Include the weld-integration.jar in your web app libs, and run with web app JSF settings in glassfish-web.xml.
Dirty trick: With .../glassfish/modules/javax.faces.jar still in place and also in your web app libs, disable or uncomment the bit in your glassfish-web.xml. It will then run with the server javax.faces.jar (and will see /modules/weld-integration.jar), and Netbeans will see the web app specific lib for imports.
This is unsatisfactory, I don't consider the question fully answered.
Q: How can one run JSF Mojarra 2.1.21 as Glassfish3.1.1 server JSF libs in NetBeans7.1 ?
And again, the reason I can't just upgrade Netbeans+Glassfish is that I have multiple problems with ObjectDB with versions of Glassfish above 3.1.1, which is why I am so adamant about installing JSF Mojarra 2.1.21 on Netbeans7.1+Glassfish3.1.1.
Grateful for any further suggestions.

Problem with Weblogic Upgrade

I'm currently in the process of upgrading my WebLogic version from 10.0 to 10.3.3.
I did manage to successfully create a new 10.3 domain, but when I try to start it, I get the following error:
<Critical> <WebLogicServer> <BEA-000362> <Server failed. Reason:
[Management:141266]Parsing Failure in config.xml: failed to load java
type corresponding to e=domain#http://xmlns.oracle.com/weblogic/domain>
Regardless to say, the server doesn't start.
I looked at my config.xml file and it looks harmless, the first few lines of it are as follows:
<?xml version="1.0" encoding="UTF-8"?>
<domain xsi:schemaLocation="http://xmlns.oracle.com/weblogic/security/wls http://xmlns.oracle.com/weblogic/security/wls/1.0/wls.xsd http://xmlns.oracle.com/weblogic/domain http://xmlns.oracle.com/weblogic/1.0/domain.xsd http://xmlns.oracle.com/weblogic/security http://xmlns.oracle.com/weblogic/1.0/security.xsd http://xmlns.oracle.com/weblogic/security/xacml http://xmlns.oracle.com/weblogic/security/xacml/1.0/xacml.xsd" xmlns="http://xmlns.oracle.com/weblogic/domain" xmlns:sec="http://xmlns.oracle.com/weblogic/security" xmlns:wls="http://xmlns.oracle.com/weblogic/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
There is a namespace entry for the namespace given in the error message (default namespace - xmlns), but I don't have a clue why the config file can't be parsed.
Thanks in Advance
A similar issue here turned out to be a permissions problem for the user starting weblogic.
Have you installed the new Weblogic server instance with a different user id? Can you check permissions?

Resources