- This topic has 13 replies, 3 voices, and was last updated 11 years, 11 months ago by support-tony.
-
AuthorPosts
-
kazooMemberHello,
I’m currently evaluating ME4S and I have 3 issues that I hope you can address.
1) I really want to use Scaffolding with Maven. If I create a simple web project and scaffold a simple MVC project with 1 DB table with REST and JSON support, all appears to be fine. However, if I start with a Maven Project, add the Web Project capabilities, Scaffold for the same simple table and options, if fails. Can you replicated it ?
2) I would like produce a .wadl file from the REST service created from scaffolding. I can’t get the generated REST service to produce it (though the REST service works fine). After doing a bit of research, I’ve noticed that ME4S is using Apache CXF 2.1.9. This is relatively old version. According to the Apache site, .wadl support was not available until version 2.3. How do I upgrade the CXF version that is embedded in ME4S?
3) I’ve also noticed a bug when walking through the Scaffolding wizard. Near the end, the finish button become unavailable and you can’t finish the project. However, if you choose finish before nearing the end, the scaffolding process will start.
Thank you for your help
cconwayMemberHi kazoo,
I’m sorry you’re having these issues.
For Issue (1) what maven archetype are you using and how do you “add Web Project capabilities”? Also in what way does it fail? Is there an error message? Does it fail during the scaffolding, at runtime, etc? Please provide more detail.
For issue (2), if you’re using maven, all dependencies should be added to the pom file. You should be able to edit the pom.xml and set the dependencies as you wish. Of course, you would need to work through any compatibility issues created by your changes.
For Issue (3), I haven’t seen that behavior, but I suspect it may be related to issue #1. What is the title of the panel where the button is disabled?
Also, can you please confirm the version of MyEclipse for Spring you are using?
Thanks,
kazooMember@cconway wrote:
Hi kazoo,
I’m sorry you’re having these issues.
For Issue (1) what maven archetype are you using and how do you “add Web Project capabilities”? Also in what way does it fail? Is there an error message? Does it fail during the scaffolding, at runtime, etc? Please provide more detail.
For issue (2), if you’re using maven, all dependencies should be added to the pom file. You should be able to edit the pom.xml and set the dependencies as you wish. Of course, you would need to work through any compatibility issues created by your changes.
For Issue (3), I haven’t seen that behavior, but I suspect it may be related to issue #1. What is the title of the panel where the button is disabled?
Also, can you please confirm the version of MyEclipse for Spring you are using?
Thanks,
I am using ME4S version 10
1) I am skipping the archetype for fast project set up
2) Agreed. If I could get issue #1 corrected first.
3) “Select Target Folders”See the attached Word file.
Attachments:
You must be logged in to view attached files.
cconwayMemberThanks for the Word doc, it helped. I’m afraid you’ve found a bug or two here as a result of skipping the Archetype selection.
I stepped through the same flow and found that the reason the Finish button is disabled on the “Select Target Folders” page is because the Web Root field is empty on that panel. The bug is that the Finish button should never have been enabled without a valid Web Root selection.
When you press finish earlier in the wizard, the generation fails because of that missing information. I’m going to log the following issues:
1) Make sure the wizard Finish button is only enabled when all necessary data is present (including required fields on that Select Target Folders panel).
2) Add a visual indication of the required fields.
There is a possible second issue that will need to be investigated. I’m not sure what the behavior should be, but it’s unclear what the web root “should” have been. It seems that the root of the project is being used as the web root which we’re not handling correctly. Instead we’re requiring you to select an actual folder.
Are you expecting the root of the project to be your web root?
The only workaround I can offer is to configure the project to have a web root folder that is not the Root of the project, then select that folder on the “Select Target Folders” panel and the scaffolding should work for you.
Please let me know if this works in your case.
kazooMemberThanks Cindy.
Can you offer a work around when using Maven? If I use an archetype, will it work?
I’m willing to accept any Scaffolding solution (button configuration – Webroot) where maven is included in the process.
cconwayMemberThe simplest thing to do is to create a MyEclipse “Web Project” and check the “Add Maven support” checkbox on the wizard.
If that option doesn’t result in the desired structure for your project, you can create a Maven Project and select a Maven Archetype on the wizard. I’d suggest selecting one of the ones with group id of “org.codehaus.mojo.archetypes” and an artifact id that starts with “webapp”
In either of these setups, you should be able to scaffold successfully.
kazooMemberCindy,
The ME4S does not have the “Add Maven Support” like the plain versions of ME (8.6). Is this a bug as well? Is it better to revert to version 9 fo ME4S?
cconwayMemberThe checkbox should be there in ME4S when the Maven4MyEclipse capabilities are enabled in your workspace. To enable/disable them:
Window > Preferences > MyEclipse > Maven4MyEclipse (check the “Enable …” checkbox at the top).
If the capabilities are enabled and you still don’t see the checkbox then there is another problem. If that’s the case, let me know and I can get someone who can better help you.
kazooMemberOk….Thanks Cindy.
For some reason, the maven option was not showing up earlier. Today, that option is available! (go figure).
Now, my next problem:
I was able to complete the scaffolding wizard using a simple Web project with maven enabled. However, exploded deployment and execution to Tomcat 6 does not work. If I deploy the complete snapshot war after running the maven “install” goal, it works. However, we all love and desire exploded deployments for quick development. So if you can me this work that would be great. Can you confirm/replicate this problem?
cconwayMemberI’m glad you got past the initial maven issue. Exploded deployment should work. What steps are you taking to perform the exploded deployment?
Also, please clear the server error log, then recreate the problem and attach the log file to this thread.
Thanks,
kazooMemberCindy,
The steps I’m taking are simple.
1) Scaffold a simple maven MVC project called “testApp”.
2) After the wizard is done, simply add the project to the Tomcat server
3) Start the server.
4) Execute the App. Example (http://localhost:8080/testApp)I get this:
SEVERE: Servlet.service() for servlet jsp threw exception
java.lang.NullPointerException
at org.apache.jsp.index_jsp._jspInit(index_jsp.java:23)
at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:52)
at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:164)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:340)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129)
at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter.doFilterInternal(OpenEntityManagerInViewFilter.java:113)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:619)
kazooMemberCindy,
I have yet another problem.
If I scaffold a simple MVC project and choose the option to create a REST service but DO NOT choose the JSON support option, I suspect a REST webservice will be created that products either text or xml. This does not seem to work. I am currently getting a 404 error. Can you replicate and confirm please?
cconwayMemberHi Kazoo,
I have no problems scaffolding a Maven MVC app and deploying it in the the manner you describe. I even used your project name.
I asked you to attach your server log because I wanted to see if there were errors during deployment, or if there were other errors like perhaps a missing database driver which is a common problem that appears upon the first access to the database. You may look for those items yourself by watching the Console view as the server starts and as you access your page.
If there are absolutely no other errors, and no information as to why you received this NullPointerException then you’ll need to find what’s going on at line 23 of index_jsp.java which is the compiled version of your index page. It can be found under the .metadata/.me_tomcat/work folder of your Eclipse workspace. Unfortunately, there is no magical answer here. You’ll have to follow standard debugging procedures.
Regarding the REST checkbox, we will not generate a webservice from the CRUD scaffolding wizard. The REST checkbox results in a Spring controller with REST annotations in your project located in a package with a similar name as the non-rest controller. Also, this thread is regarding maven so in the future if you have another unrelated question or issue, please post it in a new thread to avoid polluting the thread with unrelated issues.
support-tonyKeymasterKazoo,
Sorry it has taken so long to address this issue. It has now been fixed in our code and will be in the 10.7 release of MyEclipse for Spring, due in a few weeks.
-
AuthorPosts