problems when setting up Shopizer - java

I was tring to set up the Shopizer on localhost.
I followed this to deploy it. Following is what I did.
I think I successfully configured the mysql database. When I run shopizer-build-mysql.bat in the shopizer_root/schema/, there is something wrong with importing the shopizer_data.sql. But I imported it manually.
I imported the 4 directory media, sm-core, sm-central and sm-shop into MyEclipse as existing project.
right click the build.xml file in each directory, run as Ant. Console said build successfully.
copy mysql-connector.jar to Tomcat's lib directory. and copy 3 war files to webapps directory. start Tomcat. Doploying seems right.
Then when I tried to visit localhost:8080/central, I see a logon page. I entered "admin" as login name, and "password" as password. It didnt work, didnt lead me to anywhere.
The console only showed "[DEBUG] (AuthFilter.java:57) [doFilter] - Requested URL /central/profile/logon.action" when I visit localhost:8080/central. When I click "logon", nothing happened.
I dont know what to do now. I want to learn hibernate, spring , struts in a real project. Could anybody help me?

Open profile/logon.jsp
change
window.location.href = "/central/profile/dashboard.action";
to
location.href = "/central/profile/dashboard.action";

Some workaround solution for shopizer-1.1.5-src
In chrome:
-fulfill "Logon" form - admin/password
-turn on "Developers tool" - F12
-put in Console: $("#logon-button").click();
-hit Enter

As Shopizer with 2.0 version has switched to maven you can check the documentation page to correctly set up the app.
I want to learn hibernate, spring , struts in a real project.
...You can contribute to this project and be a part of the project development, there is no better way to learn than practicing in a real project and developing a useful stuff.

Related

How to deploy tutorial project on GAE

I am completely new to GAE and maybe this question could be quite trivial, anyway I present my case.
I followed the "Try Google App Engine Now" tutorial without any problems (I choose the java project and I use Chrome).
When I try to deploy the project on GAE something goes wrong, I can create the project on GAE but I don't know what to do next:
What command should I use to deploy?
Thanks
Assuming that you have been able to create your application and have been successful in running it locally, please follow the instructions over here for uploading your application.
https://developers.google.com/appengine/docs/java/tools/uploadinganapp#Uploading_the_App
Basically, you should do some configuration such as filling the project-ID at app.yaml.
Then you can use the terminal to change to your project directory, afterwards you can invoke Maven as 'mvn appengine:update'
You can follow the instructions at the following link:
https://cloud.google.com/appengine/docs/java/gettingstarted/uploading

Issue Glassfish 4 doesn't appear glassfish-web

I'm trying to create a descriptor file for my Java web application project.
For this project i am using:
Netbeans 8.0 &
GlassFish 4
When I try to create the glassfish descriptor file. Netbeans shows into the dialog window that is going to create a file called sun-web.xml instead of glassfish-web.xml.
I was looking for this on the internet and found that the first one sun-web.xml is created for version older than 3, and the version 4 should create a file with the name glassfish-web.xml.
I'm following a tutorial where a person is using the same tools that I have. But in the tutorial he can create a glassfish-web.xml file.
Another error raise when I click the finish button with the intention of create the sun-web.xml file and an error popup raise a show me this message:
"Deployment Configuration for this project not found. Deployment descriptor version could not be set properly"
Can't anyone help me please ???
Thank you a lot!!
You should be able to use that sun-web.xml file fine, it might change in a couple of ways like for example when you want to add a security role mapping, NetBeans won't be able to automatically fill in the security role names from your web.xml, but if you fill them in manually and correctly you should be fine.
Actually, I had the same problem, so what I did was erase all versions of Glassfish (I use OSX so I erased the folders from Applications > Netbeans > GlassFish and from Users/MyUser/GlassFish_Server), added a new server in NetBeans Services > Servers > right click add server and follow the wizard, when you get to step 2 (Server location) click download now and that will reinstall glassfish, restart NetBeans and now when you try to create a Glassfish descriptor it should be properly named as glass fish-web.xml
Hope this helps :)
I simply changed version Java EE 7 to Java EE 5 when creating new project at 3rd step Server and Settings and it could create glassfish-web.xml. I'm using same versions of Netbeans and Glasssfish. Hope may this will help you.

Webapp shows 404 page after project renaming

I have been working on this web application using Eclipse and m2e (maven plugin for Eclipse).
After a while I decide to change the project name in eclipse doing: Right click on project >> refactor >> rename
Following this I see a few errors coming up, mostly to do with classpath configuration & java versions mismatch. I fix them, adding the maven dependencies to the build path, and updating the java versions to be used during compilation & run time.
I rebuild my web app & restart my server (Tomcat in this case). Open my browser to go to my app's root url. And I get a 404 page (everything looks fine in the console btw).
I've been going through my buildpath and classpath config to double check if anything was coming from there but everything seems fine. I'm confused and unsure where to look at.
Thanks in advance
This really depends on your Setup. If you are using the default path, it is (as Kal said) myserver/newappname.
If you are using a url that you have configured in webserver for easier readability like (myapp.myserver.com) you would have to change the redirection in your server from your old appname to the new one.
Actually,
404 HTTP standard response code indicating that the client was able to communicate with the server, but the server could not find what was requested.
1. Check your path with newapplication name.
2. See inside your server, Is there a resource with (newNameApp.war)?
3. As you are using maven, try to build the project and see the log, by which name war is generated, and where the war got placed.
I faced the same situation and simply restarted Eclipse and no more 404 afterward

Trouble configuring existing Tomcat6 and Eclipse

I just got the Eclipse Java EE version and tried to configure Tomcat by going to the Window-->preferences-->Server
But when I went to "runtime environment" and gave it the location of the current tomcat directory, it didn't seem to recognize it and didn't let me go to next screen.
Did I do something wrong? The problem is that there are still the red squigly lines in the import statements of servlet libraries. Is there some correct way to refresh the page so I can ensure that Eclipse indeed does not recognize those libraries still?
I have been experiencing similar problems recently, sometimes even Eclipse not listing Apache Tomcat 6.0 among available servers. The solution was go to eclipse's metadata directory:
your_workspace/.metadata/.plugins/org.eclipse.core.runtime/.settings/
And delete following files:
org.eclipse.wst.server.core.prefs
org.eclipse.jst.server.tomcat.core.prefs
Then restart Eclipse and try again, everything should work.
Hope this helps!
Ensure that you're pointing to the real Tomcat root directory which contains the /bin, /conf, /lib, etc folders, not to a directory which contains just apache-tomcat-7.0.11 or something.
Also pay attention to the error/warning message in top of the wizard, if any, right below the title.

Eclipse keeps running my old web application

OMG - what is going on with Eclipse (3.3 Europa) - has anyone come accross this problem (bearing in mind I have been messing about with uninstalling different Tomat containers and installing others - but anyway thats another story)
When I change a line of code or remove a class within my project - when I come to debug - it actually goes to a line that is commented out and runs that line regardless!!!! e.g.
//System.out.println("you should not be able to read this!");
UPDATE: This can be solved by setting Project -> Build Automatically (see answer below).
REMAINING PROBLEM:
Eclipse is not keeping my hot deploy folder current with the latest changes to my project:
I found out to my horror that some old remenants of my project are 'hanging around' in the folder that I think Eclipse uses for hot deploys or something
C:\myJavaCode.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\myWebApp
basically it is not actually copying accross any changes made in the classes of my working dir!?!??
...anyway - in order to keep my project up to date - I have to modify this folder too - TOTALLY UNACCEPTABLE - as you can't develop in this way - it would take you eons! Anyway, if anyone can help explain to me what stupid thing I have done to get me in this mess and how I can get out of this mess - I would really appreciate it.
Have a look at:
Windows>Preferences>Server>Launching...
and:
Project>Build Automatically
maybe you accidentally disabled the auto-deploy features.
I had a similar problem, only without the added complexities of a web app. I'm just running a JUnit test and it's running the old code. I went into Configure Build Path, on the bottom of the Source tab, and looked at Default Output Folder, which said myproject/bin. The Package Explorer doesn't even show a bin folder, but when looking at the file system there's a bin folder there. I deleted the bin folder, refreshed the package explorer tree, and it worked. This behavior was in Helios and occurred with AND without Build Automatically selected...looks like a bug to me.
Dave
A super-silly question: Does all your webproject and related projects compile correctly?
Also check your output folder for classes (Project Properties -> Java Build Path -> Source Tab) then go to your filesystem and check permissions and modification dates.
Hope this will help you.
Probably the easiest way to get past this is to define a new server.
Right-click in the Servers window and select New, or when you do 'Run On Server' select Manually define a new server. You can have multiple servers defined using the same Tomcat runtime (they'll all have separate configs and deployment directories defined by -Dcatalina.base=...), but don't run them at the same time unless you change the ports they're listening on.
The new server will use a path like
<<yourEclipseWorkspace>>\.metadata\.plugins\org.eclipse.wst.server.core\tmp1
for the Tomcat conf and webapps directory.
Try running on this server. If it works, you can compare settings with the old one,
maybe try deleting the app from it and re-deploying, and figure out what you might have done to cause the problem. Or just delete the original server config.
As far as your second problem, I'm not sure. I'd try a new server config first, get it working, stop the server, do a 'Clean' on your project, delete anything in the tmp1\work\Catalina directory, and restart the server (you could remove and add your project to the server again too to be really clean).
Check the console messages too to make sure there were no errors related to this.

Categories

Resources