I'm trying to setup a Flex project using the Spring + BlazeDS integration by working through the refcard kindly posted by James Ward on refcards.dzone.com.
Some problems/challenges are sticking their heads out. The Tomcat deployment is going well, all the files are on the server and I can summon main.swf through the browser.
I get the following ActionScript exception when trying to make the AMF request to Spring/BlazeDS:
RPC Fault faultString="Send failed"
faultCode="Client.Error.MessageSend"
faultDetail="Channel.Connect.Failed
error NetConnection.Call.Failed: HTTP:
Failed: url:
'http://localhost:8080/blazeds/spring/messagebroker/amf'"
When placing the "Failed: url:" URL directly in the browser, Tomcat displays the following error message:
HTTP Status 404 - Servlet Spring MVC
Dispatcher Servlet is not available
I've setup all the files like James Ward instructed on his refcard, application-config.xml, web.xml and services-config.xml are all in order as far as I can see.
Any ideas as to what I'm messing up?
PS: I'm noticing small changes in terms of James' refcard and the stable release of the integration. Is there something that changed after the M2 release that might be biting me in the behind?
I have the same problem and I fixed it by adding backport-util-concurrent.jar and cfgatewayadapter.jar from test-drive-sample of flex-spring integration , thank you josamoto for your post , finally the integration works good .
regards
If you follow along the reference card your URL would be http://localhost:8080/dzone-server/spring/messagebroker/amf. The context-root in the reference card is dzone-server.
The key step is to make sure the URL above matches the endpoint url defined in the services-config.xml. So the matching endpoint for the above URL would be:
<endpoint url="http://{server.name}:{server.port}/{context.root}/spring/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/>
Note: this is almost the default added by creating a new flex project in Flex Builder except it has spring added to the endpoint URL.
I'm going to answer my own question, it all boils down to me being the dummy. There where some .jars that I did not include in my WEB-INF/lib folder. I copied them accross from the blazeds+spring integration testdrive and that fixed my problem!
Related
I have created rest api with following url-pattern in web.xml file.
/service/*
Its working fine in tomcat server with URL http://localhost:9080/context/service/test
however, in the WebLogic server, its getting failed with the above URL. But when I am using the following URL, It's working fine.
http://localhost:9080/context/resources/test
I am not sure why given first given URL not working with the web-logic server.
Please suggest.
Thanks in Advance
In web logic by default context name is given as resources( you can check in WADL file in web logic console resource folder), however you may further overwrite if required.
Problem 1: Angular 2 application deployed on JBOSS server but not able to load static content (js/css). The problem is the website is hosted under its own context (localhost:8080/sample/) and static resources is refered in index.html as (link href="css/index.css" rel="stylesheet") however it doesnt get loaded as network calls are made to localhost:8080/css/index.css.
I need it to point to localhost:8080/sample/css/index.css
Problem 2: Alternately we tried hosting angular application on tomcat but services need to be hosted on jboss, we tried implementing CROS filter (https://amodernstory.com/2014/12/27/using-cors-headers-with-java-example/) but the first request goes through but other request shows pending status in Chrome network's tab.
I'm having the same problem. To get it to load the static content, you need to set the base href inside index.html to "./". I have found that "." also works. The application should then load properly, BUT you will run into another problem: if you try to visit any of the application routes directly using the address bar, you will see "Not Found". This seems to be related to JBoss's ability to rewrite HTML5 URLs and redirect them to the index. I am trying to solve that problem using the information on this page: https://issues.jboss.org/browse/JDF-512. I will let you know if I succeed.
You can create an index.prod.html with the correct references to "/sample/css/index.css". Then add the following in the angular.json
"production": {
"fileReplacements": [
{
"replace": "src/index.html",
"with": "src/index.prod.html"
}
I've added a message board portlet and created a category. When I clicked on the category, portlet didn't display.
In logs I found error
Invalid path was requested %2Fmessage_boards%2Fview.
The problem is with DefaultFriendlyURLMapper, because when I remove friendly-url-mapping in liferay-portlet.xml for the message board, portlet works.
This error is also in other portlets, I've tried asset publisher.
Any idea how to solve this problem?
It looks that Undertow (Wildfly) and JBoss Web/Tomcat does not implement the servlet API the same way. Undertow is not decoding parameter in the HttpServletRequest unlike JBoss Web/Tomcat. I had the same problem and decided to fix it in Liferay because as you said, it only happens when friendly url requests are being forwarded to the dispatcher.
Have a look at this patch on GitHub. You also probably want to follow this thread on Liferay Forum.
Hope it will help.
I'm working on java project, which is using weblogic 10 as an application server. In this project there are around 11 servlets added in web.xml descriptor with url mapping. Whenever i'm adding new servlet, its not getting mapped to the url as wel as not getting invoked. What may be the problem. As, if I add the same logic in any of the existing servlet, its working fine.
Thanks in advance.
How is the question in the title of your post going to help you solve this problem?
Maybe you have another servlet that maps to the same URL pattern, or you have ambiguous URL patterns for your new servlet and already existing servlets (so that WebLogic doesn't know which one to call). Check the servlet mappings in your web.xml file.
Check the WebLogic management console to see if your servlet is deployed successfully, and check the logs of WebLogic for any deployment errors. Carefully read the error messages to find out what's wrong. If you don't understand them, add them to your post above, so that someone here can explain you what they mean.
If you go to an URL that's supposed to map to your servlet, then what do you get? An error message, or is it going to another servlet? If it's an error, then again, post the error message.
I've got a struts2 application running under a contextpath "/path" on my local tomcat without problems. When I deploy it on a webserver (using a proxy to redirect from "http://www.domain.com" to "myserver:8080/path/") Struts does all kinds of strange things.
First, it includes the context in -tags. That can be turned off by an attribute. But sadly, it also includes the path in the action attributes of my forms, so a login form points to "http://www.domain.com/path/login.action" instead of "http://www.domain.com/login.action" ...
Is there a possibility so somehow change the default context that is added here or turn this off for forms? (I'd like to keep the -tags, only way round seems to be to use default HTML forms.) Thanks in advance!
I found that others also had the problem, but the framework makers don't seem to think that this is an issue. My solutions:
use includeContext="false" in all s:url-tags
instead of the s:form tag, use a usual form, set the action to "actionname.action" and include a simple table with tablerows () for each field. You still can use s:textfield and such.
sadly HTTP sessions won't work anymore as they get set for the path "/path" (the ApplicationPath). This is due to the cookie that saves the JSESSIONID being set to /path. This means that your visitors will only get session variables stored when they're at http://www.domain.com/path/login.action and that those will be lost when they get redirected back to http://www.domain.com/interestingstuff.action ... my solution is a hack that requires setting the JSESSIONID cookie clientside via JavaScript as described here: Struts2: Session Problem (after reverse proxy)
Hope this helps someone ... if you find nicer solutions, please let me know. :-)
Though am answering very late to this question, but I reached this page recently when I was facing the same problem.
The application that I was working upon was appending the context-root viz. 'myContextRoot' to my url on localhost and it was working perfectly there. For eg., as mentioned above the action 'myAction' was becoming
http://localhost:8050/myContextRoot/myAction.action
But the moment I deployed it on a server, it stopped working, then after searching like hell, I found a solution for me. I am deploying an EAR file on glassfish and there we have a file application.xml. In application.xml I had a tag 'context-root' whose value was 'myContextRoot' which I changed to '/' and after that I got my url as on localhost and
Hope it may help :)