Модераторы: LSD, AntonSaburov
  

Поиск:

Ответ в темуСоздание новой темы Создание опроса
> Помогите разобраться в чем ошибка? 
:(
    Опции темы
Жоржик
Дата 22.7.2011, 12:11 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Новичок



Профиль
Группа: Участник
Сообщений: 31
Регистрация: 20.2.2011

Репутация: нет
Всего: нет



Здравствуйте! В программе использую Hibernate (JPA). Не могу понять в чем проблема...

Код

package entity.bulletin.board;
 
import java.util.ArrayList;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
 
public class Connection {
        private List<Posts> poster;
        private EntityManagerFactory factory;
        private EntityManager manager;
 
        @SuppressWarnings("finally")
        public List<Posts> showPoster(){
                try{
                        poster = new ArrayList<Posts>();
                        factory = Persistence.createEntityManagerFactory("TheBulletinBoard");
                        manager = factory.createEntityManager();
                        int i = 0;
                        while (manager.find(Posts.class, i)!=null) {
                                poster.add(manager.find(Posts.class, i));
                                i++;                            
                        }
                }
                catch (Exception e){
                        
                }
                finally{
                        if (manager != null) manager.close();
                        if (factory != null) factory.close();
                        return poster;
                }
        }
}


22.07.2011 11:53:44 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: /usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/i386/client:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/i386:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/../lib/i386:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/i386/client:/usr/lib/jvm/java-6-sun-1.6.0.26/jre/lib/i386::/usr/java/packages/lib/i386:/lib:/usr/lib
22.07.2011 11:53:44 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:TheBulletinBoard' did not find a matching property.
22.07.2011 11:53:45 org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
22.07.2011 11:53:45 org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
22.07.2011 11:53:45 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 1193 ms
22.07.2011 11:53:45 org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
22.07.2011 11:53:45 org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.16
22.07.2011 11:53:46 org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
22.07.2011 11:53:46 org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
22.07.2011 11:53:46 org.apache.catalina.startup.Catalina start
INFO: Server startup in 1854 ms
290 ["http-bio-8080"-exec-3] INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.2.0.Final
304 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.Environment - Hibernate 3.6.5.Final
307 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.Environment - hibernate.properties not found
320 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
327 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
479 ["http-bio-8080"-exec-3] INFO org.hibernate.ejb.Version - Hibernate EntityManager 3.6.5.Final
986 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: entity.bulletin.board.City
1081 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity entity.bulletin.board.City on table city
1262 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: entity.bulletin.board.Comments
1263 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity entity.bulletin.board.Comments on table comments
1307 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: entity.bulletin.board.Posts
1307 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity entity.bulletin.board.Posts on table posts
1314 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: entity.bulletin.board.Users
1314 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity entity.bulletin.board.Users on table users
1376 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.annotations.CollectionBinder - Mapping collection: entity.bulletin.board.City.userses -> users
1391 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.annotations.CollectionBinder - Mapping collection: entity.bulletin.board.Posts.commentses -> comments
1392 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.annotations.CollectionBinder - Mapping collection: entity.bulletin.board.Users.commentses -> comments
1392 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.annotations.CollectionBinder - Mapping collection: entity.bulletin.board.Users.postses -> posts
1396 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.Configuration - Hibernate Validator not found: ignoring
1458 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.search.HibernateSearchEventListenerRegister - Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
1471 ["http-bio-8080"-exec-3] INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
1472 ["http-bio-8080"-exec-3] INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 20
1472 ["http-bio-8080"-exec-3] INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: true
1485 ["http-bio-8080"-exec-3] INFO org.hibernate.connection.DriverManagerConnectionProvider - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:3306/bulletin_board
1485 ["http-bio-8080"-exec-3] INFO org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=root, password=****, autocommit=true, release_mode=auto}
2254 ["http-bio-8080"-exec-3] INFO org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.MySQLDialect
2284 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - Database ->
name : MySQL
version : 5.1.54-1ubuntu4
major : 5
minor : 1
2284 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - Driver ->
name : MySQL-AB JDBC Driver
version : mysql-connector-java-5.1.17 ( Revision: ${bzr.revision-id} )
major : 5
minor : 1
2287 ["http-bio-8080"-exec-3] INFO org.hibernate.transaction.TransactionFactoryFactory - Using default transaction strategy (direct JDBC transactions)
2290 ["http-bio-8080"-exec-3] INFO org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
2290 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled
2290 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled
2291 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - JDBC batch size: 15
2291 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled
2300 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled
2300 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): enabled
2300 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - Connection release mode: auto
2301 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - Maximum outer join fetch depth: 2
2301 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1
2301 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled
2302 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled
2302 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - Order SQL inserts for batching: disabled
2302 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
2305 ["http-bio-8080"-exec-3] INFO org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory
2305 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - Query language substitutions: {}
2305 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: enabled
2305 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - Second-level cache: enabled
2305 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - Query cache: disabled
2305 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory
2307 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled
2307 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled
2317 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - Statistics: disabled
2317 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled
2317 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo
2317 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - Named query checking : enabled
2318 ["http-bio-8080"-exec-3] INFO org.hibernate.cfg.SettingsFactory - Check Nullability in Core (should be disabled when Bean Validation is on): enabled
2350 ["http-bio-8080"-exec-3] INFO org.hibernate.impl.SessionFactoryImpl - building session factory
2365 ["http-bio-8080"-exec-3] INFO org.hibernate.type.BasicTypeRegistry - Type registration [materialized_clob] overrides previous : org.hibernate.type.MaterializedClobType@7881db
2366 ["http-bio-8080"-exec-3] INFO org.hibernate.type.BasicTypeRegistry - Type registration [wrapper_materialized_blob] overrides previous : org.hibernate.type.WrappedMaterializedBlobType@1956391
2366 ["http-bio-8080"-exec-3] INFO org.hibernate.type.BasicTypeRegistry - Type registration [characters_clob] overrides previous : org.hibernate.type.PrimitiveCharacterArrayClobType@bbf7aa
2366 ["http-bio-8080"-exec-3] INFO org.hibernate.type.BasicTypeRegistry - Type registration [blob] overrides previous : org.hibernate.type.BlobType@80ed90
2366 ["http-bio-8080"-exec-3] INFO org.hibernate.type.BasicTypeRegistry - Type registration [java.sql.Blob] overrides previous : org.hibernate.type.BlobType@80ed90
2366 ["http-bio-8080"-exec-3] INFO org.hibernate.type.BasicTypeRegistry - Type registration [clob] overrides previous : org.hibernate.type.ClobType@6cc2a4
2366 ["http-bio-8080"-exec-3] INFO org.hibernate.type.BasicTypeRegistry - Type registration [java.sql.Clob] overrides previous : org.hibernate.type.ClobType@6cc2a4
2366 ["http-bio-8080"-exec-3] INFO org.hibernate.type.BasicTypeRegistry - Type registration [materialized_blob] overrides previous : org.hibernate.type.MaterializedBlobType@5ead9d
2367 ["http-bio-8080"-exec-3] INFO org.hibernate.type.BasicTypeRegistry - Type registration [wrapper_characters_clob] overrides previous : org.hibernate.type.CharacterArrayClobType@1d8417c
2792 ["http-bio-8080"-exec-3] INFO org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured

PM MAIL   Вверх
v2v
Дата 22.7.2011, 13:21 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Эксперт
***


Профиль
Группа: Завсегдатай
Сообщений: 1620
Регистрация: 20.9.2006
Где: Киев

Репутация: 9
Всего: 56



Цитата

 Not binding factory to JNDI, no JNDI name configured 

а как ты подгружаешь конфигурацию?


--------------------
PM   Вверх
  
Ответ в темуСоздание новой темы Создание опроса
Правила форума "Java"
LSD   AntonSaburov
powerOn   tux
  • Прежде, чем задать вопрос, прочтите это!
  • Книги по Java собираются здесь.
  • Документация и ресурсы по Java находятся здесь.
  • Используйте теги [code=java][/code] для подсветки кода. Используйтe чекбокс "транслит", если у Вас нет русских шрифтов.
  • Помечайте свой вопрос как решённый, если на него получен ответ. Ссылка "Пометить как решённый" находится над первым постом.
  • Действия модераторов можно обсудить здесь.
  • FAQ раздела лежит здесь.

Если Вам помогли, и атмосфера форума Вам понравилась, то заходите к нам чаще! С уважением, LSD, AntonSaburov, powerOn, tux.

 
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | Java EE (J2EE) и Spring | Следующая тема »


 




[ Время генерации скрипта: 0.0467 ]   [ Использовано запросов: 22 ]   [ GZIP включён ]


Реклама на сайте     Информационное спонсорство

 
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности     Powered by Invision Power Board(R) 1.3 © 2003  IPS, Inc.