gvNIX: Error installing datatables - gvnix

I was working with gvNIX after installing jQuery and everything worked fine. But, when I installed the datatables web mvc datatables setup and the app was compiled, the web crashed and the server shown this error:
2015-05-25 12:47:34,583 [localhost-startStop-1] ERROR org.springframework.web.context.ContextLoader - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in file [/home/vicente/Documentos/sts-bundle/pivotal-tc-server-developer-3.1.0.RELEASE/base-instance/wtpwebapps/FitTrainning_WebService/WEB-INF/classes/META-INF/spring/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index;
Caused by: java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index;

Are you deploying on a JBoss? There is a problem due JPA API version (JBoss includes 2.0 but gvNIX requires 2.1).
Take a look this issue on JBoss Jira for a workaround.
Good luck!

Related

Howto simply setup an J2EE Project with JSF capability in IntelliJ

I have setup a new Project by selecting J2EE and JSF and let IntelliJ create the project.
IntelliJ also create a Glassfish server for me.
I didn't change any code so far.
When starting the server I get the following Error:
Error during artifact deployment. See server log for details.
Glassfish's log output is:
Critical error during deployment:
javax.faces.FacesException: Unable to find CDI BeanManager
at com.sun.faces.el.ELUtils.tryAddCDIELResolver(ELUtils.java:312)
at com.sun.faces.el.ELUtils.buildFacesResolver(ELUtils.java:242)
at com.sun.faces.application.ApplicationAssociate.initializeELResolverChains(ApplicationAssociate.java:499)
at com.sun.faces.application.ApplicationImpl.performOneTimeELInitialization(ApplicationImpl.java:1404)
at com.sun.faces.application.ApplicationImpl.getELResolver(ApplicationImpl.java:526)
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:256)
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:5043)
at com.sun.enterprise.web.WebModule.contextListenerStart(WebModule.java:592)
Whats wrong here, or how can I simply setup such a project ?

Websphere 8.5 - ArrayIndexOutofBoundsException while starting application

I've managed to deploy a simple Web application to Websphere 8.5, but unable to start it. It throws an ArrayIndexOutofBoundsException while starting my application.
We have been using Tomcat7 so far for our web app. It's a simple web-app with JSPs, JSs and Servlets.
I've tried a lot of options to deploy the application on Websphere, but the latest hurdle i'm facing is the ArrayIndexOutofBoundsException.
I tried to deploy the same application (a mini version) which contained only one servlet, and it was successful. But when I have multiple servlets, I get this exception. Below is my stack trace
[8/12/14 12:15:55:463 IST] 00000046 BeansDeployer E BeansDeployer deploy
java.lang.RuntimeException: java.lang.ArrayIndexOutOfBoundsException
at org.apache.webbeans.portable.AnnotatedElementFactory.newAnnotatedType(AnnotatedElementFactory.java:150)
at org.apache.webbeans.config.BeansDeployer.deployFromClassPath(BeansDeployer.java:484)
at org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:171)
at org.apache.webbeans.lifecycle.AbstractLifeCycle.startApplication(AbstractLifeCycle.java:124)
at org.apache.webbeans.web.lifecycle.WebContainerLifecycle.startApplication(WebContainerLifecycle.java:78)
at com.ibm.ws.webbeans.common.CommonLifeCycle.startApplication(CommonLifeCycle.java:106)
at com.ibm.ws.webbeans.services.JCDIServletContainerInitializer.onStartup(JCDIServletContainerInitializer.java:85)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initializeServletContainerInitializers(WebAppImpl.java:613)
at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:409)
at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:749)
at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:634)
at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:426)
at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:718)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1175)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1370)
at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:639)
at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:968)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:774)
at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2182)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:445)
at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:388)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:116)
at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:994)
at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:502)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1862)
Caused by: java.lang.ArrayIndexOutOfBoundsException
at org.apache.webbeans.portable.AbstractAnnotatedCallable.setAnnotatedParameters(AbstractAnnotatedCallable.java:66)
at org.apache.webbeans.portable.AnnotatedConstructorImpl.<init>(AnnotatedConstructorImpl.java:56)
at org.apache.webbeans.portable.AnnotatedElementFactory.newAnnotatedType(AnnotatedElementFactory.java:117)
... 27 more
I read a couple of other posts from people who faced more or less the same problem, but they were talking about Spring or Guava, none of which I use here. As a result, the solutions I read there did not solve my problem.
Can any one throw light on a solution? It would be helpful to a very great extent.
Additional Info:
I'm developing my project on Eclipse Kepler and using the Webshpere 8.5 plugin to deploy on Websphere application server.
Thanks,
Sriram
Actually it turns out my project was indeed referencing to guava. It was using guava version 15.0. I changed the version to 16.0 and included then in my shared library.. and it solves the issue. Apologies for overlooking guava.. old have saved a lot of time !!

IllegalArgumentException: com.ibm.ws.jsf.config.annotation.WASMyFacesAnnotationProvider is no org.apache.myfaces.spi.AnnotationProvider

I am trying to deploy an application on Websphere 8.5.5
I've created a shared library for Websphere that includes myfaces 2.2 jars and other dependencies like commons-collections.
I also made the class loader of my application as PARENT_LAST.
When I deploy the application, I get this exception:
An error occured while initializing MyFaces: Class com.ibm.ws.jsf.config.annotation.WASMyFacesAnnotationProvider is no org.apache.myfaces.spi.AnnotationProvider
java.lang.IllegalArgumentException: Class com.ibm.ws.jsf.config.annotation.WASMyFacesAnnotationProvider is no org.apache.myfaces.spi.AnnotationProvider
at org.apache.myfaces.shared.util.ClassUtils.buildApplicationObject(ClassUtils.java:557)
at org.apache.myfaces.shared.util.ClassUtils.buildApplicationObject(ClassUtils.java:524)
I was looking at running a newer version of MyFaces on WAS 8.5.5, and ran into a similar issue. It appears to be a conflict between the code IBM wrote to support its embedded version of MyFaces, and an application- or shared library-provided MyFaces.
IBM provides a way to circumvent this issue. When WAS 8.0 shipped, it provided a feature to allow select either "SunRI1.2" or "MyFaces" as the server-provided JSF. Setting the default to "SunRI1.2" would remove the server-provided MyFaces from the classpath and allow the developer to provide their own.
Select any application
Click JSP and JSF Options
In the JSF implementation section, change the drop-down to SunRI1.2
Click OK
Save configuration and restart server

Deploying PrimeFaces app to GlassFish4 causes java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItem

I'd like to use <p:calendar> in my JSF app developed in Netbeans, so I added the PrimeFaces library. However, when I deploy the app, it errors as follows:
Context with name [/ManagedBeansWithComponents] has not yet been started
C:\Users\Dell-pc\Documents\NetBeansProjects\ManagedBeansWithComponents\nbproject\build- impl.xml:1040: The module has not been deployed.
See the server log for details.
BUILD FAILED (total time: 1 second)
And the server log says:
Source Document: jar:file:/C:/Users/Dell-pc/Documents/NetBeansProjects/ManagedBeansWithComponents/build/web/WEB-INF/lib/primefaces-3.5.jar!/META-INF/faces-config.xml
Cause: Class 'org.primefaces.component.fileupload.FileUploadRenderer' is missing a runtime dependency: java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItem
How is this caused and how can I solve it?
java.lang.NoClassDefFoundError: org/apache/commons/fileupload/FileItem
There is the cause. It's crystal clear. The mentioned class is missing in the runtime classpath. The solution is rather straightforward: put the mentioned class (or, the JAR file containing it) in the runtime classpath. As the package name hints, it's available on http://commons.apache.org/fileupload (which in turn has by the way http://commons.apache.org/io as dependency). Just download and drop those JARs in the same place as PrimeFaces JAR and all should be well.
Unrelated to the concrete problem, note that this particular problem is in turn unintented by PrimeFaces. This problem should actually only occur when you register the FileUploadFilter for the <p:fileUpload> component in web.xml. However, since GlassFish 4.0, it is overzealously preloading every single JSF component and renderer class found in the classpath even if it's never used by the application. The class loading in turn causes all its runtime dependencies to be checked. If it's missing, then you get the NoClassDefFoundError. This problem is thus specific to GlassFish 4.0 and does not occur when using GlassFish 3.x or any other servletcontainer such as Tomcat or JBoss.

WARNING: Multiple JSF Applications found on same ClassLoader. Unable to safely determine which FactoryManager instance to use

I am trying to create an application where I combine jsf2, prettyfaces, jpa and glassfish 3.1. I had some trouble gettings prettyfilter to load properly, which was fixed by following the tutorial here.
However, after completing the steps I got a problem with the Glassfish log being flooded by some really really irritating warnings mesages. It seams they dont have any impact on the functionality of my page, but I would like to know if there is something that will make them go away? The warning is:
WARNING: Multiple JSF Applications found on same ClassLoader. Unable to safely determine which FactoryManager instance to use. Defaulting to first match
In addition I'm having problem undeploying this webapp. Glassfish admin gui will show a text saying "Long lasting process has been detected", before the admin gui is useless and I have to restart the gf server. I get an error in the gf log:
INFO: PrettyFilter shutting down...
INFO: Admin Console: Initializing Session Attributes...
WARNING: java.lang.reflect.InvocationTargetException while attempting to process a 'command' event for 'button1'.
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException while attempting to process a 'command' event for 'button1'.
Not sure if this makes any sense for anyone, but any help is much appreciated!!:)
Both issues are already reported to the Glassfish dev team.
Issue GLASSFISH-15809 - JSF PhaseListener executed for each virtual host
Issue GLASSFISH-16112 - Admin GUI fails with NPE when attempting to undeploy an application
Glassfish 3.2 will be the earliest version where both issues will be fixed.

Resources