This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 189697 - JPA application does not run on WebLogic with TopLink provider because of the generated metamodel
Summary: JPA application does not run on WebLogic with TopLink provider because of the...
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Persistence (show other bugs)
Version: 6.x
Hardware: PC All
: P2 normal (vote)
Assignee: Sergey Petrov
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-19 21:41 UTC by Petr Jiricka
Modified: 2010-08-21 03:42 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Jiricka 2010-08-19 21:41:47 UTC
1. Register WebLogic 10.3.3
2. In the WebLogic admin console, change default persistence provider to
TopLink
3. Create new Java EE 5 web application with WebLogic as the target server, with JSF 2.0 framework included
4. Create a Entity classes from database. EclipseLink persistence provider will be used and this will be a JPA 1.0 project.
5. Create JSF pages from these entities.
6. Run the application
7. Access one of the pages with the list of entities.

An exception similar to this will be thrown by the server:
Caused by: java.lang.RuntimeException: Uncompilable source code - cannot find symbol
  symbol: class StaticMetamodel
        at entities.Customer_.<clinit>(Customer_.java:9)
        ... 63 more

This is because the canonical metamodel was generated, but can not be used as the JPA 2.0 API is not available.

Some information:
- EclipseLink was added to the processor classpath by the IDE
- Ant clean + build passes and no canonical metamodel is generated
- One possible workaround is to turn off deploy on save
Comment 1 Sergey Petrov 2010-08-20 10:21:44 UTC
I was able to execute application with eclipselink removed from nb, so likely it can be fixed by splitting eclipselink library.
Comment 2 Sergey Petrov 2010-08-20 10:46:42 UTC
fast fix I can push immediately is just remove modelgen jar, 
http://hg.netbeans.org/web-main/rev/3ab06bacb081

need to create separate library for modelgen now and add it for jpa2.0 cases automatically.
Comment 3 Petr Jiricka 2010-08-20 11:06:46 UTC
> need to create separate library for modelgen now

Agreed, but let's put this new library to the same module (j2ee.eclipselink), please do not create a separate module for it.
Comment 4 Sergey Petrov 2010-08-20 13:41:41 UTC
http://hg.netbeans.org/web-main/rev/2f492acb7888

it may need additional adjustments,
but now there are 2 libs, and it may help users to handle modelgen manually too, if they want metamodel generation no more need to remember ap classname and or/serach for jar, also easy to remove.
in current realization modelgen jar is aumomatically added to processors classpath only and only for jpa2.0.
Comment 5 Quality Engineering 2010-08-21 03:42:00 UTC
Integrated into 'main-golden', will be available in build *201008210001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/3ab06bacb081
User: Sergey B. Petrov <sj-nb@netbeans.org>
Log: #189697 - part fix, but also all should work now, model gen is remove, will be moved to separate library as second part of the fix