error: object X is not a member of package Y

Hi,

I have a project composed of 3 modules, one big pure java module with no scala-artifact but dependency on one of the two other mixed scala-java modules. When trying to build, in one class in the pure java module, I get the above error:

error: object sleepycat is not a member of package com
import com.sleepycat.db.EnvironmentConfig;


The affected "object" is the third import of the same package Y. When rewriting import com.sleepycat.db. EnvironmentConfig is found with no problem.

When checking that error with different google searches, it appears to occur mostly with intelliJ and the scala plugin. I'm running latest version of intelliJ (11.1.2) and nightly build of scala plugin version  0.5.796 (same error with regular version). I  frequently try to invalidate caches.

One problem might be, that the java module was imported from a checkout maven project, into which I copied some non-maven classes. Not sure wheter this matters.

When I select javac  in settings:scala_compiler:Join compilation, the error disappears in the java module, but in the one of the scala module this error appears:

error: value getEnvironmentConfig is not a member of org.hypergraphdb.storage.bdb.BDBConfig
bdbConfig.getEnvironmentConfig().setCacheSize(800*1024*1024);

Actually it's quite some time that I'm having similar problems of incoherences regarding packages and member visibility during import. It drives me nuts to the point that I retried eclipse!  I could not find something conclusive on this forum, similar problems seem to be fixed.

Any ideas?

thanks for some input...

Ingvar

3 comments
Comment actions Permalink

To clarify the issue we need to reporduce the problem somehow.

Can you isolate the problem so that it can be observed in a small number of sample source files? Alternatively we can use your original project code if it's open.

The problem seems to lay within joint compilation of Scala and Java sources, and the primary cause of the misbehavior may be the Scalac itself.

0
Comment actions Permalink

BTW, what version of Scala are you using?

0
Comment actions Permalink

I am having the same issue right now. It seams that if java libraries are imported and a particular package is empty, it "confuses" scala compiler. For example, if your package structure is com.domain.app, then "com.domain" package usually has no classes and this causes a problem.

In particular, I am experiencing this problem when running tests for the project and one of the files needs to be re-compiled due to changes. "Run All Tests" performs a "Make " first and that's where the problem surfaces.

0

Please sign in to leave a comment.