I'm working with my web application and it uses JBoss 7 AS as application server. I have recently installed JBoss 7 and it starts smoothly. Now when I try to run very simple web application with just index.html under WebContent folder I get following error:
HTTP Status 404 - The requested resource (/BookStore/index.html) is not available
I know it means that JBoss server can't find that location but what can go so wrong when I don't see any errors in console.
Here's my web.xml file:
xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
BookStore
State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2
javax.faces.STATE_SAVING_METHOD
server
javax.servlet.jsp.jstl.fmt.localizationContext
resources.application
org.apache.myfaces.ALLOW_JAVASCRIPT
true
org.apache.myfaces.AUTO_SCROLL
true
org.apache.myfaces.DETECT_JAVASCRIPT
false
org.apache.myfaces.PRETTY_HTML
true
org.apache.myfaces.webapp.StartupServletContextListener
Faces Servlet
javax.faces.webapp.FacesServlet
1
Faces Servlet
/faces/*
Faces Servlet
*.jsf
Faces Servlet
*.faces
Faces Servlet
*.xhtml
/index.html
And index.html file:
SuccessHello World!
What I can do in this case? I'm using Eclipse Indigo and to clarify I haven't deployed the .war file of the project before I got HTTP Status 404 error. However when I tried to deploy that specific .war file by creating file called BookStore.war.dodeploy JBOSS_PATH/Standalone/Deployments I got deployment failed error and the root cause of the error was this:
16:06:02,958 WARN [org.hibernate.engine.jdbc.internal.JdbcServicesImpl] (MSC service thread 1-4) HHH000342: Could not obtain connection to query metadata : No suitable driver found for jdbc:derby:C:\Users\Amir\workspace\BookStoreDB;create=true
16:06:02,966 INFO [org.hibernate.dialect.Dialect] (MSC service thread 1-4) HHH000400: Using dialect: org.hibernate.dialect.DerbyDialect
16:06:02,974 WARN [org.hibernate.dialect.DerbyDialect] (MSC service thread 1-4) HHH000430: The DerbyDialect dialect has been deprecated; use one of the version-specific dialects instead
16:06:02,980 INFO [org.hibernate.engine.jdbc.internal.LobCreatorBuilder] (MSC service thread 1-4) HHH000422: Disabling contextual LOB creation as connection was null
16:06:02,986 INFO [org.hibernate.engine.transaction.internal.TransactionFactoryInitiator] (MSC service thread 1-4) HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory
16:06:02,991 INFO [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (MSC service thread 1-4) HHH000397: Using ASTQueryTranslatorFactory
16:06:03,056 INFO [org.hibernate.validator.util.Version] (MSC service thread 1-4) Hibernate Validator 4.2.0.Final
16:06:03,554 INFO [org.hibernate.tool.hbm2ddl.SchemaUpdate] (MSC service thread 1-4) HHH000228: Running hbm2ddl schema update
16:06:03,555 INFO [org.hibernate.tool.hbm2ddl.SchemaUpdate] (MSC service thread 1-4) HHH000102: Fetching database metadata
16:06:03,555 ERROR [org.hibernate.tool.hbm2ddl.SchemaUpdate] (MSC service thread 1-4) HHH000319: Could not get database metadata: java.sql.SQLException: No suitable driver found for jdbc:derby:C:\Users\Amir\workspace\BookStoreDB;create=true
at java.sql.DriverManager.getConnection(Unknown Source) [rt.jar:1.6.0_35]
at java.sql.DriverManager.getConnection(Unknown Source) [rt.jar:1.6.0_35]
at org.hibernate.service.jdbc.connections.internal.DriverManagerConnectionProviderImpl.getConnection(DriverManagerConnectionProviderImpl.java:173) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.prepare(SuppliedConnectionProviderConnectionHelper.java:51) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:194) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:178) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.internal.SessionFactoryImpl.(SessionFactoryImpl.java:457) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1737) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.ejb.EntityManagerFactoryImpl.(EntityManagerFactoryImpl.java:84) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:889) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:162) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [rt.jar:1.6.0_35]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [rt.jar:1.6.0_35]
at java.lang.Thread.run(Unknown Source) [rt.jar:1.6.0_35]
Regarding that above error I'm using Embdedded Derby and I have checked and made sure that it has Embedded Derby driver in libraries/jars. I'm also using Hibernate to establish connection. What's also funny is that when I run JUnit tests where I save some data to database it works but for some reason I just don't get why it says in the above error Could not obtain connection to query metadata : No suitable driver found for jdbc:derby:C:\Users\Amir\workspace\BookStoreDB;create=true.