I would bet my bottom dollar that you are not logging in to the same account in the same database when you connect via SQL Developer that the Java application is connecting to. Perhaps there is a difference in the TNS configuration the two tools are using that makes it look like they should be connecting to the same database. Perhaps the Java application is not using the username that you expect, etc.
Have you enabled auditing of both successful and failed connections to this database to see whether you see both connections and whether they are using the same account?
I suppose it is possible that you've found a bug that needs to be reported to Oracle Support where an incorrect error message is returned. But it is vastly more likely that Oracle is right and you've made a mistake.