Vaadin applicagtion in Maven gets widget error (using tomcat) - java

I'm trying to create a Vaadin application to deploy on a tomcat server following the beginner's guide in the book of Vaadin.
https://vaadin.com/book/-/page/getting-started.maven.html
I used the Maven command line provided at this address. I can successfully create a Maven project, build it with mvn package and import it in eclipse.
Once done, I can add it to my tomcat server and run it. When trying to connect to localhost http://localhost:8080/viznet/ (viznet being the project name) I get a this error :
Requested resource [/VAADIN/widgetsets/viznet.MyAppWidgetset/viznet.MyAppWidgetset.nocache.js] not found from filesystem or through class loader. Add widgetset and/or theme JAR to your classpath or add files to WebContent/VAADIN folder.
I would like to know a) why is this happening b) How can I solve it.
I did a lot of researches yet, found some alike problems but couldn't fix mine. It seems to me I can't get my project to use the default widget (or fix this particular one but the default widget would suit me just fine).
There might be some error in my configuration or missing information here, I'm brand new to this so I don't know what you need to know in order to help me.
Environment:
Ubuntu 14.04
Eclipse 4.1
Maven Latest
Tomcat 8.0
Thanks in advance

I fixed this problem by creating new Maven configuration and adding "package jetty:run" in command line, then just run your project, it should work fine, after this you can use Tomcat again!

You need to compile your widgetset using mvn vaadin:compile. Look at this question.

Related

vaadin4spring security sample: failed to load widgetset

I am desperately trying to build a little Vaadin project with login secured pages/views. I have found vaadin4spring and thought I could start based on the security sample. However, after importing the project and running it, I am receiving the message (without any changes at the project):
Failed to load the widgetset:
./VAADIN/widgetsets/org.vaadin.spring.samples.security.Widgetset/org.vaadin.spring.samples.security.Widgetset.nocache.js?1424243461387
I have also tried to compile the widgetset manually, which wasn’t possible at the beginning (missing WebContent folder). After converting the project to use WebFacets and adding Dynamic Web Module the compilation was possible. But the widgetset related error message was still the same.
Can anybody help me with this problem? I have the feeling that it is just a little thing I am missing.
I think you have imported the sample somehow wrong, because you are talking about WebContent folder. I bet you are using eclipse (because of WTP related WebContent folder).
Delete the old project from workspace and possible settings files eclipse created
Choose File->Import->Maven->Existing Maven Project
You probably want to make one fresh install before you start to play with the project: from the top level "parent-pom" project, choose with right click: Run as -> Maven install. Get a cup of coffee, the build will take a while.
Enjoy!
To start e.g. the Security sample you seem to have tried, just execute the main method from org.vaadin.spring.samples.security.ApplicationInitializer. In eclipse, right click on the class and choose Run as Java Application and the app will launch with embedded Tomcat at http://localhost:8080/

How to resolve exception "weblogic.application.ModuleException: Context path '' is already in use by the module: / application"?

I have gone through the Question:
[weblogic.application.ModuleException: Context path '' is already in use by the module: / application:
and followed as answer of the question says; but still getting the same exception:
**> Deployment failed. The message was:
weblogic.application.ModuleException: Context path
'/socketss-war' is already in use by the module:
/Socketss-war application: Socketss
D:\NetBeansProjects\Socketss\Socketss-war\nbproject\build-impl.xml:1056:
The module has not been deployed. See the server log for details.**
Any guidance or suggestion would be highly appreciable.
Thank you!
ModualException come due to inproper Bulid.
Go through step by step.
Update project
Restart your eclipse
Remove project from server
clean server and redeploy your project
Now publish it i hope now it will work
Yup. Try to deploy from Netbeans.
The Weblogic eclipse plugin is, in my experience, the worst deployment plugin I've ever seen. If you are using a patched weblogic - such as 12.1.2 with Patch Set Update 6 - your deployment from eclipse might miraculously not work with such an error.
If you are able to deploy the WAR file without IDE by going to the deploy view, I recommend that you try using Netbeans to deploy and see how it goes.
Notice as well that the outcome of trying to deploy from eclipse as exploded war or as virtual application is not the same. Typically both do not work with different exceptions, depending on the patches you are using.
In my case, I have two local installations of weblogic 12.1.2. One with the patch set update and another one without. From eclipse, It is only possible to deploy to the one without. From Netbeans, deployment works regardless of the instance.

Error: Archive for required library cannot be read or is not a valid ZIP file.

I am having trouble setting up the build path of my java project. I am currently in a Co-Op IT position so I am somewhat new to all this. My background is mostly in C++ and I am learning java on the fly. I am also somewhat new to Eclipse (Kepler service release 1).
I am working on a bug on an existing program and need to get the program to build so I can work on it. When I add all of the external .jar files that I know for a fact are the right ones, I am getting this error on two of them :
"Archive for required library: '(location of file)' cannot be read or is not a valid ZIP file"
Two of the other full time guys on my team have gotten the program to run with those exact same .jar files, one running Eclipse Indigo and the other running the same Kepler version as myself. I also was able to open the two .jar files manually and everything appears to be there. After every trial trying to fix this, I have refreshed, cleaned and restarted eclipse. The two other full time guys said they have never seen this error. I would like to get some insight on this from anyone who has any similar experiences so that I don't have to use up much more of their time.
I Had this issue, just fixed by deleting .jar files from Libs directory then copy->paste original Jars again. Then do a complete clean -> rebuild
I got this problem, took help from following link solution
which basically says to
1. delete the corresponding maven download folder
2. maven>update project in eclipse
In my case I deleted hibernate folder, since i was getting error related to hibernate-validator.jar
I had the same error here. What I did to resolve the problem was close and reopen the project.
I got the same problem and found out the root cause is the JDK in my linux shell is set to 1.6, but in the eclipse, the JRE is 1.7.
Using Eclipse without m2e features (Standard Edition) helped me.
Similar problem with Spring toolsuite
Just came across this link that shows a way to get unblocked.
In preferences dialog box go to
Java->Compiler->Building
and change Incomplete build path to "Warning" (from default "Error")
This can be done globally (for all projects), or on a project by project basis.
Check the jar's file permissions/ownership.
I had the same issue on eclipse installed on Linux and fixed it by setting the file permissions right.
In my case ..worked after removing this from spirngrest-servlet.xml file.
<prop key="net.sf.ehcache.configurationResourceName">/Sysehcache.xml</prop>
I think it had to do with default location of maven repository of jar files.
Been at it for 3 days. finally solved it.Hope it helps anyone.Just look for similar think in your spirngrest-servlet.xml file. Good luck.
I just tried the following and it worked:
Close eclipse as there might be some files eclipse is accessing and you won't be able to delete.
Delete all the libraries installed in the maven repositories folder: ".m2/repository"
Open eclipse and update your project(Alt+F5).
What did we just do? : This is possible that the existing libraries in the local repository are erroneous and maven tries to open which it fails in. We have now deleted the already existing library and with the project update, Maven will download the library again which should resolve the issue.
i fixed this by just deleting everything inside of the /Users/username/.m2/repository folder. not the repository folder itself. and then running a mvn clean package in the project folder

How can i solve a NoClassDefFoundError?

I have installed Oracle Weblogic 11g on Oracle Linux and I tried to complete one of Oracle's ADF tutorials using jdeveloper 11g. When I run my project it compiles successfully with no errors. It starts deploying the application to the weblogic server and my default internet browser opens. But then an Error "500 Internal server error" appears.
I'm getting the following error:
java.lang.NoClassDefFoundError: Could not initialize class org.apache.myfaces.trinidadinternal.convert.ColorConverter at....
I researched the internet for this problem and I also asked around and the common answer was that there is a problem with the classpath. Probably the libraries that are used in jdeveloper are not the same in weblogic then the project gets deployed.
Can anyone tell if definitely the problem is the classpath??
And how can I setup jdeveloper to deploy the same classpath it used to the weblogic server?
java.lang.NoClassDefFoundError means the runtime version of the class in the classpath is not the same as that at compile time.
Your problem could be multiple versions of the class being found when the server is deploying. I notice the class org.apache.myfaces.trinidadinternal.convert.ColorConverter is found in trinidad-impl.jar
Can you search for how many such jars are found in the run time server environment plus your own webapp libraries?
On windows, the Jdev inbuilt server runs in this folder
C:\Users\<...>\AppData\Roaming\JDeveloper\system11.1.1.4.37.59.23 or something similar
you need this in your webapp/WEB-INF/lib and not in the other areas.
On my local I find the Jar under C:\Users\<...>\AppData\Roaming\JDeveloper\system11.1.1.4.37.59.23\o.j2ee.wlLibs\jsp\Trinidad-Components1.2.war
I think you could use the weblogic.xml setting to force the WEB-INF/lib class to get loaded in preference to that in server/lib with
<container-descriptor>
<prefer-web-inf-classes>true</prefer-web-inf-classes>
</container-descriptor>
This happens when you try to load a class that is trying to load another class which is not on the classpath. Find out which classes are needed by ColorConverter and make sure you have them in your classpath.
First of all: What are you deploying to the server? An ADF jar or a WAR file. In your case - given that you don't have any dependent jars installed on the application server. You should deploy a WAR file.
On your view project - right click and select Project Properties. Then go to Deployment and edit the deployment profile (if none are there create one). Make sure that the checkbox "Include Libraries from other projects" is checked. (IT's in the Library Dependencies tab).
Also: you might find some useful information in here.
Hope this helps.
Michael
Using StackTrace you can find out classes those are missing .I think you are missing some jar and that should be in your classpath.

red5 0.9 on Windows - Java Problems on build

so I've installed red5 0.9, I've installed jdk 1.6 update 22. I've set my environment variables correctly, installed eclipse galileo for java ee developers, tortoise svn, and then ivyde and subclipse plugins for eclipse. I then created a folder called red5_server, and did the svn checkout. When I try to import the red5_server, I get the java problem:
The project was not built due to "Could not delete '/red5_server/bin/org'.". Fix the problem, then try refreshing this project and building it since it may be inconsistent
Do you have any idea what could cause this? Also, while it was attempting to build, an error flashed on the screen and quickly disappears. I was only able to read it by removing the project and importing it over and over again until I was able to react quick enough to screen-capture the error. It says:
'Ivy resolve job of ivy.xml in 'red5_server has encountered a problem. Error while resolving the ivy instance for ivy.xml in 'red5_server': Unrecognized variables in the Ivy settings file ${workspace_loc:red5_server/ivysettings.xml}
Any idea what this could be? Thanks in advance!
Also, when I remove the project and try it again, I get the same ivy.xml error and isntead of getting the one java problem, i get over 5000. Any ideas? My head is spinning over here.
I've tried this on a freshly reformatted computer with the same results and with every version of red5.
All of the errors are Java Problems of the same type:
ApplicationAdapter cannot be resolved to a type Application.java
or,
The import org.red5.server.adapter cannot be resolved Application.java
or,
log cannot be resolved Application.java
or,
The method getName() is undefined for the type Application Application.java
Am I missing some essential file or path?

Categories

Resources