Entity inside jar

67 views
Skip to first unread message

Thiago Magro

unread,
Feb 5, 2010, 10:13:39 AM2/5/10
to play-fr...@googlegroups.com
Hi guys,

Ive getting a exception when I try to persist a Entity that is inside a jar.
Saying play.exceptions.JavaExecutionException: Unknown entity.
Is there any problem to have a jar with entity models?

Tks,

Thiago

Guillaume Bort

unread,
Feb 6, 2010, 4:42:36 PM2/6/10
to play-fr...@googlegroups.com
Hi,

You should report the bug. It's not really supported, but I've pushed
a fix in 1.0-854. Try to declare something like:

jpa.entities=com.xxx.User,com.xxx.Group

In your application.conf file. It will of course only work with plain
entities (not extending play JPASupport).

> --
> You received this message because you are subscribed to the Google Groups
> "play-framework" group.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to
> play-framewor...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/play-framework?hl=en.
>

Simon James

unread,
Feb 9, 2010, 6:21:52 AM2/9/10
to play-framework
Hi

One point to note.
I think you have to have a space between the class names, for example:

jpa.entities=com.xxx.User, com.xxx.Group

The code splits the property value using the regex ", "

Regards

Simon

Thiago Magro

unread,
Mar 5, 2010, 2:34:56 PM3/5/10
to play-fr...@googlegroups.com
Im usind the version 1.1-unstable-r806, and its still not working.
Ive placed all the class that have @Entity annotation inside de app.conf, like Guillaume said, but stills saying that the JPA context is not initialized.

Any other recommendations?

Tks!

Thiago

Guillaume Bort

unread,
Mar 7, 2010, 11:29:57 AM3/7/10
to play-fr...@googlegroups.com
What is the configuration you added to application.conf exactly?

Thiago Magro

unread,
Mar 8, 2010, 8:55:44 AM3/8/10
to play-fr...@googlegroups.com
I have add the property as you mention:

jpa.entities=br.com.banif.talk.models.Area, br.com.banif.talk.models.Article, br.com.banif.talk.models.Category

to the application.conf

Is there anything else to do?

Tks,

Thiago

Guillaume Bort

unread,
Mar 8, 2010, 12:51:56 PM3/8/10
to play-fr...@googlegroups.com
Can you set your log level to TRACE or debug into the JPAPlugin to see
why these classes are not loaded by the entityManager?

Thiago Magro

unread,
Mar 9, 2010, 8:00:34 AM3/9/10
to play-fr...@googlegroups.com
Hi Guilaume, Ive setted to TRACE, results below:
Apparently the they dont load the classes ive specified on the jpa.entities:

###JPA ENTITIES INSIDE application.conf
jpa.entities=br.com.banif.entity.Area, br.com.banif.entity.Article, br.com.banif.entity.Category, br.com.banif.entity.ChatService, br.com.banif.entity.Client, br.com.banif.entity.ClientEffective, br.com.banif.entity.Command, br.com.banif.entity.CustomMessage, br.com.banif.entity.EmailService, br.com.banif.entity.Log, br.com.banif.entity.Mail, br.com.banif.entity.Message, br.com.banif.entity.Operator, br.com.banif.entity.PhoneService, br.com.banif.entity.Priority, br.com.banif.entity.Profile, br.com.banif.entity.Status, br.com.banif.entity.Tag, br.com.banif.entity.Ticket


###LOG TRACE
/home/thiagomagro/Softwares/play/id doesn't exist
Listening for transport dt_socket at address: 8000
09:57:17,221 INFO  ~ Starting /host/Projetos/Talkv2/baniftalkplay
09:57:17,224 TRACE ~ Using /host/Projetos/Talkv2/baniftalkplay/tmp as tmp dir
09:57:17,227 INFO  ~ Module secure is available (/home/thiagomagro/Softwares/play/modules/secure)
09:57:17,328 TRACE ~ Loading plugins
09:57:17,329 TRACE ~ Found one plugins descriptor, file:/home/thiagomagro/Softwares/play/modules/docviewer/app/play.plugins
09:57:17,350 TRACE ~ Bytecode too old (db61108fba973262f678c7b8215d970 != bf8220c6a7e424a7db5590a9d1421)
09:57:17,790 TRACE ~ Compiled DocViewerPlugin
09:57:17,790 TRACE ~ 440ms to compile class DocViewerPlugin
09:57:17,851 TRACE ~ 61ms to apply SigEnhancer to DocViewerPlugin
09:57:17,861 TRACE ~ 10ms to apply ControllersEnhancer to DocViewerPlugin
09:57:17,867 TRACE ~ 6ms to apply MailerEnhancer to DocViewerPlugin
09:57:17,955 TRACE ~ 88ms to apply PropertiesEnhancer to DocViewerPlugin
09:57:17,959 TRACE ~ 4ms to apply JPAEnhancer to DocViewerPlugin
09:57:17,965 TRACE ~ 5ms to apply LocalvariablesNamesEnhancer to DocViewerPlugin
09:57:17,967 TRACE ~ DocViewerPlugin cached
09:57:17,967 TRACE ~ 637ms to load class DocViewerPlugin
09:57:17,978 TRACE ~ Loaded plugin DocViewerPlugin@5c74cb02
09:57:17,978 TRACE ~ Found one plugins descriptor, jar:file:/home/thiagomagro/Softwares/play/framework/play.jar!/play.plugins
09:57:17,980 TRACE ~ Loaded plugin play.CorePlugin@7bafb0c7
09:57:17,986 TRACE ~ Loaded plugin play.data.parsing.TempFilePlugin@1e670479
09:57:17,987 TRACE ~ Loaded plugin play.data.validation.ValidationPlugin@25cbfa42
09:57:17,989 TRACE ~ Loaded plugin play.db.DBPlugin@4ee14d81
09:57:17,993 TRACE ~ Loaded plugin play.db.jpa.JPAPlugin@f35f44e
09:57:17,994 TRACE ~ Loaded plugin play.i18n.MessagesPlugin@4e1263db
09:57:18,052 TRACE ~ Loaded plugin play.libs.WS@79b4748
09:57:18,054 TRACE ~ Loaded plugin play.jobs.JobsPlugin@7a2431b9
09:57:18,054 TRACE ~ Found one plugins descriptor, jar:file:/home/thiagomagro/Softwares/play/framework/lib/ZDB.jar!/play.plugins
09:57:18,055 TRACE ~ Loaded plugin play.db.zdb.ZDBPlugin@4f682a53
09:57:18,055 WARN  ~ You're running Play! in DEV mode
09:57:18,160 INFO  ~ Listening for HTTP on port 9000 (Waiting a first request to start) ...
09:57:25,401 TRACE ~ 31ms to load template /conf/routes from cache
09:57:26,328 TRACE ~ 135ms to render template /conf/routes
09:57:26,340 TRACE ~ Adding [GET / -> Application.index] with params [null] and headers []
09:57:26,340 TRACE ~ Adding [GET /client -> ClientController.index] with params [null] and headers []
09:57:26,341 TRACE ~ Adding [GET /client/{action} -> ClientController.{action}] with params [null] and headers []
09:57:26,342 TRACE ~ Adding [GET /operator -> OperatorController.index] with params [null] and headers []
09:57:26,342 TRACE ~ Adding [GET /operator/{action} -> OperatorController.{action}] with params [null] and headers []
09:57:26,342 TRACE ~ Adding [GET /public/ -> staticDir:public] with params [null] and headers []
09:57:26,343 TRACE ~ Adding [* /{controller}/{action} -> {controller}.{action}] with params [null] and headers []
09:57:26,344 TRACE ~ Adding [GET /@documentation/? -> PlayDocumentation.index] with params [null] and headers [null]
09:57:26,344 TRACE ~ Adding [GET /@documentation/{id} -> PlayDocumentation.page] with params [null] and headers [null]
09:57:26,344 TRACE ~ Adding [GET /@documentation/images/{name} -> PlayDocumentation.image] with params [null] and headers [null]
09:57:26,345 TRACE ~ Adding [GET /@documentation/files/{name} -> PlayDocumentation.file] with params [null] and headers [null]
09:57:26,345 TRACE ~ Adding [GET /@documentation/modules/{module}/{id} -> PlayDocumentation.page] with params [null] and headers [null]
09:57:26,346 TRACE ~ Adding [GET /@documentation/modules/{module}/images/{name} -> PlayDocumentation.image] with params [null] and headers [null]
09:57:26,364 TRACE ~ Bytecode too old (bf8220c6a7e424a7db5590a9d1421 != db61108fba973262f678c7b8215d970)
09:57:26,365 TRACE ~ 1ms to apply SigEnhancer to DocViewerPlugin
09:57:26,368 TRACE ~ 3ms to apply ControllersEnhancer to DocViewerPlugin
09:57:26,370 TRACE ~ 2ms to apply MailerEnhancer to DocViewerPlugin
09:57:26,414 TRACE ~ 43ms to apply PropertiesEnhancer to DocViewerPlugin
09:57:26,416 TRACE ~ 2ms to apply JPAEnhancer to DocViewerPlugin
09:57:26,419 TRACE ~ 2ms to apply LocalvariablesNamesEnhancer to DocViewerPlugin
09:57:26,420 TRACE ~ 0ms to apply play.CorePlugin@7bafb0c7 to DocViewerPlugin
09:57:26,420 TRACE ~ 0ms to apply play.data.parsing.TempFilePlugin@1e670479 to DocViewerPlugin
09:57:26,420 TRACE ~ 0ms to apply play.data.validation.ValidationPlugin@25cbfa42 to DocViewerPlugin
09:57:26,420 TRACE ~ 0ms to apply play.db.DBPlugin@4ee14d81 to DocViewerPlugin
09:57:26,420 TRACE ~ 0ms to apply play.db.jpa.JPAPlugin@f35f44e to DocViewerPlugin
09:57:26,426 TRACE ~ 6ms to apply play.db.zdb.ZDBPlugin@4f682a53 to DocViewerPlugin
09:57:26,426 TRACE ~ 0ms to apply play.i18n.MessagesPlugin@4e1263db to DocViewerPlugin
09:57:26,427 TRACE ~ 0ms to apply play.libs.WS@79b4748 to DocViewerPlugin
09:57:26,427 TRACE ~ 0ms to apply play.jobs.JobsPlugin@7a2431b9 to DocViewerPlugin
09:57:26,427 TRACE ~ 0ms to apply DocViewerPlugin@5c74cb02 to DocViewerPlugin
09:57:26,429 TRACE ~ DocViewerPlugin cached
09:57:26,429 TRACE ~ 66ms to load class DocViewerPlugin
09:57:26,523 TRACE ~ Compiled controllers.Application
09:57:26,628 TRACE ~ Compiled controllers.ClientController
09:57:26,676 TRACE ~ Compiled controllers.ClientSecurity
09:57:26,701 TRACE ~ Compiled controllers.OperatorController
09:57:26,707 TRACE ~ Compiled controllers.OperatorSecurity
09:57:26,730 TRACE ~ Compiled dispatcher.ClientDispatcher
09:57:26,732 TRACE ~ Compiled dispatcher.CommandsPool
09:57:26,733 TRACE ~ Compiled dispatcher.DispatcherInterface
09:57:26,741 TRACE ~ Compiled dispatcher.OperatorDispatcher
09:57:26,750 TRACE ~ Compiled dispatcher.ServerDispatcher
09:57:26,763 TRACE ~ Compiled jobs.ClientThread
09:57:26,769 TRACE ~ Compiled jobs.ClientThreadPool
09:57:26,779 TRACE ~ Compiled jobs.ConnectSocket
09:57:26,783 TRACE ~ Compiled jobs.OperatorThread
09:57:26,785 TRACE ~ Compiled jobs.OperatorThreadPool
09:57:26,816 TRACE ~ Compiled jobs.SocketClient
09:57:26,871 TRACE ~ Compiled jobs.Startup
09:57:26,933 TRACE ~ Compiled parser.CommandParser
09:57:26,954 TRACE ~ Compiled controllers.Check
09:57:27,024 TRACE ~ Compiled controllers.Secure$Security
09:57:27,025 TRACE ~ Compiled controllers.Secure
09:57:27,098 TRACE ~ Compiled controllers.PlayDocumentation
09:57:27,102 TRACE ~ 4ms to load class controllers.ClientSecurity from cache
09:57:27,103 TRACE ~ 1ms to load class dispatcher.DispatcherInterface from cache
09:57:27,105 TRACE ~ 1ms to load class parser.CommandParser from cache
09:57:27,106 TRACE ~ 1ms to load class controllers.OperatorSecurity from cache
09:57:27,107 TRACE ~ 1ms to load class dispatcher.CommandsPool from cache
09:57:27,109 TRACE ~ 2ms to load class jobs.ClientThread from cache
09:57:27,111 TRACE ~ 2ms to load class jobs.Startup from cache
09:57:27,113 TRACE ~ 1ms to load class dispatcher.ServerDispatcher from cache
09:57:27,115 TRACE ~ 2ms to load class dispatcher.OperatorDispatcher from cache
09:57:27,116 TRACE ~ 1ms to load class controllers.Check from cache
09:57:27,118 TRACE ~ 2ms to load class jobs.SocketClient from cache
09:57:27,119 TRACE ~ 1ms to load class jobs.OperatorThread from cache
09:57:27,121 TRACE ~ 2ms to load class controllers.ClientController from cache
09:57:27,122 TRACE ~ 1ms to load class jobs.OperatorThreadPool from cache
09:57:27,123 TRACE ~ 1ms to load class controllers.Secure from cache
09:57:27,125 TRACE ~ 2ms to load class dispatcher.ClientDispatcher from cache
09:57:27,126 TRACE ~ 1ms to load class controllers.OperatorController from cache
09:57:27,127 TRACE ~ 1ms to load class jobs.ConnectSocket from cache
09:57:27,129 TRACE ~ 2ms to load class controllers.Secure$Security from cache
09:57:27,130 TRACE ~ 1ms to load class jobs.ClientThreadPool from cache
09:57:27,131 TRACE ~ 1ms to load class controllers.PlayDocumentation from cache
09:57:27,132 TRACE ~ 1ms to load class controllers.Application from cache
09:57:27,757 INFO  ~ Connected to jdbc:oracle:thin:@(DESCRIPTION = (ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.10.10.48)(PORT=1521))) (CONNECT_DATA =(SERVER=DEDICATED)(SERVICE_NAME = BANIF)))
09:57:27,832 INFO  ~ Application 'BanifTalk' is now started !
09:57:27,864 TRACE ~ Releasing http client connections...
09:57:28,122 INFO  ~ Socket new Msg: Server accepted connection
09:57:28,130 TRACE ~ ------- public static void controllers.ClientSecurity.login()
09:57:28,152 INFO  ~ Login
[Fatal Error] :1:1: Content is not allowed in prolog.
09:57:28,171 ERROR ~ Content is not allowed in prolog.
09:57:28,173 TRACE ~ 19ms to load template /app/views/ClientSecurity/login.html from cache
09:57:28,214 TRACE ~ 3ms to load template /app/views/main.html from cache
09:57:28,232 TRACE ~ 47ms to render template /app/views/ClientSecurity/login.html
09:57:28,468 TRACE ~ 12ms to render template /app/views/main.html
09:57:28,474 TRACE ~ Invoke: /clientsecurity/login: 200
09:57:28,530 TRACE ~ Releasing http client connections...
09:57:28,686 TRACE ~ Releasing http client connections...
09:57:28,704 TRACE ~ Releasing http client connections...
09:57:28,732 TRACE ~ Releasing http client connections...
09:57:28,750 TRACE ~ Releasing http client connections...
09:57:28,779 TRACE ~ Releasing http client connections...
09:57:28,805 TRACE ~ Releasing http client connections...
09:57:28,851 TRACE ~ Releasing http client connections...


Any suggestions?

Thanks,

Thiago

Guillaume Bort

unread,
Mar 9, 2010, 12:56:52 PM3/9/10
to play-fr...@googlegroups.com
Ah,

Do you have any other entity in your application? Because the JPA
plugin starts only if it find any classe annotated with @Entity in the
application. Perhaps it is the problem...

Thiago Magro

unread,
Mar 9, 2010, 2:51:21 PM3/9/10
to play-fr...@googlegroups.com
Worked!
Thanks!
Is there any plans to avoid this mandatory class with @Entity on the models package?
I mean, is there other way to force the start of the JPA plugin?

Thanks again.

Thiago

Guillaume Bort

unread,
Mar 9, 2010, 3:07:05 PM3/9/10
to play-fr...@googlegroups.com
Yes please report the bug. 
Reply all
Reply to author
Forward
0 new messages