glassfish 4.0 jpa resource - jpa

I try to deploy my application but I still get deployment errors. I created connection pool succesfully (I can even create entities from tables using JPA Tools in Eclipse).
As you can see I've also created a JDBC Resource in Glassfish admin panel called sellyourthingres. When I use "sellyourthingres" instead of "sellyourthing" in persitance.xml nothing changes and i got exactly the same errors (with different name of course). Choosing JTA/JTA(default) doesn't change anything.
What should I do?

Related

Netbeans Entity classes from database wizard fails

My setup:
Netbeans 16 on windows 11
Mysql server 8
mysql-connector-java-8.0.30.jar
OpenJDK 64-Bit Server VM Microsoft-40354 (build 17.0.4.1+1-LTS, mixed mode, sharing)
Payara server 5.2 configured in Netbeans.
I have a legacy web application which uses Jdbc resources and connection pools defined in domain.xml inside Payara.
When I deploy the application it works correctly and can access the data in Mysql.
I need to add some new entities and I launch Entity classes from database wizard but it fails.
I had weird problems with that wizard in the past months but since then I changed computer reinstalling everything from scratch and the wizard doesn't work any more.
At step 2 I select a datasource which comes from Payara's domain.xml and an error is immediately reported:
Unable to find driver com.mysql.cj.jdbc.MysqlDataSource. Register this driver in databases tab
I think it refers to Tab Services, Databases tree node, drivers. Unfortunately I cannot add class MysqlDataSource there because it only accepts driver classes.
What can I do ?
I found two possible workarounds.
Temporarily remove the Payara server from Netbeans.
Now the Datasource select box is not populated from domain.xml
so you can finally choose a database connection already defined inside Netbeans or create a new one with "New datasource..."
Open domain.xml, search for the Jdbc connection pool you are going to use and add valid URL and driverClass properties

Whille deploying RESTful webservice, Shows error JdbcDataSource. not found

I have been trying to create my first RESTful execrcise using. But I am unable to deploy module due to error "com.sun.appserv.connectors.internal.api.ConnectorRuntimeException: Invalid resource : jdbc/playerDB__pm"
I checked and I have JNDI, daata source created.
Unlike specified in link. I am using:
-Netbeans 8.0.3, Java EE 7, GlassFish Server 4.
Also I have checked GlassFish is running fine.
Edit 1:
I have re-checked my 'Services' tab, and I could not find jdbc/__playedDB ,even though I have created it.
Its a bug, the JDBC resource file is not being created (atleast with versions I am using: GlassFish 4.1, Netbeans 8.0.2). Using GlassFish manually create.
There could still be different error untill you set following connectins:
database(data source) <- connection pool <- JNDI.

org.teiid.adminapi.AdminFactory missing in teiid 8.13.4?

I am migrating an existing app from teiid-8.8.1c1/jboss-as-7.2.0 to WildFly 9.0.2
Teiid 8.13.4. I have been able to update dependencies in all cases except one:
I have one class getting an Admin instance from org.teiid.adminapi.AdminFactory as follows:
AdminFactory.getInstance().createAdmin(...)
So that is can get and check status on a VDB.
But is seems that the AdminFactory is no longer part the teidd adminapi. Is there some new way to get an admin instance?
Per teiid message board, it was moved to teiid-jboss-admin jar:
[TEIID-3503] Development with Embedded teiid should not require dependency on EAP - JBoss Issue Tracker separated out the EAP dependent Admin functionality into the teiid-jboss-admin jar. It doesn't look like that was called out in the release notes or a specific migration doc, so I'll make sure that gets updated.

Cannot attach file as database in multiple projects

I have two projects which are targeting the same database. One of them is an MVC web application and the other is a Web API project. However, when I initialize an instance of the context in any of the projects I get the following exception:
Cannot attach the file 'myRoute/MyDatabase.mdf' as database
'MyDatabase'.
They way I have solved this is by:
Erasing my database from the SQL server object explorer (as stated in EF5: Cannot attach the file ‘{0}' as database '{1}')
Running code first migrations once again.
However, if I run the code first update while my startup project is the web application, the web services generate the same exception. If I run the code first update while my startup project is the web service, then the web application has the same issue.
What happens?
For what its worth I had this problem and apparently solved it by adding an explicit reference to the database in the MVC Web.config file EXCLUDING the AttachDbFilename clause:

Deploying applications from Eclipse to OAS (OC4J)

We were using JDev to develop our applications and deploy them to OC4J and OAS.
we used to use JDev to create the data-source configuration for us both on dev and on deployment. (on dev using the wizard that come with jdev to connect to data-source.. and on deployment hence we don't need to do any Data-source configurations on the app server manually)
But, when we moved to eclipse, we couldn't no longer be able to deploy the EAR file unless we create the data-source manually (either using the em or j2ee\home\config\data-sources.xml but on some deployment, we may not be able to do such thing.
So, can we add some files for example to the EAR so that we can tell OAS that we need from it to create the DS for us??
Hint (I am hearing about some thing named orion*.xml, is this related to that request??
Thanks.
You can.
You need to place the correct data-sources.xml into your EAR/META-INF and reference it from your EAR/META-INF/orion-application.xml the same way as j2ee\home\config\data-sources.xml is referenced from j2ee\home\config\application.xml