META-INF/persistence.xml could not be found in GWT/Maven project when packaging/deploying to tomcat - gwt

I am currently working on a GWT project. I have used the GWT webapplicationcreator shell script to create it with the -maven option since I use maven for building it.
So the problem is that when I package the project, using "mvn package", and deploy it to tomcat, it tells me that it can not find out META-INF/persistence.xml even though in my project I have it at the correct location src/main/webapp/META-INF/persistence.xml. I have even extracted the war file to check that it's out there.
246 [Thread-38] INFO org.hibernate.ejb.Ejb3Configuration - Could not find any META-INF/persistence.xml file in the classpath
Have you ever experienced this weird behaviour ? Can you help me figure it out ?
thanks a lot guys

Check persistence.xml is correctly deployed.
See this very useful link:
http://javahowto.blogspot.com/2007/06/where-to-put-persistencexml-in-web-app.html

Related

ClassNotFoundException: com.itextpdf.text.Element

Situation: I have a Java file in my project that uses the features of the iTextPDF library. The project compiles properly. I use JDK 1.7, Tomcat 7.45 and Eclipse Neon.3 Release (4.6.3).
Problem: While starting the server via Eclipse, I get an error:
java.lang.ClassNotFoundException: com.itextpdf.text.Element
What I've tried so far:
Ensured that only 1 version of iTextPdf 5.4.jar is available in the entire project. It's there in WEB-INF/lib folder. It's not there in any of the externally referenced libraries.
I updated my Eclipse.
Any help will be greatly appreciated.
Well, as a starting point- try and expanding the JAR, and see if you can search for or manually find com.itextpdf.text.Element class.
if it's not found there, you know there's nothing wrong with your eclipse or project settings, and nothing wrong with your jar imports.
You should then determine between 3 options:
Is the JAR even on the classpath? it's possible everything is present there, but the project does not even consider looking in it.
Should this class be in the JAR? is it available on other versions of this JAR?
Is this class neccesasry for you application? why is eclipse looking for it, where in the code it is referecened? can you live without it? or, can you manullay replace it with a class file you can find online? (this will take some debug time, and some more research on your part)

ext plugin not working in liferay 6.1.2 jboss7

I created an ext-plugin for extending Liferay LDAP DefaultPortalToLDAPConverter. I created an ext plugin in eclipse. In the ext-impl/src/main/java/com/liferay/portal/security/ldap/CustomPortalToLDAPConverter i extended DefaultPortalToLDAPConverter and kept only the changed methods in my class. Also I added in ext-spring.xml
<bean id="portalToLDAPConverter" class="com.liferay.portal.security.ldap.CustomPortalToLDAPConverter" />
and then deployed the ext. The deployment went well without any errors. But the changes did not take place. Is there anything wrong in what I am doing? I use jboss7.1.1-final bundled Liferay6.1.2. I build using maven and then deploy by placing the war file in liferay-home/deploy. Then I tried restarting the server. Now I could see that my ext-spring.xml is missing in the jar file. Is there any specific reason for this? Please help.
Most of the tutorials say that the META-INF should be placed in the ext-impl/src or ext-impl/src/main folder. Doing so was not placing my ext-spring.xml in the jar build. Shifting the jar to ext-impl/src/main/resources helped and the META-INF was detected. Upon restarting, the changes took effect.
Not compiled files that are meant to be put inside of class-path of resulting artifact should be placed in main/resources path: http://maven.apache.org/guides/getting-started/index.html#How_do_I_add_resources_to_my_JAR

Why is jboss marshalling river jar reported as missing by gwt devmode even though it is included in the classpath

I want to run the puregwt-showcase project from geomajas in debug mode. I have checked the debug configuration and my maven dependencies are included. (should there by any particular order here?).In my maven dependencies i have this jar boss-marshalling-river-1.3.6.GA.jar included. So naturally if it is in my maven deps and my maven deps are on the debug confing claspath it should be detected right?...this is the stacktrace returned http://pastebin.com/xdkwLGkX . I have also asked on majas dev mailing list but nobody answered plus this seems more like a gwt and spring issue so i'm trying my luck here
Hoping to get so answers, or at least some leads,
Otis
EDIT: Another issue i have is that after i run gwt devmode another error pops up in my source: Template file CaptionImpl.ui.xml is missing (expected at org/geomajas/puregwt/example/client/widget/ShowcaseDialogBox) . This only appears if i run the gwt in devmode. If i try a maven install and run there are no problems.
You server-side classes and dependencies have to be in your war folder's WEB-INF to be picked up.
As you're using Maven, you first have to mvn package your app to move all dependencies to target, and then run DevMode with the proper war directory; see https://developers.google.com/eclipse/docs/faq#gwt_with_maven

Eclipse + JBoss - some JAR files not deployed

I have an Eclipse Indigo installation with a JBoss 6 server managed by it. I have a Maven project with a few modules. These modules all build just fine from the command line.
One of the modules is an EAR. This is dependent on two JAR modules and a couple of WAR modules. When I package the EAR from the command line (mvn clean package), the EAR contains all the necessary JAR and WAR files. However, when I deploy it from Eclipse, the two module JAR files are missing from JBoss. The WAR files are just fine. Inside the "Add and Remove..." dialog the JAR files are also present, but not when deployed. I've checked JBoss' deployments folder and there they are indeed missing. The strange thing is, with the exact same POMs and code, all of my colleagues with the same(?) setup don't have this problem.
The two JAR modules are listed in the dependency management part of the parent POM. They are also listed as dependencies in the EAR POM. Still, Eclipse refuses to deploy them with the EAR.
Does anybody have any idea how I can solve this issue? I can manually package and deploy the EAR, but 1) that takes longer, and 2) I can't use Eclipse's debugging functionality this way.
Note: previously asked at http://www.coderanch.com/t/580959/vc/Eclipse-JBoss-some-JAR-files
Right mouse button on project -> Maven -> Update project
I experienced the exact same issue, different eclipse (Eclipse Mars, WildFly 8.1 ).
The unsettling part was that I didn't change anything in the code or in the IDE (that I am aware of) and it started malfunctioning.
I suspect it has something to do with the cached memory of eclipse for it's plugins, anyway, after many hours of trying different things we fixed it by deleting the folder .eclipse under your user in windows.
Seems silly, but we tried everything except that, and that thing did the trick
I'm encountering a similar issue, however my environment is much, much simpler - being a web project, with a utility project. Not using maven at all and deploying to tomcat7.
The class file is not being deployed to the web-inf as expected, although the utility project is referenced, and marked as to be exported.
However with your issue, I came across this post:
http://blog.frankel.ch/better-maven-integration-leads-to-unforeseen-consequences-bugs#comments
which might provide a clue. Hope this helps.
I had the same issue. I didn't modify my code at all, I deleted all the projects from the work space, closed eclipse and reopened it. Then I did a clean and build of the project (which took much longer than before). This time when I went to add the EAR project, it had all the dependencies listed and actually worked.

How do you import a Java Class Library into a Java Web project (using NetBeans)?

I've already tried the options "Add folder...", "Add Library...", and "Add JAR/Folder...", but it's not working this time -- I've done this several times before without any problems.
I've also tried to add the folder / JAR file (.war-file) manually to the projects properties in every thinkable way, but still no success.
And so far, Google hasn't helped either..
Any help would really be appreciated.
(This is for a Java Web project with JavaServer Faces, using NetBeans 7.1)
Solved: I never found out what caused the problem. I ended up re-installing entire NetBeans, and re-created (a thousand times) the project I was trying to import. And in the end, I got it working.
Put the JAR file in the WEB-INF/lib directory of your web project. All JARs in the WEB-INF/lib and all packages in WEB-INF/classes are automatically in the CLASSPATH.
Can you make "Hello, servlet" work? If not, why bother with JSF? Do a simple web app successfully and build up from there.
I had this problem with netbeans, but it seems like all the answers I found are for Eclipse (I guess am wrong) as I dont see any WEB-INF/lib directoryin NetBeans, though I have a WEB-INF directory.
so here what I did.
I remove the tomcat server on NetBeans, go to C:\apache-tomcat-7.0.30\lib , put the jstl-1.2.jar file their, restart NetBeans and add a new (Tomcat) server, create a new web app, and their, I could find the jstl-1.2.jar file in the Libraries > Apache tomcat.
and for unknown reason, it worked.!