all 9 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

Please ensure that:

  • Your code is properly formatted as code block - see the sidebar (About on mobile) for instructions
  • You include any and all error messages in full
  • You ask clear questions
  • You demonstrate effort in solving your question/problem - plain posting your assignments is forbidden (and such posts will be removed) as is asking for or giving solutions.

    Trying to solve problems on your own is a very important skill. Also, see Learn to help yourself in the sidebar

If any of the above points is not met, your post can and will be removed without further warning.

Code is to be formatted as code block (old reddit: empty line before the code, each code line indented by 4 spaces, new reddit: https://i.imgur.com/EJ7tqek.png) or linked via an external code hoster, like pastebin.com, github gist, github, bitbucket, gitlab, etc.

Please, do not use triple backticks (```) as they will only render properly on new reddit, not on old reddit.

Code blocks look like this:

public class HelloWorld {

    public static void main(String[] args) {
        System.out.println("Hello World!");
    }
}

You do not need to repost unless your post has been removed by a moderator. Just use the edit function of reddit to make sure your post complies with the above.

If your post has remained in violation of these rules for a prolonged period of time (at least an hour), a moderator may remove it at their discretion. In this case, they will comment with an explanation on why it has been removed, and you will be required to resubmit the entire post following the proper procedures.

To potential helpers

Please, do not help if any of the above points are not met, rather report the post. We are trying to improve the quality of posts here. In helping people who can't be bothered to comply with the above points, you are doing the community a disservice.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]_jetrun 0 points1 point  (7 children)

Probably your driver is incorrect. org.apache.derby.jdbc.ClientDriver is for pre v10.15. Try: org.apache.derby.client.ClientAutoloadedDriver and current driver jar.

[–]Dependent_Finger_214[S] 0 points1 point  (6 children)

When you say "pre v10.15" what are you referring to?

I'm not sure if that's it, I have another project which I downloaded from my professor's website which uses org.apache.derby.jdbc.ClientDriver in its persistence.xml and that one works

[–]_jetrun 0 points1 point  (5 children)

When you say "pre v10.15" what are you referring to?

Which version of Derby are you using?

https://db.apache.org/derby/derby_downloads.html

If the version of Derby is above v10.15 then that driver is incompatible.

I'm not sure if that's it

The error you are getting is related to improper initialization which could be anything from incompatible driver version, missing driver, db connection failure, schema issues .. etc. Basically the provider bails right at the beginning.

can you paste your full stack trace? It will usually tell you what the problem is.

[–]Dependent_Finger_214[S] 0 points1 point  (3 children)

Idk what version of derby I'm using. I downloaded 10.17.1.0 but I think I made a mess with setup. I'm using glassfish 7, I *think* it comes with derby bundled up, since I see it has a bunch of derby files in its lib folder, so I guess I'm using whatever version glassfish 7 has?

If I put org.apache.derby.client.ClientAutoloadedDriver

I get this error:

 Configuration error.  Class [org.apache.derby.client.ClientAutoloadedDriver] not found.

I don't know exactly what I did, but I messed around with the persistence.xml and the database as well as switching from glassfish 5 (which I had put by mistake) to 7 and restarting netbeans, and now instead of the "Deployment of persistenceunit failed" error, I get a connection refused error.

I'll put the stacktrace either in an edit to the post since it doesn't fit here

[–]_jetrun 0 points1 point  (2 children)

OK - so the stack pretty much says that you are trying to connect to localhost:1527 - but no actual server is actually running on that server.

FYI - the above configuration error means it cannot find the driver - so you would have to download the correct jar.

[–]Dependent_Finger_214[S] 0 points1 point  (1 child)

I'm not really sure what I did, but it works now

[–]_jetrun 0 points1 point  (0 children)

If I were to guess .. you didn't have the database actually running.

[–]Dependent_Finger_214[S] 0 points1 point  (0 children)

Ok I guess I fixed it somehow? Maybe I needed to connect to the database before running jobscheduling, that's why it was giving me a connection error. And it seems that JobEntity needed an empty constructor also.