No resource found in web application using JSF - jsf

I started my first application using JSF, but i just can't manage to make my web application find my external resources(like index.xhtml). And I do not know why
-webapp
-- WEB-INF
--- web.xml
-- index.xhml
In web.xml I have the following line:
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
But i always get a 404 the index.xhtml was not found.
Edit1: the issue was due to the fact that resulting war was not having resources like index.xhtml. Now when compiling, the war file contains everything inside the webapp folder. However I am unable to deploy to wildfly...
ERROR [org.jboss.as.controller.management-operation] (DeploymentScanner-threads - 1) WFLYCTL0013: Operation ("full-replace-deployment") failed - address: ([]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"lab4.war\".undertow-deployment" => "java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! null
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! null
Caused by: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! null
Caused by: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! null
Caused by: java.lang.NullPointerException"}}
any idea why?

I'd prefer to comment, but do not yet have enough points.
It's difficult to say what's causing the WFLYCTL0013 error, but I recommend reviewing the stack trace for the java.lang.NullPointerException. Perhaps it's happening out of your application code?

Ok, problem solved. The issue was that I was missing a dependency. Thanks

Related

Catastrophic initialization failure! Shutting down null WAB due to: null // NPE # WabBundleProcessor.initContext(WabBundleProcessor.java:460)

when I deploy a maven module spring mvc portlet Liferay7.3 ga1 in the Lr7 portal, I got this error can anyone support please !
Is there something missing?
This is the stack trace:
2020-02-28 14:41:14.570 ERROR [fileinstall-/usr/share/portail/liferay-ce-portal-7.3.0-ga1/osgi/war][WabBundleProcessor:244] Catastrophic initialization failure! Shutting down null WAB due to: null
java.lang.NullPointerException
at com.liferay.portal.osgi.web.wab.extender.internal.WabBundleProcessor.initContext(WabBundleProcessor.java:463)
at com.liferay.portal.osgi.web.wab.extender.internal.WabBundleProcessor.init(WabBundleProcessor.java:140)
at com.liferay.portal.osgi.web.wab.extender.internal.WebBundleDeployer._initWabBundle(WebBundleDeployer.java:159)
at com.liferay.portal.osgi.web.wab.extender.internal.WebBundleDeployer.doStart(WebBundleDeployer.java:88)
at com.liferay.portal.osgi.web.wab.extender.internal.WabFactory$WABExtension.start(WabFactory.java:113)
2020-02-28 14:41:14.572 ERROR [Framework Event Dispatcher: Equinox Container: 4c0cd32f-6426-4a62-bb58-24614ae72cc6][Framework:93] FrameworkEvent ERROR
org.osgi.framework.ServiceException: Exception in com.liferay.portal.osgi.web.servlet.context.helper.internal.ServletContextHelperRegistrationServiceFactory.getService()
at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:222)
at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111)
...
Caused by: java.lang.ExceptionInInitializerError
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
Any support is appreciated, thanks!!
I had the same problem with Liferay 7.1.
As for my case, it was a maven dependency that was missing when the war was built.
So i'm guessing there is something you are doing wrong before deploy.
Maybe this link will help you : Liferay forum
Regards.

Scriptella: ResourceException with Jaybird

I'm very newbie with Linux/Java/Scriptella and I'm trying a jdbc connection with scriptella on a Firebird local database, but I'm receiving the following errors:
2-dic-2013 1.03.34 <INFO> Execution Progress.Initializing properties: 1%
2-dic-2013 1.03.34 <GRAVE> Script /home/maurizio/Scrivania/JATROPHA/applicazioni/prova_per_scriptella.etl execution failed.
javax/resource/ResourceException
2-dic-2013 1.03.34 <GRAVE> Scriptella bug report. Submit to issue tracker.
Scriptella version: 1.1
Exception:
scriptella.execution.EtlExecutorException: javax/resource/ResourceException
at scriptella.execution.EtlExecutor.execute(EtlExecutor.java:190)
at scriptella.tools.launcher.EtlLauncher.execute(EtlLauncher.java:276)
at scriptella.tools.launcher.EtlLauncher.launch(EtlLauncher.java:193)
at scriptella.tools.launcher.EtlLauncher.main(EtlLauncher.java:321)
Caused by: java.lang.NoClassDefFoundError: javax/resource/ResourceException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:270)
at scriptella.core.DriverFactory.getDriver(DriverFactory.java:53)
at scriptella.core.ConnectionManager.<init>(ConnectionManager.java:70)
at scriptella.core.Session.<init>(Session.java:51)
at scriptella.execution.EtlExecutor.prepare(EtlExecutor.java:248)
at scriptella.execution.EtlExecutor.execute(EtlExecutor.java:178)
... 3 more
Caused by: java.lang.ClassNotFoundException: javax.resource.ResourceException
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:323)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:268)
... 10 more
I'm using Ubuntu 10.04 Lucid Lynx.
I start scriptella via console in directory /home/maurizio/Scrivania/JATROPHA/applicazioni/ with the command scriptella/scriptella-1.1/bin/scriptella.sh -debug "prova_per_scriptella.etl"
My ETL file prova_per_scriptella.etl contains the following rows:
<!DOCTYPE etl SYSTEM "http://scriptella.javaforge.com/dtd/etl.dtd">
<etl>
<description>Prova connessione Firebird</description>
<connection
id="fb_destination"
driver="org.firebirdsql.jdbc.FBDriver"
url="jdbc:firebirdsql:localhost/3050:/home/maurizio/Scrivania/JATROPHA/db/jatrofa.fdb"
user="user"
password="password"
classpath="/home/maurizio/Scrivania/JATROPHA/applicazioni/jaybird/Jaybird-2.2.3JDK_1.6/jaybird-2.2.3.jar"
/>
</etl>
The env var $_SCRIPTELLA_CP of batch command scriptella/scriptella-1.1/bin/scriptella.sh results in
:/home/maurizio/Scrivania/JATROPHA/applicazioni/scriptella/scriptella-1.1/lib/commons-jexl.jar:
/home/maurizio/Scrivania/JATROPHA/applicazioni/scriptella/scriptella-1.1/lib/commons-logging.jar:
/home/maurizio/Scrivania/JATROPHA/applicazioni/scriptella/scriptella-1.1/lib/jaybird-2.2.3.jar:
/home/maurizio/Scrivania/JATROPHA/applicazioni/scriptella/scriptella-1.1/lib/jsqlparser-0.8.0.jar:
/home/maurizio/Scrivania/JATROPHA/applicazioni/scriptella/scriptella-1.1/lib/scriptella-core.jar:
/home/maurizio/Scrivania/JATROPHA/applicazioni/scriptella/scriptella-1.1/lib/scriptella-drivers.jar:
/home/maurizio/Scrivania/JATROPHA/applicazioni/scriptella/scriptella-1.1/lib/scriptella-tools.jar:
/home/maurizio/Scrivania/JATROPHA/applicazioni/scriptella/scriptella-1.1/lib/sqlsheet-6.5.jar
Any help would be very appreciated.
Thanks in advance.
You are missing the required dependency connector-api-1.5.jar, or you need to use jaybird-full-2.2.3.jar (which includes both the normal Jaybird and connector-api). See the releasenotes of Jaybird 2.2.3
The error means that you probably miss additional J2EE classes on classpath. Try downloading mini-j2ee.jar from http://www.firebirdsql.org/en/jdbc-driver/ and adding it to classpath attribute in etl.xml:
classpath="/path/to/mini-j2ee.jar:/home/maurizio/Scrivania/JATROPHA/applicazioni/jaybird/Jaybird-2.2.3JDK_1.6/jaybird-2.2.3.jar"

java.lang.IllegalStateException: WEB9031: WebappClassLoader unable to load resource [org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl]

I got this error from GlassFish while (re)deploying an application:
com.sun.faces.config.ConfigurationException:
java.util.concurrent.ExecutionException:
org.apache.xerces.impl.dv.ObjectFactory$ConfigurationError: Provider org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl could not be instantiated:
java.lang.IllegalStateException: WEB9031: WebappClassLoader unable to load resource [org.apache.xerces.impl.dv.dtd.DTDDVFactoryImpl], because it has not yet been started, or was already stopped
I stopped GlassFish, clean and build the application, deployed the application and this was the result.
Weird, I had to undeploy an other project what had a xercesImpl.jar as library and the application I was trying to deploy, deployed without even a warning...
Apparently GlassFish has it's own XML-parser and it conflicts when it detects other XML-parsers.

Adding RICHFACES to existing JSF2 project

I'm trying add richfaces to my JSF 2 project using this jboss guide. I've did what they say in point 2.6, but after restart my tomcat server, HTTP Status 404 is reported.
Have I missed something??
UPDATE:
When I add richfaces-components-ui-4.0.0.Final.jar and richfaces-core-impl-4.0.0.Final.jar, and restart the tomcat server, it reports:
INFO: Unsanitized stacktrace from failed start...
com.sun.faces.config.ConfigurationException:
Source Document: jar:file:/D:/WORKSPACE/BC/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/PORTAL/WEB-INF/lib/richfaces-core-impl-4.0.0.Final.jar!/META-INF/faces-config.xml
Cause: Unable to create a new instance of 'org.richfaces.resource.ResourceHandlerImpl': java.lang.reflect.InvocationTargetException
at com.sun.faces.config.processor.AbstractConfigProcessor.createInstance(AbstractConfigProcessor.java:293)
....
13.5.2011 8:41:52 com.sun.faces.config.ConfigureListener contextInitialized
SEVERE: Critical error during deployment:
com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! com.google.common.base.Function
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:379)
....
13.5.2011 8:41:52 org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! com.google.common.base.Function
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:292)
....
13.5.2011 8:41:52 org.apache.catalina.core.StandardContext startInternal
SEVERE: Error listenerStart
13.5.2011 8:41:52 org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/PORTAL] startup failed due to previous errors
13.5.2011 8:41:52 com.sun.faces.config.ConfigureListener contextDestroyed
SEVERE: Unexpected exception when attempting to tear down the Mojarra runtime
java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory
at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:894)
....
And now I'm not sure which libraries are neccessary for JSF2 and which for RICHFACES..
According to readme.txt of RichFaces 4 the following JARs are required:
In addition to the RichFaces jars, a number of dependencies are required in order to properly configure the framework.
a. sac-1.3, cssparser-0.9.5 - required for components CSS work.
b. google-guava-r08 - core runtime dependency.
c. annotations.jar - from org.richfaces.cdk.
It's optional and only needs to be added if RichFaces components will be created/accessed dynamically in your apps actions/listeners.
d. validation-api.jar and any implementation like hibernate-validators.jar
It's optional and should be added if you using Client or Graph
Validation. Should be added only if it's not provided by a
server (Java EE 6 servers).
Your exception suggests that you don't have the Google Guava library.

java.lang.NoClassDefFoundError: org/ajax4jsf/resource/InternetResourceBuilder

My application, which uses JSF 2 and Richfaces 3.3.3, and mojarra 2.0.2 works fine on Glassfish 3.1 , but whenever i port it on Tomcat 7.0.10, every time i get one or the other problem.
It started with failure to detect jsf_core.tld , followed by some JSF rendering issue and finally this one.
Lastly i found some which i m mentioning here and which i cannot find a way around to fix.
Mar 31, 2011 8:57:52 PM org.apache.catalina.core.StandardContext listenerStart
SEVERE: Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener
java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! org/ajax4jsf/resource/InternetResourceBuilder
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:294)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4651)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5154)
at org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5149)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! org/ajax4jsf/resource/InternetResourceBuilder
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:357)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:226)
... 8 more
Caused by: java.lang.NoClassDefFoundError: org/ajax4jsf/resource/InternetResourceBuilder
at org.ajax4jsf.renderkit.ChameleonRenderKitFactory.<init>(ChameleonRenderKitFactory.java:62)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:586)
at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:472)
at javax.faces.FactoryFinder.access$400(FactoryFinder.java:139)
at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:796)
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306)
at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:294)
at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:213)
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:338)
... 9 more
You've the RichFaces impl JAR file, but not the RichFaces API JAR in the runtime classpath.
The stacktrace is evidence of this:
Caused by: java.lang.NoClassDefFoundError: org/ajax4jsf/resource/InternetResourceBuilder
at org.ajax4jsf.renderkit.ChameleonRenderKitFactory.<init>(ChameleonRenderKitFactory.java:62)
The at org.ajax4jsf.renderkit.ChameleonRenderKitFactory line indicates that this particular class was successfully loaded and executed (otherwise it wouldn't have shown up as an at xxx in the stacktrace at all). This class is part of RichFaces impl JAR file. The InternetResourceBuilder is in turn part of the RichFaces API JAR file. This is apparently missing in the runtime classpath. At least, that's just exactly what the exception is telling us.
From the exception it seems that Richfaces cannot be found. Put the jar in your classpath (for Tomcat WEB-INF/lib or WEB-INF/classes) and try again.

Resources