How-to deploy to application server web project with non-webproject structure (within Eclipse) - eclipse

Basically what I want is to deploy from Eclipse web project to application server (WebLogic). The problem is that project source files are structured differently than what application server expects (i.e. there is no WEB-INF containing deployment descriptor). As a results when I try to deploy my project to app server it is not recognized as deployable app. Is there a smart and elegant way how-to solve this problem?

OK, i will answer my question myself. Basically this situation can be solved by creating a new dynamic web project with the required structure and then using Linked folder functionality of eclipse.

Related

Location of web resources in HTML5 + REST project?

I am learning HTML5 integration with REST web services.
Using information mentioned at URL:
Redhat tutorial for HTML5 app
I created sample application in my eclipse workspace. Generated code structure is as shown below:
I do not understand why all web resources are stored are shown as a deployed resources? Does not it mean that, they are not part of my source code? I thought there would WEB-INF directory, under which my web resources will be stored. Please correct my understanding.
I found that it is just the way eclipse displays the structure of workspace. But in actual file system, web resources are stored under:
src/main/webapp

Coldfusion deployment process

I am trying to figure out what's the best process to implement for build & deployment for coldfusion project.
I am much more familiar with the regular java stack: some back-end framework (Spring, Struts, etc), bunch of JSP files, then use maven to compile and bundle everything to a .war file that I simply deploy (copy) over to a tomcat webapp directory
Are cfm files practically same as jsp? What are the similarities & differences between Java vs Coldfusion build/deploy process?
The resources I found so far make it sound like to just copy & paste the physical files, which doesn't sound quite right.
The thread here Best Practices for Code/Web Application Deployment? - goes on the generic deployment process, which we already have implemented. We have code repository and maven to manage our build & deployment process, can coldfusion work straight out of the box with the same set up as regular Java/war projects?
A thread in Adobe forum does not give much insights either: Deploying ColdFusion 8 project via EAR/WAR file, plus it talks about EAR rather than WAR.
This is an old link from 2007: build tools: maven and coldfusion seem to indicate maven is not straight out of the box solution, also seems like Coldfusion has no need for dependency management that maven is so useful for?
Can someone help point me to the right direction for build & deployment of coldfusion projects with the following stack:
Code repository, doesn't matter much: Git, svn
Maven build
Deploy project as war into Tomcat7 (not built in)
MySQL db connector
and Lastly - how would the solution be different between CF8 vs CF10? Looks to me CF8 may be worse as it doesn't officially support Tomcat, whereas CF10 runs on modified version of Tomcat?
Thanks!
When it comes to deploying CFML out the box then you really just have to copy and paste the file into your web server. In your case if you are using git just pull it from your repository. You don't have to do anything other then that. However, in some cases you may need to clear your CFML Cache if you don't see the changes immediately. This is my personal process:
Make changes on local machine running a CFML Development environment.
Commit and Push changes to git repository.
Pull changes to Production Server
Clear cache if needed.
It really is simple as that as long as your code makes it that simple.
Answer 1:
I have worked on some substantial apps were the process was zip up all the files, send them to a deployment team and they will unzip at the appropriate location.
Answer 2:
I suspect you are looking for something like CAR files. http://help.adobe.com/en_US/ColdFusion/10.0/Admin/WSc3ff6d0ea77859461172e0811cbf364104-7fd3.html

Eclipse Tomcat file Synchronization

I am using Eclipse and Tomcat to develop some J2EE application, Dynamic web project
I am wondering how to synchronize the local files/file structure with the service side.
In practice, we develop our j2ee at a local workspace, but we need to upload these *.class to the service side, so done folder structure and other accessory files, such as web.xml.
Can somebody let me know how to configure Eclipse so that every action I made can also work on the service side?
such as generating *.class files to their destinated folder on service and mapping the folder structure onto the service side.
Many thanks

NoClassDefFoundError on Google App Engine

I am developing a project on Eclipse Juno using both GWT and GAE.
My original project had all its packages and classes on the same project and it worked fine both on Development Mode and when uploaded to the Google App Engine on the Internet.
Then I created another project (on the same workspace) were I moved the classes that were generic so they could be used on other projects. I have not created a Jar file. Do I have to? I wish I could just keep my generic classes on another project without putting them on a jar file.
After a while I was able to create correct XXX.gwt.xml files on both projects and added the new project to the "Projects" tab of the main project properties (Project >> Properties >> Projects) to make the moved classes visible to the main project. The GWT compiler found those moved classes, translated them into Javascript code and the main project was able to execute them on the client side.
My problem is on the server side. No matter what I try the server part cannot find the moved classes and when trying to execute any of them it comes with the "NoClassDefFoundError" error when running on the Development Mode (I have not tried to upload to the Google App Engine on the Internet yet).
If I comment out all the references to those classes on the server side the error does not show up, but of course I don't have their functionality.
Gaston Ceron
Yes, you'll have to create a jar of the second project, and put it in the WEB-INF/lib folder.
If you can use maven or ant, you can probably set up appengine to compile the other project into a jar and use it as a dependency for the app engine project.

Running servlet within Eclipse requires libs to be defined 3 times - am I doing something wrong?

Hullo - issue is this:
I wrote a servlet in Eclipse which requires mysql-connector-java-5.1.22-bin.jar
To compile I need to add the jar via the project's "Java Build Path"
To deploy I need to add the jar to the project's "Deployment Assembly"
To run the servlet within eclipse I need to add the jar to the servlet's Run Configuration -> Classpath
It's not the end of the world re-re-repeating myself like this, but it does seem odd.
Given that Eclipse gets a lot of other stuff correct I'm guessing / hoping that maybe I'm overlooking some feature to avoid this silliness (I cannot imagine a scenario where you'd benefit from entering this in 3 different spots ... but maybe I'm being uncreative here ...).
Insights appreciated :-)
The only thing you need to do is to drop the jar in WebContent/WEB-INF/lib.
You are developing a Java Web project, so the traditional place to put the required libs (JAR files etc) is under /WEB-INF/lib. And you do it only once.
In Eclipse, when you create Dynamic Web Project the appropriate project structure is generated for you (this is a development structure). In this case you place your JAR files in ProjectName/WebContent/WEB-INF/lib folder. And this folder is *automatically included in the project's build path.
Considering the fact that it is a Java Web project (you said you use servlets) you have to deploy your web app to some Application Server, like GlassFish, JBoss, WebLogic, WebSphere etc, or more simple Web Container like Apache Tomcat. If you do this thru Eclipse, then again your web project is automatically deployed.
NB!
There may be some additional details related to using libraries.
For instance, when it comes to using database drivers (MySql, PostgreSQL, Oracle etc) Tomcat advises the following while configuring JNDI Datasource (quote):
Before you proceed, don't forget to copy the JDBC Driver's jar into
$CATALINA_HOME/lib
In your case (MySQL) see the example here: MySQL DBCP Example
Also see my answer related to Webapp configuration file organization convention.
Hope this will help you.
P.S. Here is a step-by-step example: How do I access MySQL from a web application?