cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with a Web Quick Start website

bogdan1208
Champ in-the-making
Champ in-the-making
I have been meaning to post this for quite some time ago. I would like to ask if other users of WQS have similar issues as me and if they have found a solution. 

Last year I have started using Alfresco Web Quick Start as a platform for creating the website for the project I am involved with. The website can be found at http://www.dial-a-molecule.org. My problem now is that I realized that it does not appear in any of the indexes from Google so my site does not have a PageRank and does not appear in the Google searches. And that is a bad situation to be if you have a site that you are actively promoting.

I have tracked the problem and it seems that when googlebot tries to access the website it gets a HTTP/1.1·500·Internal·Server·Error, error that does not appear when other user try to access the website. The problem can be replicated using Rex Swain's HTTP Viewer at http://www.rexswain.com/httpview.html and inserting the URL http://www.dial-a-molecule.org.

Do you have any suggestions on how to address this problem?

Thanks,
Bogdan
10 REPLIES 10

bremmington
Champ on-the-rise
Champ on-the-rise
Good to see you up and running with Web Quick Start. I've had a quick dig through some Spring and Tomcat source code, and I *think* that this looks like the Java method Locale.getDefault() must be returning null. Normally, a browser would send a header indicating which locale it would prefer, but googlebot won't send that header (and neither does the HTTP viewer you mentioned). If that header is missing then the locale resolver falls back to using the JVM's default locale. It's just that your JVM doesn't appear to have a default locale set.

If I'm right then this can be resolved by putting a call to Locale.setDefault(…) somewhere in your webapp such that it gets invoked on startup. I'll look into this a little further to see if this is a common issue.

bogdan1208
Champ in-the-making
Champ in-the-making
Thanks for the reply. it is good to know that a solution exists for the problem. Unfortunately I do not have the Java knowledge to start modifying Alfresco and I use it as provided with minimal modifications to the code.

It is possible to direct me to where exactly I should modify to solve the problem? What is the file that I should modify in the original WQS site?

Thanks,
Bogdan

bremmington
Champ on-the-rise
Champ on-the-rise
OK. I think we'll try this in two stages. If the first stage doesn't fix it then we'll try the second.

It looks like you're using Tomcat as your web container, but I'm not sure what OS it's running on. The idea of the first stage is to pass two new properties into the JVM on which Tomcat is running:

-Duser.language=en -Duser.country=GB
Tomcat will pick these up from the OS environment variable "JAVA_OPTS". So on Linux using a bash shell (or similar) you would add a command something like this:

export JAVA_OPTS="$JAVA_OPTS -Duser.language=en -Duser.country=GB"
On Windows this would be done by editing the environment variables in the System control panel applet.

Try restarting Tomcat with these properties added and let me know if that resolves the problem.

bogdan1208
Champ in-the-making
Champ in-the-making
Thank's for your reply.

The Tomcat runs on a Windows 7 machine. I have followed your suggestion and I have added the following system variable.
JAVA_OPTS="$JAVA_OPTS -Duser.language=en -Duser.country=GB"
Also I have tried the JAVA_OPTS = -Duser.language=en -Duser.country=GB variable.

In both cases the result was a failure. It did not solve the problem. Looking through the logs from tomcat I found an error that repeats itself that I think it is related to my problem:

09:37:31,316  INFO  [management.subsystems.ChildApplicationContextFactory] Startup of 'wcm_deployment_receiver' subsystem, ID: [wcm_deployment_receiver, default] complete
09:37:38,174  INFO  [extensions.webscripts.DeclarativeRegistry] Registered 313 Web Scripts (+0 failed), 321 URLs
09:37:38,176  INFO  [extensions.webscripts.DeclarativeRegistry] Registered 8 Package Description Documents (+0 failed)
09:37:38,176  INFO  [extensions.webscripts.DeclarativeRegistry] Registered 0 Schema Description Documents (+0 failed)
09:37:38,330  INFO  [extensions.webscripts.AbstractRuntimeContainer] Initialised Spring Surf Container Web Script Container (in 2062.2886ms)
09:37:38,374  INFO  [extensions.webscripts.TemplateProcessorRegistry] Registered template processor freemarker for extension ftl
09:37:38,428  INFO  [extensions.webscripts.ScriptProcessorRegistry] Registered script processor javascript for extension js
09:37:38,695  INFO  [extensions.webscripts.TemplateProcessorRegistry] Registered template processor freemarker for extension ftl
09:37:38,699  INFO  [extensions.webscripts.ScriptProcessorRegistry] Registered script processor javascript for extension js
09:37:38,959  INFO  [extensions.webscripts.TemplateProcessorRegistry] Registered template processor freemarker for extension ftl
09:37:38,962  INFO  [extensions.webscripts.ScriptProcessorRegistry] Registered script processor javascript for extension js
WARN : org.springframework.beans.GenericTypeAwarePropertyDescriptor - Invalid JavaBean property 'baseUrl' being accessed! Ambiguous write methods found next to actually used [public void org.alfresco.wcm.client.impl.WebScriptCallerImpl.setBaseUrl(java.net.URI)]: [public void org.alfresco.wcm.client.impl.WebScriptCallerImpl.setBaseUrl(java.lang.String) throws java.net.URISyntaxException]

The problem is this Invalid JavaBean property 'baseUrl' being accessed! that I do not know how to solve it. On the same machine I have alfresco explorer and share installed and none of them give these errors with the HTTP viewer. Only the WQS site is the one affected.

Thanks,
Bogdan

bremmington
Champ on-the-rise
Champ on-the-rise
That warning in the log file isn't related to the problem you're experiencing - it's just Spring complaining that there are two methods that look ambiguous to it on the WebScriptCallerImpl class. They're not really ambiguous, and Spring does work out which one to call after grumbling about it a bit. Nothing to be worried about.

If you're on Windows, are you running Tomcat as a service or from a command prompt? If you're using it as a service then the way you set the JAVA_OPTS is a little different - I should have said before. You need to run a little configuration app that comes with Tomcat. You will find that in the "bin" folder in your Tomcat installation, and it's called "tomcat6w.exe".

Run this as an administrator, and choose the tab labelled "Java". On the panel that is displayed you should see a text entry box labelled "Java Options" with some entries already in it (all prefixed with "-D"). Add two more to the list (one per line):

-Duser.language=en
-Duser.country=GB

Then click "OK" and restart your Tomcat service. Try the troublesome request from the HTTP Viewer again, and let me know what happens.

bogdan1208
Champ in-the-making
Champ in-the-making
Thanks for your quick post and for your detailed instructions. They made their implementation so much easier but … unfortunately it does not work. Tomcat indeed is installed as a service and I have tried a couple of times setting the settings you have suggested and none of them did the trick.

Please tell me how to proceed forward.
Bogdan

bremmington
Champ on-the-rise
Champ on-the-rise
Hmm. That's a pity. OK, to move forward we probably need to tweak some code. Have you built Alfresco from source, or did you install from the installer? Do you have any experience of writing Java code? Initially I'd like you to compile this code and run it on your server:

import java.util.Locale;
public class OutputLocale
{
    public static void main(String[] args)
    {
        System.out.println(Locale.getDefault());
    }
}

On my system that outputs "en_GB". If my assessment of your problem is correct then you should see "null" being output.

bogdan1208
Champ in-the-making
Champ in-the-making
Alfresco was installed from the installer and unfortunately I do not have any experience in writing Java code but … I have managed to run your code and indeed on my system it outputs "en_GB". I run it twice to be sure.

Bogdan

bremmington
Champ on-the-rise
Champ on-the-rise
Oh. That's not what I was expecting. Let me have a think about this some more.