I am new to glassfish server.I have used apache tomcat and changed the Built In Servlet Definitions(with param-name=listings) in web.xml like
<servlet>
<servlet-name>default</servlet-name>
<servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>listings</param-name>
<param-value>false</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
from false to true to list the files in my html iframe.
How to do it in glassfish server. which file property i have to modify.Thanks in advance
Each of your netbeans projects for glassfish has a web.xml in:
project-name/web/WEB-INF/web.xml
All configurations in this file are used for the project only.
The default configuration (if no web.xml is in project folder) for all glassfish projects is
glassfish-install-dir/glassfish/domains/domain1/conf/default-web.xml
If your glassfish domain is not domain1 replace it with your domain's name.
Related
I'm trying to implement olap4j-xmlaserver to access Mondrian via HTTP/XMLA. I compiled the project, created a war file (including a web.xml file) and deployed it in Tomcat 7. Problem is that I'm getting an exception when the pivot client application sends an XMLA request:
Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class 'com.mysql.jdbc.Driver' for connect URL 'jdbc:mondrian:Jdbc=jdbc:mysql://localhost:3306/foodmart?user=root&password=xxx;Catalog=/WEB-INF/FoodMart.xml'
at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1452)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1371)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044)
at mondrian.xmla.impl.Olap4jXmlaServlet$Olap4jPoolingConnectionFactory.getConnection(Olap4jXmlaServlet.java:300)
at mondrian.xmla.XmlaHandler.getConnection(XmlaHandler.java:2917)
... 33 more
Caused by: java.sql.SQLException: No suitable driver at java.sql.DriverManager.getDriver (DriverManager.java:315)
at org.apache.commons.dbcp.BasicDataSource.createConnectionFactory(BasicDataSource.java:1437)
... 37 more
The web.xml I put together (I couldn't find a sample in the olap4j-xmlaserver project). I'm sure this web.xml file needs to be fixed to solve the problem, especially the connection string:
<web-app ....
<display-name>olap4j-xmlaserver</display-name>
<description>
Olap4J XML/A server
</description>
<servlet>
<servlet-name>xmla</servlet-name>
<servlet-class>mondrian.xmla.impl.Olap4jXmlaServlet</servlet-class>
<init-param>
<param-name>OlapDriverClassName</param-name>
<param-value>com.mysql.jdbc.Driver</param-value>
</init-param>
<init-param>
<param-name>OlapDriverConnectionString</param-name>
<param-value>
jdbc:mondrian:Jdbc=jdbc:mysql://localhost:3306/foodmart?user=root&password=xxx;Catalog=/WEB-INF/FoodMart.xml
</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>xmla</servlet-name>
<url-pattern>/xmla</url-pattern>
</servlet-mapping>
</web-app>
Any ideas how to fix the web.xml configuration or pointers to relevant documentation will be greatly appreciated.
You are missing the Java driver for MySQL in your classpath. Add it to your webapp in the folder named 'WEB-INF/lib'.
I recently started using font-awesome v4.5.0. It was working like a charm until I upgraded to java 8 from java 7 and spring framework to v4.0 from v3.2
Now, font-awesome icons appear as squares. Browser console (firebug) shows-
NetworkError: 404 Not Found - http://localhost/myapp/fonts/fontawesome-webfont.woff2?v=4.5.0
and tomcat's catalina.out logs show following warnings-
No mapping found for HTTP request with URI [/myapp/fonts/fontawesome-webfont.woff2 in DispatcherServlet with name 'myappservlet'
No mapping found for HTTP request with URI [/myapp/fonts/fontawesome-webfont.woff] in DispatcherServlet with name 'myappservlet'
No mapping found for HTTP request with URI [/myapp/fonts/fontawesome-webfont.ttf] in DispatcherServlet with name 'myappservlet'
Location of 'fonts' folder is correctly specified in font-awesome.min.css's #font-face src. (There are no changes apart from java version and spring framework version. It suddenly stopped working)
I had the same issue.
do you have something like this in your web.xml?
<servlet>
<servlet-name>dispatcher</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<init-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>dispatcher</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
Comment those lines solved the problem for me.
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'm trying to create a servlet which shares liferay session contents with my application.So I need to use PortalDelegateServlet.But I can not find in how to import this library to my project.I can not find any .jar files or something.
How can I import liferay java library to my project?
PortalDelegateServlet is in portal-service.jar which is a required part of the Liferay container. If you grabbed a bundle (which in comment you mention the Tomcat bundle), then it is provided for you. All you should need to do is configure your web.xml:
<servlet>
<!-- http://issues.liferay.com/browse/LEP-2297 -->
<servlet-name>service</servlet-name>
<servlet-class>com.liferay.portal.kernel.servlet.PortalDelegateServlet</servlet-class>
<init-param>
<param-name>servlet-class</param-name>
<param-value>com.example.MyServlet</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>service</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
This Liferay issue (which is linked to in the source for PortalDelegateServlet) makes it sound as if this has been available since version 4.3.0
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.