Eclipse not creating JPA entities from table - eclipse

I'm using Eclipse Juno, Hibernate 4.0 and MSSQL 2008.
I've created a database and have just gone through the process "JPA Entities from Tables" in Eclipse. About half of the tables did not get created (even though I selected those table), but the classes were added to persistence.xml.
Has anyone else experienced this problem? Do you have a solution?

In my case the database was Oracle XE. So mine is a bit different case but may be helpful to someone.
The best way to find the problem with this is to check the logs of workspace present at $workspace_location/.metadata/.log file. In my case I found that there were 3 problems:
1) Caused by: java.io.FileNotFoundException: $MiddlewarePath\oracle_common\modules\oracle.adf.share_11.1.1\adfsharembean.jar (Access is denied)
2) Caused by: java.io.FileNotFoundException: $MiddlewarePath\oracle_common\modules\oracle.ldap_11.1.1\jremtool.jar (Access is denied)
3) !MESSAGE Unable to find JPA entities generation templates in pluginorg.eclipse.jpt.jpa.gen
!STACK 1
Java Model Exception: Core Exception [code 275] A resource exists with a different case: '/TestJPAProjectFacetsEJB/src/main/java/com/domainname/ejb/TestJPAProjectFacets'.
Hence I did the following:
1) Provided access permission for the jar files
2) While I was generating entities I was giving the package name as com/domainname/ejb/testjpaprojectfacets/model. But I was already having a package com/domainname/ejb/TestJPAProjectFacets hence the error. I then renamed my existing package to all lowercase (com/domainname/ejb/testjpaprojectfacets) and it worked.
Thanks,
Sanjay

My workaround was to use the JTDS JDBC Driver to connect to SQL Server database instead of the Microsoft SQL Server JDBC Driver

This sounds like Eclipse DTP bug 282206. Dali (the Eclipse project that supplies the Entity Generation wizard you are using) depends on the Eclipse DTP project for retrieving from various database servers the necessary meta-data to generate entities. The MS SQL Server "driver" you are using (i.e. the plug-in used by DTP to adapt the MS SQL JDBC driver to the DTP SPI interfaces - by default this plug-in is org.eclipse.datatools.enablement.msft.sqlserver... - it is a bit confusing that the DTP developers like to call these plug-ins "drivers"....) has a bug in the meta-data it returns to Dali, preventing Dali from generating entities.

I faced this issue too.
My workaround - Created the database in MySQL and generated entities from there. The generated entity classes work with SQL Server as well. Not faced any other side-effects (so far)

Related

Can not start container in Drools workbench when rules generated from spreadsheet

In a project of Drools workbench, when rules are input with "Guided Rule", I can start the container correctly. But when rules are generated from spreadsheet (an *.xls file), I got the following error:
org.kie.server.services.impl.KieServerImpl createContainer
SEVERE: Error creating container 'firstApplicationTestCon' for module 'ppdrools:firstApplicationTestProj:1.0'
java.lang.IllegalArgumentException: Unable to instantiate service for Class 'org.drools.compiler.compiler.DecisionTableProvider'
Did I miss something? Why did I fail to start the container while I can build the project successfully?
Hmm, it's a known bug. See the posts below:
[ENG] (6.1.z) Decision Table Spreadsheet on Execution Server
BZ-1214927: adding decision tables jar dependency to kie-server
And a duplicated bug report here on 2015-05-28:
Bug 1225979 - Kie sever starting error - ClassNotFoundException: org.drools.decisiontable.DecisionTableProviderImpl
Since this bug is reported and verified after 2015-03-05, which is the day 6.2 released, I think it's not solved yet. I'll have a try on 6.3.0.Beta2 later.

Crystaldecisions ReportSDKIllegalArgumentException

I am currently working on a migration of BO 4.1 related tool.
The tool is used to deploy the crystal reports from drop location to BO Server. The tool was developed using BO XI 3.1 Java SDK code and will be migrated to BI 4.1.
In the code it is getting IInfoObjects instance by querying infoStore.
Query used
"SELECT TOP 1 * FROM CI_INFOOBJECTS WHERE SI_KIND='CrystalReport' AND SI_NAME ='XXXX' AND SI_INSTANCE = 0"
There is no infoObjects available currently and the code hence create a new infoObjects collection by using
infoStore.newInfoObjectCollection();
Further the code will create IReport using the following code
IReport report = (IReport) infoObjects.add(pluginInfo);
During this execution I am getting following exception
Exception in thread "main" java.lang.NoClassDefFoundError:
com/crystaldecisions/sdk/occa/report/lib/ReportSDKIllegalArgumentException
at
com.crystaldecisions.sdk.plugin.desktop.report.internal.ReportFactory.makePlugin(ReportFactory.java:83)
at
com.crystaldecisions.sdk.occa.pluginmgr.internal.PluginMgr.getPluginInterface(PluginMgr.java:349)
at
com.crystaldecisions.sdk.occa.infostore.internal.InfoObjects.add_aroundBody0(InfoObjects.java:775)
at
com.crystaldecisions.sdk.occa.infostore.internal.InfoObjects.add_aroundBody1$advice(InfoObjects.java:512)
at
com.crystaldecisions.sdk.occa.infostore.internal.InfoObjects.add(InfoObjects.java:1)
I searched around for the exception and it appears some jar mismatch issue, but could not understand which jar and where can I find those jars.
Any suggestion will be helpful.
Include CrystalReportsSDK.jar in your project.
There are a number of utilities to help with finding jar files for missing classes. I prefer the cheap approach -- just do unzip -l *.jar > jars.txt from a jar directory, then search jars.txt for the missing class.
Thanks! Adding the jar helped me to resolve the problem.
To answer the second question that I asked, about the location of the jars
{Installation loc}/opt/businessobjects/bo41/sap_bobj/enterprise_xi40/java/lib

java.lang.StackOverflowError in context with UCanAccess and JPA

When I try to perform a JPA-Query, the UCanAccess Driver quits with a java.lang.StackOverflowError.
This used call is as simple as can be. With another Table this db request works fine.
final Tbltitel entity = (Tbltitel) entityManager.createNamedQuery("Tbltitel.findById")
.setParameter("id", new Integer(14199)).getSingleResult();
The call with plain JDBC and the call via Jackcess against this table works also fine, so I guess, something went wrong with the UCanAccess Driver in Context with JPA.
A complete Eclipse Project with the Database and the JUnit Tests can be downloaded at "https://app.box.com/s/mun1se9y7gji24kg6xrx"
My set up:
Windows 7 Professional 64 bit
Microsoft Office 2013
NetBeans IDE 8.0
Java 1.8
UCanAccess-2.0.7-bin
As I said this issue seems to be related to EclipseLink and not to UCanAccess.
Setting the annotation #Cacheable(false) on the class Tbllistofvalues, which is autoreferential, should solve the issue.

Redgate's SQL Dependency tracker does not show the dependencies for some databases...Why?

Redgate's SQL Dependency tracker does not show the dependencies for some databases...Why?These databases have tables,stored procs etc and I have all rights to the database.
You have to click the button to resolve external references. If it's not that, it's database-specific and time to get in touch with support.
For this particular database> right click on it.> go to properties>Options>
The compatibility level was set to SQL Server 7.0.
Changed the compatibility level to SQL Server 2005(90)
Now i am able to view the dependencies.
This is how i resolved the issue.
Finding out the external references is a total different scenario.
Sometimes some databases may not have any external references at all.
Solution to this has been posted on this blog: http://sqldeveloper9999.wordpress.com/2013/10/18/redgates-sql-dependency-tracker-does-not-show-dependencies-on-a-few-databases/

Getting error Named query not found: UnescalatedDeadlines

I'm trying to create a jbpm human task web application and deployed it in jboss as 7.
Adhering to the deployment structure i have placed the orm.xml in resources META-INF folder along with persistent.xml and it's having the required unescalateddealines named query. But still im getting the exception
Caused by: java.lang.IllegalArgumentException: Named query not found: UnescalatedDeadlines
at org.hibernate.ejb.AbstractEntityManagerImpl.createNamedQuery(AbstractEntityManagerImpl.java:108) [hibernate-entitymanager-3.4.0.GA.jar:]
at org.jbpm.task.service.TaskService.<init>(TaskService.java:109) [jbpm-human-task-5.1.0.Final.jar:]
at org.jbpm.task.service.TaskService.<init>(TaskService.java:92) [jbpm-human-task-5.1.0.Final.jar:]
at com.sample.taskserver.HumanTaskStartupServlet.init(HumanTaskStartupServlet.java:52) [classes:]
In nutshell, the orm.xml file is not being identified by hibernate.
what's the configuration that im missing or what could be the problem.
kindly help me in this regard.
It's probably best to add direct references to the orm files you're using, to make sure they are being picked up. For example, in your persistence.xml you could add the following:
<mapping-file>META-INF/Taskorm.xml</mapping-file>
Do you have multiple orm.xml files inside your application? Probably JBoss AS is just picking one. Usually if you merge those files it will work.
Cheers
I had the same problem, but I solved it.
My jbpm version is 5.3.
I deployed and set it up according to the guide.
I used two persistent-unit, one for jbpm/process and one for task.
I have this taskorm.xml, but in some situation jbpm will only search jbpm persistent-unit.
but taskorm.xml is defined in task unit.
You need to combine it into one.
For me I am using jbpm 5.4.0.FINAL but referred to the example with bundled presistence.xml having only orm.xml
Added Taskorm.xml resovled the problem