Forum Stats

  • 3,757,062 Users
  • 2,251,193 Discussions
  • 7,869,716 Comments

Discussions

Using JPublisher to generate Java code from PL/SQL package that uses types from other schema

user10397781
user10397781 Member Posts: 3
edited May 2, 2014 3:06AM in SQL & PL/SQL

I'm using JDeveloper's Jpublisher to generate Java code from PL/SQL packages. I'm using JDeveloper 12c.

I have the following scenario:

I have a schema MY_SCHEMA with package PKG1 that uses types that are defined in other schema (OTHER_SCHEMA). In MY_SCHEMA I have synonyms to those types (with GRANT ALL permissions).

When I run the "Generate Java" option in PKG1, I get the following error:

oracle.jpub.JPubException: J2T-118, ERROR: User-defined type MY_SCHEMA.TYPE_X was not found in the database
    at oracle.jpub.sqlrefl.SqlReflector.addSqlType(SqlReflector.java:820)
    at oracle.jpub.sqlrefl.SqlReflector.addSqlDBType(SqlReflector.java:881)
    at oracle.jpub.sqlrefl.SqlReflector.addPlsqlDBType(SqlReflector.java:974)
    at oracle.jpub.sqlrefl.SqlTypeWithMethods.reflectMethods(SqlTypeWithMethods.java:178)
    at oracle.jpub.sqlrefl.SqlTypeWithMethods.getDeclaredMethods(SqlTypeWithMethods.java:37)
    at oracle.jpub.sqlrefl.SqlTypeWithMethods.hasMethods(SqlTypeWithMethods.java:44)
    at oracle.jpub.publish.JavaPublisher.publish(JavaPublisher.java:231)
    at oracle.jpub.DoitImpl.mainSql(DoitImpl.java:388)
    at oracle.jpub.DoitImpl.main(DoitImpl.java:118)
    at oracle.jpub.Doit.main(Doit.java:49)
    at oracle.jdevimpl.db.jpub.JPubModel$JPubProgressRunnable.doWork(JPubModel.java:1170)
    at oracle.ide.dialogs.ProgressRunnable.run(ProgressRunnable.java:161)
    at oracle.ide.dialogs.ProgressBar.run(ProgressBar.java:920)
    at java.lang.Thread.run(Thread.java:722)

TYPE_X is one of those types that are defined in OTHER_SCHEMA, to which there is a synonym in MY_SCHEMA.

How can I solve this problem?

Tagged:
1321532

Answers

This discussion has been closed.