• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Missing javax.naming:jndi jar in Maven repo

 
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Team,

I want to use the jndi jar and I have the following configuration in my pom.xml


My Dependency is:

<dependency>
<groupId>javax.naming</groupId>
<artifactId>jndi</artifactId>
<version>1.2.1</version>
</dependency>

My Repository Is:

<repository>
<id>central</id>
<name>Central Repository</name>
<url>http://repo1.maven.org/maven2</url>;
<layout>default</layout>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>


BUT we don't have the jar at the location : /javax/naming/jndi/1.2.1/

Why So ? Is something wrong in my configuration ? Where can I find the jndi jar ?

Please Help !!!

Thanks and Regards,
Sid.

 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It is available: http://mvnrepository.com/artifact/javax.naming/jndi

Why are you specifying a repository (which at any given time might be down, or not have a specific file)? Why not let Maven take care of that for you?
 
Siddharth Bhargava
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:It is available: http://mvnrepository.com/artifact/javax.naming/jndi

Why are you specifying a repository (which at any given time might be down, or not have a specific file)? Why not let Maven take care of that for you?



pardon me my ignorance ... but where do I specify this ... could you please elaborate ..
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You misunderstood - you would not specify any repository. You said "My Repository Is" - but why are you specifying a repository?
 
Siddharth Bhargava
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:You misunderstood - you would not specify any repository. You said "My Repository Is" - but why are you specifying a repository?



because its given here : http://maven.apache.org/guides/mini/guide-coping-with-sun-jars.html

Also I am getting an error in specifying my dependency :

<dependency>
<groupId>javax.naming</groupId>
<artifactId>jndi</artifactId>
<version>1.2.1</version>
</dependency>

It says "Missing artifact javax.naming:jndi:jar:1.2.1"
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Despite what that page says, a quick look at that repo indicates javax.naming isn't in it.

A cursory search for "javax.naming repo" indicates that the dependency declaration is correct. Have you actually tried it without specifying a repository?
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's always good to post the exact error message and exception that you see. For example, when you run a project with the dependency that you have specified, the error message you get is this (I just gave it a try):


Could not find artifact javax.naming:jndi:jar:1.2.1 in ..., try downloading from http://java.sun.com/products/jndi/downloads/index.html


So clearly, it's not available as a jar in the Maven repo and instead you are expected to download it manually from the link that's printed out (which by the way comes from the contents of the pom which is here http://search.maven.org/remotecontent?filepath=javax/naming/jndi/1.2.1/jndi-1.2.1.pom, see the downloadUrl element in there).
 
Siddharth Bhargava
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:Despite what that page says, a quick look at that repo indicates javax.naming isn't in it.

A cursory search for "javax.naming repo" indicates that the dependency declaration is correct. Have you actually tried it without specifying a repository?




I agree that javax.naming is NOT here. So why have they specified ? Yeah I have tried without specifying a repository but its giving the same error "Missing artifact javax.naming:jndi:jar:1.2.1" in pom.xml

Would I be specifying something in the repository and dependency OR not.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Go with Jaikiran's advice.
 
Siddharth Bhargava
Ranch Hand
Posts: 280
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:Go with Jaikiran's advice.



I downloaded the jndi-1.2.1.jar and installed it as a 3rd party jar in maven repository. Now the pom.xml seems to be fine.

reply
    Bookmark Topic Watch Topic
  • New Topic