You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@spark.apache.org by flyson <m_...@msn.com> on 2014/12/03 04:22:32 UTC

object xxx is not a member of package com

Hello everyone,

Could anybody tell me how to import and call the 3rd party java classes from
inside spark?
Here's my case:
I have a jar file (the directory layout is com.xxx.yyy.zzz) which contains
some java classes, and I need to call some of them in spark code.
I used the statement "import com.xxx.yyy.zzz._" on top of the impacted spark
file and set the location of the jar file in the CLASSPATH environment, and
use ".sbt/sbt assembly" to build the project. As a result, I got an error
saying "object xxx is not a member of package com".

I thought that could be related to the library dependencies, but couldn't
figure it out. Any suggestion/solution from you would be appreciated!

By the way in the scala console, if the :cp is used to point to the jar
file, I can import the classes from the jar file.

Thanks! 



--
View this message in context: http://apache-spark-developers-list.1001551.n3.nabble.com/object-xxx-is-not-a-member-of-package-com-tp9619.html
Sent from the Apache Spark Developers List mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@spark.apache.org
For additional commands, e-mail: dev-help@spark.apache.org


Re: object xxx is not a member of package com

Posted by "York, Brennon" <Br...@capitalone.com>.
For reference here is the relevant `sbt` documentation that states
Daoyuan¹s solution as well as a few other options to try.

http://www.scala-sbt.org/0.13/tutorial/Library-Dependencies.html


On 12/2/14, 11:29 PM, "Wang, Daoyuan" <da...@intel.com> wrote:

>I think you can place the jar in lib/ in SPARK_HOME, and then compile
>without any change to your class path. This could be a temporary way to
>include your jar. You can also put them in your pom.xml.
>
>Thanks,
>Daoyuan
>
>-----Original Message-----
>From: flyson [mailto:m_qiu@msn.com]
>Sent: Wednesday, December 03, 2014 11:23 AM
>To: dev@spark.incubator.apache.org
>Subject: object xxx is not a member of package com
>
>Hello everyone,
>
>Could anybody tell me how to import and call the 3rd party java classes
>from inside spark?
>Here's my case:
>I have a jar file (the directory layout is com.xxx.yyy.zzz) which
>contains some java classes, and I need to call some of them in spark code.
>I used the statement "import com.xxx.yyy.zzz._" on top of the impacted
>spark file and set the location of the jar file in the CLASSPATH
>environment, and use ".sbt/sbt assembly" to build the project. As a
>result, I got an error saying "object xxx is not a member of package com".
>
>I thought that could be related to the library dependencies, but couldn't
>figure it out. Any suggestion/solution from you would be appreciated!
>
>By the way in the scala console, if the :cp is used to point to the jar
>file, I can import the classes from the jar file.
>
>Thanks! 
>
>
>
>--
>View this message in context:
>http://apache-spark-developers-list.1001551.n3.nabble.com/object-xxx-is-no
>t-a-member-of-package-com-tp9619.html
>Sent from the Apache Spark Developers List mailing list archive at
>Nabble.com.
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@spark.apache.org For additional
>commands, e-mail: dev-help@spark.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: dev-unsubscribe@spark.apache.org
>For additional commands, e-mail: dev-help@spark.apache.org
>

________________________________________________________

The information contained in this e-mail is confidential and/or proprietary to Capital One and/or its affiliates. The information transmitted herewith is intended only for use by the individual or entity to which it is addressed.  If the reader of this message is not the intended recipient, you are hereby notified that any review, retransmission, dissemination, distribution, copying or other use of, or taking of any action in reliance upon this information is strictly prohibited. If you have received this communication in error, please contact the sender and delete the material from your computer.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@spark.apache.org
For additional commands, e-mail: dev-help@spark.apache.org


RE: object xxx is not a member of package com

Posted by flyson <m_...@msn.com>.
Hi Daoyuan,

Actually I had already tried the way as you mentioned, but it didn't work
for my case. I still got the same compilation errors.

Anyone can tell me how to resolve the library dependency on the 3rd party
jar in sbt?

Thanks!
Min



--
View this message in context: http://apache-spark-developers-list.1001551.n3.nabble.com/object-xxx-is-not-a-member-of-package-com-tp9619p9624.html
Sent from the Apache Spark Developers List mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@spark.apache.org
For additional commands, e-mail: dev-help@spark.apache.org


RE: object xxx is not a member of package com

Posted by "Wang, Daoyuan" <da...@intel.com>.
I think you can place the jar in lib/ in SPARK_HOME, and then compile without any change to your class path. This could be a temporary way to include your jar. You can also put them in your pom.xml.

Thanks,
Daoyuan

-----Original Message-----
From: flyson [mailto:m_qiu@msn.com] 
Sent: Wednesday, December 03, 2014 11:23 AM
To: dev@spark.incubator.apache.org
Subject: object xxx is not a member of package com

Hello everyone,

Could anybody tell me how to import and call the 3rd party java classes from inside spark?
Here's my case:
I have a jar file (the directory layout is com.xxx.yyy.zzz) which contains some java classes, and I need to call some of them in spark code.
I used the statement "import com.xxx.yyy.zzz._" on top of the impacted spark file and set the location of the jar file in the CLASSPATH environment, and use ".sbt/sbt assembly" to build the project. As a result, I got an error saying "object xxx is not a member of package com".

I thought that could be related to the library dependencies, but couldn't figure it out. Any suggestion/solution from you would be appreciated!

By the way in the scala console, if the :cp is used to point to the jar file, I can import the classes from the jar file.

Thanks! 



--
View this message in context: http://apache-spark-developers-list.1001551.n3.nabble.com/object-xxx-is-not-a-member-of-package-com-tp9619.html
Sent from the Apache Spark Developers List mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@spark.apache.org For additional commands, e-mail: dev-help@spark.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@spark.apache.org
For additional commands, e-mail: dev-help@spark.apache.org