Client.Error.MessageSend problem with Flex/BlazeDS on JBoss - java

I'm developing a Flex 3.4 app that interops with a Java EE backend running on a JBoss-4.2.2 server, through the most recent release of BlazeDS. When I ran the Flex app from Flash Builder 4 beta 2 on Tomcat, everything was fine, the Flex app was able to make the remote call needed. But my production environment is on JBoss, and when I moved the app to JBoss (with services-config.xml updated to fit JBoss), the Flex app keeps complaining Client.Error.MessageSend upon remote calls.
At first, when I manually deployed the app to JBoss, the faultDetail was "Channel.Security.Error error Error #2048 ... "; later I tried to run the app from Flash Builder, and then faultDetail became "Channel.Connect.Failed error NetConnection.Call.BadVersion".
In services-config.xml, under <security>, was:
<login-command class="flex.messaging.security.TomcatLoginCommand" server="Tomcat"/>
when moving to JBoss, I updated it to:
<login-command class="flex.messaging.security.TomcatLoginCommand" server="JBoss"/>
I have a crossdomain.xml placed in JBoss' deploy folder, as follows:
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy
SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*" />
</cross-domain-policy>
But looks like it doesn't work. I've also tried to put crossdomain.xml in deploy/xxxxx.war folder, and the problem remains.
I'm using http://, not https://, so I guess it's not about security channel.
Tried to search for a solution, but most solutions were PHP related, which wasn't really helpful. Any one got any clues?

You have
<login-command class="**flex.messaging.security.TomcatLoginCommand**" server="Tomcat"/>
Where the class indicates that security is of tomcat you should change it to a class that implements the interface flex.messaging.security.LoginCommand or any security interface blaze.

If you browse to http://your.application.root/crossdomain.xml, does the file load? The simplest configuration is to put the file at the root of the domain.

Related

Tomcat Deployment and Routing

I feel like I’m attempting to accomplish a pretty simple task but I’m stumped. I’m attempting to use the Tomcat Manage App to deploy my app and then route my root domain name to point to that deployment.
Specifically, the app currently deployed at http://www.schmud.de/home/ should load when a person types http://www.schmud.de into their browser.
I tried deploying and configuring this in CPanel with no luck. It seems that the Tomcat Manage App interface or Host Manager interface is what I’m supposed to be use to configure my routing?
My .htaccess currently looks like this:
SetHandler jakarta-servlet
SetEnv JK_WORKER_NAME ajp13
My web.xml is generated by Clojure.
There is no way to do it within the Tomcat Web Interface nor the .htaccess file. The user must have deeper access on a CPanel system.
Assuming that you have deployed your application as "app" and configured your .htaccess as I described above, here are the specific instructions I gave my root admin to solve the routing issue:
open /usr/local/easy/share/easy-tomcat7/conf/server.xml
Under the <Host> tag add this:
<Context path="" docBase=“app” debug="0" reloadable="true" />
Restart the server
Upon restart, http://domain.com/ should load my homepage (just as http://domain.com/app/ does now)

Error .gwt.xml Vaadin

UPDATE:
I was able to add Vaadin 7 jars manually and create a v7 application but it still grave me the same error in the xml when I run it
I'm new to Vaadin and web application development. I'm still wrapping my head around all that is envolved in this technology and how it works.
I wanna develop a simple application with a login to do basic file parsing. I downloaded the Vaadin 6 eclipse plugin (I wasn't able to use version 7 because of newtork security). I'm using Tomcat 7, Eclipse Indigo Service Release 2, as well as Apache IvyDe plugin (which I still don't understand what it does!)
I used the dragDrop wizard in Vaadin to create the interface of my Login page but when I tried to run my program it it gave me the following error
The errors below were detected when validating the file "gwt-module.dtd" via the file "LoginWidgetset.gwt.xml".
In most cases these errors can be detected by validating "gwt-module.dtd" directly.
However it is possible that errors will only occur when gwt-module.dtd is validated in the context of LoginWidgetset.gwt.xml.
Line 2 - The markup declarations contained by the document type decleration must be well-formed
and there seem to be an error in the LoginWidgetset.gwt.xml which I couldn't reslove
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 1.7.0//EN"
"http://google-web-toolkit.googlecode.com/svn/tags/1.7.0/distro-source/core/src/gwt-module.dtd">
<module>
<inherits name="com.vaadin.terminal.gwt.DefaultWidgetSet" />
<!--
Uncomment the following to compile the widgetset for one browser only.
This can reduce the GWT compilation time significantly when debugging.
The line should be commented out before deployment to production
environments.
Multiple browsers can be specified for GWT 1.7 as a comma separated
list. The supported user agents at the moment of writing were:
ie6,ie8,gecko,gecko1_8,safari,opera
The value gecko1_8 is used for Firefox 3 and later and safari is used for
webkit based browsers including Google Chrome.
-->
<set-property name="user.agent" value="gecko1_8"/>
</module>
I was also trying to use one of the Addons from the official Vaadin website but whenever I run my appliation it gives me the same error with the .gwt.xml
Does anybody know what's causing this error? It would also be very helpful if you could explain to me the role of the IvyDe plugin. I'm not using Maven but only because I don't know how it would help. If you could shed a light on that too I'd really appreciate it.
And on a final note, is this the right approach I should be taking to develop web apps or should I stick with common frameworks and jsp?
Thanks
The network security was blocking the google-web-toolkit.googlecode.com server so I created a gwt-module.dtd and stored it to a local directory and then referenced that in my xml instead of the live link.
<!DOCTYPE module
SYSTEM "file:\\\\public\share\MyWebApp\WebContent\WEB-INF\gwt-module.dtd">

Tomcat Deploying 2 Projects

I have a requirement that I need to use a single server machine to run 2 totally different applications.
The server machine has Apache Tomcat 6.0 installed. 1 of the applications is deployed on it and is running successfully for a long time. Initially, the clients used to connect to it by invoking the url "http://machine-name/1stProjectName/initialPage". I have also mentioned the "initialPage" as the Welcome Page in web.xml of this project. But somehow, later some ports or relating things were changed by the server maintenance team, and to connect to the application, now one has to use the url "http://machine-name" or "http://machine-name/initialPage", i.e. the machine name has started behaving like the project name folder because now if I invoke the url "http://machine-name/1stProjectName/initialPage", it gives 404 error saying that "/1stProjectName/1stProjectName/initialPage" resource not available.
Now, when I deploy the WAR of the second application into the webapps folder of Tomcat (just like I did for the first application), it unpacks it properly. But, the issue is how do I connect to this second project. If I use "http://machine-name", it takes me to the 1st application and if I use "http://machine-name/2ndProjectName/initialPage", it gives me an error that "/1stProjectName/2ndProjectName/initialPage" not available.
Kindly help or guide me in some direction.
Thanks in advance.
Your URLs should look like this if you did things properly:
Project 1: http://host:port/war-name-1
Project 2: http://host:port/war-name-2
That means no changes to content.xml to modify the path.
I would talk to your "server maintenance team" and let them know what you are trying to do (since they are the ones who made these changes in the first place). But it sounds to me that they just mapped a path to a specific location, that is your machine-name root is mapped to 1stProjectName.

faces-config strange configuration problem?

I have a seam project (you should not be blocked to answer just because it's seam, consider it beeing a jsf one) and all works great with jboss 5.1 until I add this to the faces-config.xml
<faces-config>
<validator>
<validator-id>passwordValidator</validator-id>
<validator-class>com.mydomain.seam_icefaces_test.action.PasswordValidator</validator-class>
</validator>
.....
</faces-config>
to configure a validator (I know I can use a seam validator but I just want to use a jsf one).
At this moment jboss continuously deploy and undeploy my app automatically - which is very strange of course...
Do you know why?
Is this happening when you deploy using a local server in Eclipse? I used to get this issue of constant deploying & undeploying - it was caused by an Eclipse versioning file in the deployment.
Every time you change a config file (like faces-config.xml) Eclipse creates a versioning file, to revert to if necessary. This screws up JBoss. Simply delete this file - it'll be called faces-config.xxxxx where xxxx is something other than xml.

Does JBoss cache class files?

I'm wrestling with a strange problem: When I make a change to a POJO or Seam Component in my localhost JBoss instance, restart it, and load the page, the change is visible. However, on our server, running the same version of JBoss, when I stop the instance, delete the WAR file, upload the latest version, and restart JBoss, it won't show some of the new server-side functionality.
Specifically, the change is to a POJO class which implements javax.faces.validator.Validator class. It's then used in the XHTML Facelet like this:
<h:inputText value="#{outsideaccount.accountOrganizationEmail}" maxlength="50"
id="txtOrganizationSupportEmail"
validatorMessage="Organization Support Email is not valid. It must be in the pattern 'some_id#some_domain.com'.">
<f:validator validatorId="AnyEmailValidator"/>
</h:inputText>
I'm able to use the email validator on my localhost JBoss correctly; on the development server, it throws a validation error using the same email on the same page. Very strange. Is JBoss caching the class files somewhere? How do I clear everything out of the JBoss development server cache?
I'm using Win XP Pro locally; the development server is using JBoss 4.2.3.GA on JVM Version 1.5.0_16-b02, with Unix SunOS 5.10. Thanks.
JBoss has work and tmp directories that you can delete to make sure everything is clean. Things can get cached there, so you can clear them out on deploy if you are having problems. There is also a setting to force that to happen automatically on JBoss's end. If your problem is a cache clearing problem, this will help solve it.
Another possibility is that you have two copies of that war deployed on JBoss, although that should give you some errors when you deploy in production.

Categories