Como minha aplicação vai se dividir em duas partes no mesmo projeto: admin e site. Nesse caso, as páginas .jsp referentes a parte admin ficarão no caminho “WEB-INF/jsp/admin” e as páginas .jsp referentes a parte site ficarão ou no caminho “WEB-INF/jsp” ou “WEB-INF/jsp/site”. Então, seguindo sua orientação, criei as classes: CustomRoutesParser.java e CustomPathResolver.java. Entretanto, logo de cara aconteceu a seguinte situação. Quando não coloco @ApplicationScoped em CustomPathResolver.java a aplicação funciona perfeitamente. Mas quando coloco @ApplicationScoped em CustomPathResolver.java dá erro direto na aplicação. O que pode ser?
Seguem os respectivos códigos de cada classe abaixo e também a log com o erro.
Jul 06, 2014 12:38:11 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.7.0_17\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/Program Files/Java/jdk1.7.0_17/bin/…/jre/bin/server;C:/Program Files/Java/jdk1.7.0_17/bin/…/jre/bin;C:/Program Files/Java/jdk1.7.0_17/bin/…/jre/lib/amd64;C:\oracle\product\10.2.0\client_1\bin;C:\Program Files\Java\jdk1.7.0_17\bin;C:\Program Files\apache-ant-1.9.4\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Common Files\Microsoft Shared\Windows Live;C:\Program Files (x86)\Common Files\Microsoft Shared\Windows Live;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files (x86)\Common Files\Roxio Shared\10.0\DLLShared;C:\Program Files (x86)\Common Files\Roxio Shared\DLLShared;C:\Program Files (x86)\Sony\VAIO Startup Setting Tool;C:\Program Files (x86)\Windows Live\Shared;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn;c:\Program Files\Microsoft SQL Server\100\Tools\Binn;c:\Program Files\Microsoft SQL Server\100\DTS\Binn;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE;c:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn;C:\sqlite;C:\Program Files (x86)\MySQL\MySQL Utilities 1.3.4;C:\langs\Ruby193\bin;C:\Program Files\Java\jdk1.7.0_17\bin;C:\eclipse;;.
Jul 06, 2014 12:38:11 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source’ to ‘org.eclipse.jst.jee.server:tryon-site’ did not find a matching property.
Jul 06, 2014 12:38:11 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source’ to ‘org.eclipse.jst.jee.server:livraria-admin’ did not find a matching property.
Jul 06, 2014 12:38:11 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler [“http-bio-8080”]
Jul 06, 2014 12:38:11 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler [“ajp-bio-8009”]
Jul 06, 2014 12:38:11 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 617 ms
Jul 06, 2014 12:38:11 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
Jul 06, 2014 12:38:11 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.33
14-07-06 12:38:13,716 [INFO] br.com.caelum.vraptor.config.BasicConfiguration - Using class br.com.caelum.vraptor.ioc.guice.GuiceProvider as Container Provider
14-07-06 12:38:14,482 [INFO] br.com.caelum.vraptor.config.BasicConfiguration - br.com.caelum.vraptor.scanning = null
14-07-06 12:38:14,482 [INFO] br.com.caelum.vraptor.scan.WebAppBootstrapFactory - Dynamic WebAppBootstrap found.
14-07-06 12:38:14,560 [ERROR] br.com.caelum.vraptor.scan.ScannotationComponentScanner - There’s no occurence of package br.com.caelum.vraptor.util.jpa in classpath
14-07-06 12:38:14,841 [INFO] br.com.caelum.vraptor.core.DefaultConverters - Registering bundled converters
14-07-06 12:38:15,014 [INFO] org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.2.0.Final
14-07-06 12:38:15,014 [INFO] org.hibernate.cfg.Environment - Hibernate 3.6.4.Final
14-07-06 12:38:15,014 [INFO] org.hibernate.cfg.Environment - loaded properties from resource hibernate.properties: {initialPoolSize=3, maxPoolSize=20, hibernate.connection.driver_class=com.mysql.jdbc.Driver, preferredTestQuery=select 1, hibernate.format_sql=true, hibernate.query.substitutions=true=1, false=0, hibernate.connection.username=root, acquireIncrement=5, timeout=25200, hibernate.hbm2ddl.auto=update, hibernate.connection.url=jdbc:mysql://localhost/livraria, idleConnectionTestPeriod=100, hibernate.connection.provider_class=org.hibernate.connection.C3P0ConnectionProvider, hibernate.bytecode.use_reflection_optimizer=false, hibernate.show_sql=true, hibernate.connection.password=<strong><strong>, minPoolSize=3}
14-07-06 12:38:15,014 [INFO] org.hibernate.cfg.Environment - Bytecode provider name : javassist
14-07-06 12:38:15,029 [INFO] org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
14-07-06 12:38:15,092 [INFO] org.hibernate.ejb.Version - Hibernate EntityManager 3.6.4.Final
14-07-06 12:38:15,279 [INFO] org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: br.com.casadocodigo.livraria.admin.modelo.Usuario
14-07-06 12:38:15,326 [INFO] org.hibernate.cfg.annotations.EntityBinder - Bind entity br.com.casadocodigo.livraria.admin.modelo.Usuario on table Usuario
14-07-06 12:38:15,373 [INFO] org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: br.com.casadocodigo.livraria.admin.modelo.Arquivo
14-07-06 12:38:15,373 [INFO] org.hibernate.cfg.annotations.EntityBinder - Bind entity br.com.casadocodigo.livraria.admin.modelo.Arquivo on table Arquivo
14-07-06 12:38:15,373 [INFO] org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: br.com.casadocodigo.livraria.admin.modelo.Livro
14-07-06 12:38:15,373 [INFO] org.hibernate.cfg.annotations.EntityBinder - Bind entity br.com.casadocodigo.livraria.admin.modelo.Livro on table Livro
14-07-06 12:38:15,388 [INFO] org.hibernate.cfg.Configuration - Hibernate Validator not found: ignoring
14-07-06 12:38:15,404 [INFO] org.hibernate.validator.util.Version - Hibernate Validator 4.2.0.Final
14-07-06 12:38:15,529 [INFO] org.hibernate.cfg.search.HibernateSearchEventListenerRegister - Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
14-07-06 12:38:15,529 [INFO] org.hibernate.connection.ConnectionProviderFactory - Initializing connection provider: org.hibernate.connection.C3P0ConnectionProvider
14-07-06 12:38:15,529 [INFO] org.hibernate.connection.C3P0ConnectionProvider - C3P0 using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/livraria
14-07-06 12:38:15,529 [INFO] org.hibernate.connection.C3P0ConnectionProvider - Connection properties: {user=root, password=</strong></strong>, autocommit=true, release_mode=auto}
14-07-06 12:38:15,529 [INFO] org.hibernate.connection.C3P0ConnectionProvider - autocommit mode: true
14-07-06 12:38:15,544 [INFO] com.mchange.v2.log.MLog - MLog clients using log4j logging.
14-07-06 12:38:15,607 [INFO] com.mchange.v2.c3p0.C3P0Registry - Initializing c3p0-0.9.1 [built 16-January-2007 14:46:42; debug? true; trace: 10]
14-07-06 12:38:15,685 [INFO] com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource - Initializing c3p0 pool… com.mchange.v2.c3p0.PoolBackedDataSource@aaf8bdc5 [ connectionPoolDataSource -> com.mchange.v2.c3p0.WrapperConnectionPoolDataSource@a3e9353b [ acquireIncrement -> 5, acquireRetryAttempts -> 30, acquireRetryDelay -> 1000, autoCommitOnClose -> false, automaticTestTable -> null, breakAfterAcquireFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null, connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, debugUnreturnedConnectionStackTraces -> false, factoryClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToken -> 1hge13s933f480n7wsw0j|606492bb, idleConnectionTestPeriod -> 100, initialPoolSize -> 3, maxAdministrativeTaskTime -> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0, maxPoolSize -> 20, maxStatements -> 0, maxStatementsPerConnection -> 0, minPoolSize -> 3, nestedDataSource -> com.mchange.v2.c3p0.DriverManagerDataSource@9a15112f [ description -> null, driverClass -> null, factoryClassLocation -> null, identityToken -> 1hge13s933f480n7wsw0j|448c2f42, jdbcUrl -> jdbc:mysql://localhost/livraria, properties -> {user=******, password=******, autocommit=true, release_mode=auto} ], preferredTestQuery -> select 1, propertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> false, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false; userOverrides: {} ], dataSourceName -> null, factoryClassLocation -> null, identityToken -> 1hge13s933f480n7wsw0j|68f18e9f, numHelperThreads -> 3 ]
14-07-06 12:38:15,919 [INFO] org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.MySQLDialect
14-07-06 12:38:15,934 [INFO] org.hibernate.engine.jdbc.JdbcSupportLoader - Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException
14-07-06 12:38:15,934 [INFO] org.hibernate.cfg.SettingsFactory - Database ->
name : MySQL
version : 5.6.14
major : 5
minor : 6
14-07-06 12:38:15,934 [INFO] org.hibernate.cfg.SettingsFactory - Driver ->
name : MySQL-AB JDBC Driver
version : mysql-connector-java-5.1.16 ( Revision: ${bzr.revision-id} )
major : 5
minor : 1
14-07-06 12:38:15,934 [INFO] org.hibernate.transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions)
14-07-06 12:38:15,934 [INFO] org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
14-07-06 12:38:15,934 [INFO] org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
14-07-06 12:38:15,934 [INFO] org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
14-07-06 12:38:15,934 [INFO] org.hibernate.cfg.SettingsFactory - JDBC batch size: 15
14-07-06 12:38:15,934 [INFO] org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled
14-07-06 12:38:15,934 [INFO] org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled
14-07-06 12:38:15,934 [INFO] org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): enabled
14-07-06 12:38:15,934 [INFO] org.hibernate.cfg.SettingsFactory - Connection release mode: auto
14-07-06 12:38:15,934 [INFO] org.hibernate.cfg.SettingsFactory - Maximum outer join fetch depth: 2
14-07-06 12:38:15,934 [INFO] org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
14-07-06 12:38:15,934 [INFO] org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
14-07-06 12:38:15,934 [INFO] org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
14-07-06 12:38:15,934 [INFO] org.hibernate.cfg.SettingsFactory - Order SQL inserts for batching: disabled
14-07-06 12:38:15,934 [INFO] org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
14-07-06 12:38:15,934 [INFO] org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
14-07-06 12:38:15,934 [INFO] org.hibernate.cfg.SettingsFactory - Query language substitutions: {false=0, true=1}
14-07-06 12:38:15,934 [INFO] org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: enabled
14-07-06 12:38:15,934 [INFO] org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
14-07-06 12:38:15,934 [INFO] org.hibernate.cfg.SettingsFactory - Query cache: disabled
14-07-06 12:38:15,934 [INFO] org.hibernate.cfg.SettingsFactory - Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
14-07-06 12:38:15,950 [INFO] org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
14-07-06 12:38:15,950 [INFO] org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
14-07-06 12:38:15,951 [INFO] org.hibernate.cfg.SettingsFactory - Echoing all SQL to stdout
14-07-06 12:38:15,951 [INFO] org.hibernate.cfg.SettingsFactory - Statistics: disabled
14-07-06 12:38:15,951 [INFO] org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
14-07-06 12:38:15,951 [INFO] org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
14-07-06 12:38:15,951 [INFO] org.hibernate.cfg.SettingsFactory - Named query checking : enabled
14-07-06 12:38:15,951 [INFO] org.hibernate.cfg.SettingsFactory - Check Nullability in Core (should be disabled when Bean Validation is on): disabled
14-07-06 12:38:15,966 [INFO] org.hibernate.impl.SessionFactoryImpl - building session factory
14-07-06 12:38:15,966 [INFO] org.hibernate.type.BasicTypeRegistry - Type registration [characters_clob] overrides previous : org.hibernate.type.PrimitiveCharacterArrayClobType@37d02753
14-07-06 12:38:15,966 [INFO] org.hibernate.type.BasicTypeRegistry - Type registration [blob] overrides previous : org.hibernate.type.BlobType@42c5d6c5
14-07-06 12:38:15,966 [INFO] org.hibernate.type.BasicTypeRegistry - Type registration [java.sql.Blob] overrides previous : org.hibernate.type.BlobType@42c5d6c5
14-07-06 12:38:15,966 [INFO] org.hibernate.type.BasicTypeRegistry - Type registration [clob] overrides previous : org.hibernate.type.ClobType@4a9741c2
14-07-06 12:38:15,966 [INFO] org.hibernate.type.BasicTypeRegistry - Type registration [java.sql.Clob] overrides previous : org.hibernate.type.ClobType@4a9741c2
14-07-06 12:38:15,966 [INFO] org.hibernate.type.BasicTypeRegistry - Type registration [materialized_blob] overrides previous : org.hibernate.type.MaterializedBlobType@105e4dd0
14-07-06 12:38:15,966 [INFO] org.hibernate.type.BasicTypeRegistry - Type registration [wrapper_materialized_blob] overrides previous : org.hibernate.type.WrappedMaterializedBlobType@1f469b15
14-07-06 12:38:15,966 [INFO] org.hibernate.type.BasicTypeRegistry - Type registration [wrapper_characters_clob] overrides previous : org.hibernate.type.CharacterArrayClobType@546f8fbd
14-07-06 12:38:15,966 [INFO] org.hibernate.type.BasicTypeRegistry - Type registration [materialized_clob] overrides previous : org.hibernate.type.MaterializedClobType@6845ec99
14-07-06 12:38:16,122 [INFO] org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured
14-07-06 12:38:16,122 [INFO] org.hibernate.tool.hbm2ddl.SchemaUpdate - Running hbm2ddl schema update
14-07-06 12:38:16,122 [INFO] org.hibernate.tool.hbm2ddl.SchemaUpdate - fetching database metadata
14-07-06 12:38:16,122 [INFO] org.hibernate.tool.hbm2ddl.SchemaUpdate - updating schema
14-07-06 12:38:16,154 [INFO] org.hibernate.tool.hbm2ddl.TableMetadata - table found: livraria.arquivo
14-07-06 12:38:16,154 [INFO] org.hibernate.tool.hbm2ddl.TableMetadata - columns: [id, datamodificacao, conteudo, nome, contenttype]
14-07-06 12:38:16,154 [INFO] org.hibernate.tool.hbm2ddl.TableMetadata - foreign keys: []
14-07-06 12:38:16,154 [INFO] org.hibernate.tool.hbm2ddl.TableMetadata - indexes: [primary]
14-07-06 12:38:16,169 [INFO] org.hibernate.tool.hbm2ddl.TableMetadata - table found: livraria.livro
14-07-06 12:38:16,169 [INFO] org.hibernate.tool.hbm2ddl.TableMetadata - columns: [id, titulo, preco, datapublicacao, isbn, capa, descricao]
14-07-06 12:38:16,169 [INFO] org.hibernate.tool.hbm2ddl.TableMetadata - foreign keys: []
14-07-06 12:38:16,169 [INFO] org.hibernate.tool.hbm2ddl.TableMetadata - indexes: [isbn, primary]
14-07-06 12:38:16,169 [INFO] org.hibernate.tool.hbm2ddl.TableMetadata - table found: livraria.usuario
14-07-06 12:38:16,169 [INFO] org.hibernate.tool.hbm2ddl.TableMetadata - columns: [id, admin, nome, login, senha]
14-07-06 12:38:16,169 [INFO] org.hibernate.tool.hbm2ddl.TableMetadata - foreign keys: []
14-07-06 12:38:16,169 [INFO] org.hibernate.tool.hbm2ddl.TableMetadata - indexes: [primary]
14-07-06 12:38:16,169 [INFO] org.hibernate.tool.hbm2ddl.SchemaUpdate - schema update complete
14-07-06 12:38:16,216 [INFO] br.com.caelum.vraptor.view.LinkToHandler - Registering linkTo component
Jul 06, 2014 12:38:16 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter vraptor
com.google.inject.CreationException: Guice creation errors: