I have web.xml as follows
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
<display-name>HibDemo</display-name>
<description>HibDemo Application</description>
<!-- Http Flex Session attribute and binding listener support -->
<listener>
<listener-class>flex.messaging.HttpFlexSession</listener-class>
</listener>
<!-- MessageBroker Servlet -->
<servlet>
<servlet-name>MessageBrokerServlet</servlet-name>
<display-name>MessageBrokerServlet</display-name>
<servlet-class>flex.messaging.MessageBrokerServlet</servlet-class>
<init-param>
<param-name>services.configuration.file</param-name>
<param-value>/WEB-INF/flex/services-config.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>RDSDispatchServlet</servlet-name>
<servlet-class>flex.rds.server.servlet.FrontEndServlet</servlet-class>
<init-param>
<param-name>messageBrokerId</param-name>
<param-value>_messageBroker</param-value>
</init-param>
<init-param>
<param-name>useAppserverSecurity</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>10</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>MessageBrokerServlet</servlet-name>
<url-pattern>/messagebroker/*</url-pattern>
</servlet-mapping>
<servlet-mapping id="RDS_DISPATCH_MAPPING">
<servlet-name>RDSDispatchServlet</servlet-name>
<url-pattern>/CFIDE/main/ide.cfm</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
</welcome-file-list>
<!-- for WebSphere deployment, please uncomment -->
<!--
<resource-ref>
<description>Flex Messaging WorkManager</description>
<res-ref-name>wm/MessagingWorkManager</res-ref-name>
<res-type>com.ibm.websphere.asynchbeans.WorkManager</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>
-->
I have downloaded blazeds3.3 and copied all the lib files my lib folder and added the above web.xml file.
Then I have created the Flex 4 project with BlazeDS support. it has been created without any error. Then I have added the datagrid in the code. While using data-centric driven feature of flex 4 it is asking me username and password. I have checked "No Password Require"
Then it gives me Error Like
Error Executing RDS command. Status code 404, Reason: Servlet RDSDispatchServlet is not available
Please help me.
It looks like the RDS stuff isn't in BlazeDS 3.3. As far as I can see, its v4 and above.
So your server is likely not starting the servlet due to the class not being found on the classpath.
Related
I'm running in springfox v2.7.0 in my java spring based application. We have 3 dispatch serverlets configured in web.xml:
1)common springmvc servlet [Active]
<servlet>
<servlet-name>springmvc</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>WEB-INF/config/common/springmvc-servlet.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>`
2 ) springmvc-v1 servlet [inactive]: which is disabled by commenting out it in web.xml and not in use.
<servlet>
<servlet-name>springmvc-v1</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextClass</param-name>
<param-value>
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
</param-value>
</init-param>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
com.test.mywebservices.v1.config.WebConfig
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
3)springmvc-v2 servlet [Active]: for this I am implimenting swagger.
<servlet>
<servlet-name>springmvc-v2</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<init-param>
<param-name>contextClass</param-name>
<param-value>
org.springframework.web.context.support.AnnotationConfigWebApplicationContext
</param-value>
</init-param>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>
com.test.mywebservices.v2.config.WebConfig
</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>springmvc-v2</servlet-name>
<url-pattern>/v2/*</url-pattern>
</servlet-mapping>
And it works fine, and i can get to the swagger-resources from here:
https://localhost:9002/mywebservices/v2/swagger-resources
And i can view the api from here:
https://localhost:9002/mywebservices/v2/v2/api-docs
And Swagger-UI is accessible from here:
https://localhost:9002/mywebservices/swagger-ui.html
The problem is when i load the https://localhost:9002/mywebservices/swagger-ui.html page it is trying to access the swagger-resources from here:
https://localhost:9002/mywebservices/swagger-resources
And they are not available. But it is available at https://localhost:9002/mywebservices/v2/swagger-resources
How can i fix this so that the swagger-ui.html :
I think Swagger-ui.html should be available at: https://localhost:9002/mywebservices/v2/swagger-ui.html so that springfox.js will get the right baseUrl.
https://localhost:9002/mywebservices/swagger-ui.html >>> pages loads but gives popup to enter the Base URL
https://localhost:9002/mywebservices/swagger-resources/configuration/ui >>> gives 404 hence popup appears
https://localhost:9002/mywebservices/webjars/springfox-swagger-ui/springfox.js >>> Able to access.This is working fine.
Please suggest the solution.
Thanks in advance.
I was facing the same problem.
The solution was to map on the MVC config of your app, manually the Controller managing the mapping of swagger-resources that exists on swagger-common.jar. The package value is "springfox.documentation.swagger.web". The configuration, depending on your app, should look similar that the one shown below:
#Configuration
#EnableWebMvc
#ComponentScan(basePackages = { ApplicationPackages.REST_CONTROLLER_BASE_PACKAGE,
"springfox.documentation.swagger.web" })
public class MvcConfig extends WebMvcConfigurerAdapter {
}
Been scratching my head for about a day, I'd really appreciate any help.
Using Weblogic 12c version 12.2.1 and Jersey 1.19 everything is OK
Using Weblogic 12c version 12.1.3 I'm getting this error:
Servlet:"ServletAdaptor" failed to preload on startup in Web application: "PapWeb".java.lang.ArrayIndexOutOfBoundsException:
65281
Edit: I also see this related(?) warning when running the 12.1.3 server:
The application is using ServletContainerInitializer class
com.sun.jersey.server.impl.container.servlet.JerseyServletContainerInitializer
that is loaded
from:file:/D:/servers/wls12130/oracle_common/modules/jersey-servlet-1.18.jar.
This initializer overrides the one available in the system.
WEB_INF/lib includes those jars:
jersey-1.19
jersey-core-1.19
jersey-multipart-1.19
My web.xml has:
<servlet>
<servlet-name>ServletAdaptor</servlet-name>
<servlet-class>com.sun.jersey.spi.container.servlet.ServletContainer</servlet-class>
<init-param>
<param-name>com.sun.jersey.config.property.packages</param-name>
<param-value>gr.modas.core.bussiness.services</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.config.server.provider.packages</param-name>
<param-value>gr.modas.core.bussiness.services</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
<param-value>gr.modas.core.bussiness.services.PapyrosRequestFilter</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>ServletAdaptor</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>
The code below (in weblogic.xml) solved the issue...
<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<container-descriptor>
<prefer-web-inf-classes>**true**</prefer-web-inf-classes>
</container-descriptor>
</weblogic-web-app>
I have a very sample web.xml written below:
The problem is...If I remove org.springframework.web.servlet.DispatcherServlet section, I can successfully deploy my project in Tomcat7 as a simple JSP-Servlet app. However, once I use Spring MVC, my deployment will FAIL - Encountered exception org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/WebMVCProj2]]
How can I fix this error?
<?xml version="1.0" encoding="UTF-8"?>
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
id="WebApp_ID" version="3.0">
Spring Web MVC Application
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>Hello</servlet-name>
<servlet-class>HelloWorld</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>Hello</servlet-name>
<url-pattern>/HelloServlet</url-pattern>
</servlet-mapping>
<!-- I can remove the part below to make deployment successful -->
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
I add Spring MVC dependency from Enterprise Bundle Repository (EBR). I also use Eclipse Dynamic Web Module 3.0 which Tomcat7 should support. My jre is 1.6.x 64bits used by Tomcat and my project. I also use Web Deployment Assembly in Eclipse.
Here is my complete exception:
SEVERE: Error deploying web application archive E:\MyServers\apache-tomcat-7.0.30\webapps\WebMVCProj2.war
java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/WebMVCProj2]]
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:904)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:618)
at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:963)
at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1600)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
You should have applicationContext.xml in web-inf folder or you have to define contextConfigLocation in your web.xml
<!-- Spring Context -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:/application-contexts/*.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
It would be more helpful, if you could post exception trace.
you can check your servlet class is having any annotation like #WebServlet(". I resolved the similar issue by removing the annotation in servlet class.
When I build my project in Eclipse Helios Service Release 2, I get an error in my web.xml. Please suggest what I have to do for this. In my project I am using DTD 2.2. The error is below.
The content of element type "web-app" must match "(icon?,display-
name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-
mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-config?,security-
role*,env-entry*,ejb-ref*)".
The error message tells you in detail in what order the elements are supposed to be placed and how many of them are allowed. In other words, the ordering or amount of the elements inside the <web-app> of your web.xml is incorrect. For example, as per the error message, <servlet> needs to go before <servlet-mapping>. The ? suffix means that there may be zero or one of them. The * suffix means that there may be zero or many of them.
So, the example below is invalid:
<servlet>...</servlet>
<servlet-mapping>...</servlet-mapping>
<servlet>...</servlet>
<servlet-mapping>...</servlet-mapping>
<servlet>...</servlet>
<servlet-mapping>...</servlet-mapping>
While the example below is valid:
<servlet>...</servlet>
<servlet>...</servlet>
<servlet>...</servlet>
<servlet-mapping>...</servlet-mapping>
<servlet-mapping>...</servlet-mapping>
<servlet-mapping>...</servlet-mapping>
If anyone's interested I received the same exception for error-page. This node needs to go after servlet, but before servlet-mapping.
I have the same issue when I integrate spring to struts2 in Eclipse. After some testing, I found it's the problem of tag's order in web.xml file. The following file has the error
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>Archetype Created Web Application</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<filter>
<filter-name>struts</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
<init-param>
<param-name>struts.devMode</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>struts</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
If I changed the order to
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
<display-name>Archetype Created Web Application</display-name>
<filter>
<filter-name>struts</filter-name>
<filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class>
<init-param>
<param-name>struts.devMode</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>struts</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
</web-app>
The error will be eliminated.
Hope this will be helpful to the people who encounter the same problem.
I've tried copying the weborb config files across to an existing Spring app, and for some reason my spring services aren't being exposed to WebOrb.
I don't see the spring services shown in the WebOrb console, and when I hit the server methods, I get instances of the service that aren't spring wired.
Although this app uses spring annotations heavily, I've tried hitting my services declared in the following ways (always trying to hit "servicesFacade" as my destination):
#Service
public class ServicesFacade ...
#Service("servicesFacade")
public class ServicesFacade ...
<bean id="servicesFacade" class="com.mangofactory.grapevine.service.ServicesFacade" />
I must have missed a config step, but I've compared everything with the example, and can't think what it is.
** Note - I haven't copied any other jars from the web-orb folder (notably, I've exlcuded the spring jars), as I already have a working Spring 3.0 install running on my web app. Could this be the cause?
Steps taken:
Copied from %WEBORB_INSTALL%:
/webapp/WEB-INF/classes -> WEB-INF/classes
/webapp/WEB-INF/flex -> WEB-INF/flex
/webapp/WEB-INF/lib/weborb.jar & jdom-1.1.jar -> WEB-INF/lib
Updated web.xml as follows:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>Grapevine</display-name>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/applicationContext.xml
</param-value>
</context-param>
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter>
<filter-name>openSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>openSessionInViewFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>weborb.ORBServletContextListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<servlet>
<servlet-name>grapevine</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>weborb</servlet-name>
<servlet-class>weborb.ORBServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>rds</servlet-name>
<servlet-class>weborb.rds.handler.FrontEndHttpServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>grapevine</servlet-name>
<url-pattern>/app/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>weborb</servlet-name>
<url-pattern>*.wo</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>rds</servlet-name>
<url-pattern>/rds.wo</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
I have the following spring-related classes in my lib folder:
org.springframework.aop-3.0.4.RELEASE.jar
org.springframework.asm-3.0.4.RELEASE.jar
org.springframework.beans-3.0.4.RELEASE.jar
org.springframework.context-3.0.4.RELEASE.jar
org.springframework.context.support-3.0.4.RELEASE.jar
org.springframework.core-3.0.4.RELEASE.jar
org.springframework.expression-3.0.4.RELEASE.jar
org.springframework.jdbc-3.0.4.RELEASE.jar
org.springframework.jms-3.0.4.RELEASE.jar
org.springframework.orm-3.0.4.RELEASE.jar
org.springframework.oxm-3.0.4.RELEASE.jar
org.springframework.security.config-3.0.3.RELEASE.jar
org.springframework.security.core-3.0.3.RELEASE.jar
org.springframework.security.web-3.0.3.RELEASE.jar
org.springframework.transaction-3.0.4.RELEASE.jar
org.springframework.web-3.0.4.RELEASE.jar
org.springframework.web.portlet-3.0.4.RELEASE.jar
org.springframework.web.servlet-3.0.4.RELEASE.jar
spring-flex-1.0.3.RELEASE.jar
Any help would be greatly appreciated
Marty
Please check if your weborb-config.xml (it is in WEB-INF/classes) contains the following line:
<serviceInvoker>weborb.handler.SpringBeanHandler</serviceInvoker>
Mark