NamingException class
Can any one tell me which JAR file has NamingException class? I am trying to decompile a java class that has import as javax.naming.NamingException.
I need to add jar file in the class path in order to decompile it successfully. Have added j2ee.jar but did not resolve the issue.
FYI - we are using JAVA 1.4.2
Thanks.
Kathleen <[email protected]> wrote in message news:<[email protected]>...
> I get this error when connect to my webserver through the weblogic console.
> Unknown NamingException, class= javax.naming.NamingException
> Any ideas?
Yeah I used to get this when I was using an old service pack on my pc
to connect to a more recent sp on the wls instance.
That should be it.
Steve
Similar Messages
-
Can't attatch console to WLS5.1 -NamingException
When trying to attach the console to a copy of WLS5.1 (SP8,domestic
strength).I am receiving the following error after entering a password and
clicking 'connect'.
Cannot connect:
Unknown NamingException, class= javax.naming.NamingException
Does anyone have any idea what could be causing this?
terryI spoke to weblogic support about this, and they were very helpful.
First try checking the classpath is all as it should be, if it is, and
the problem still persists try using full paths in the console
classpath, so, for instance, our startConsole.cmd includes
:runConsole12
set
CLASSPATH=C:\weblogic\lib\weblogic510sp8boot.jar;C:\weblogic\classes\boo
t;C:\weblogic\lib\weblogic510sp8.jar;C:\weblogic\classes;C:\weblogic\lib
\weblogicaux.jar
%JAVA_HOME%\jre\bin\java -ms16m -mx48m weblogic.Console
goto finish
Hope this at least gets you started, terry
-----Original Message-----
From: James [mailto:[email protected]]
Posted At: Thu 17 May 2001 22:53
Posted To: weblogic.developer.interest.management.console
Conversation: Can't attatch console to WLS5.1 -NamingException
Subject: Re: Can't attatch console to WLS5.1 -NamingException
I'm having the same problem...
WebLogic Build: 5.1.0 04/10/2000 16:16:34 #66912
128 bit domestic version
Any resolution?
"terry" <[email protected]> wrote:
When trying to attach the console to a copy of WLS5.1 (SP8,domestic
strength).I am receiving the following error after entering a password and
clicking 'connect'.
Cannot connect:
Unknown NamingException, class= javax.naming.NamingException
Does anyone have any idea what could be causing this?
terry -
Weblogic not finding javax.naming classes when instantiating bean
Hello,
I am developing a JSP which contains a JavaBean.
This bean is a wrapper for a session EJB, the getProperty() methods in
the bean call methods on the EJB's remote interface.
I have tested this bean as a stand alone application by adding a
main(String[] args) method to it and it works.
However, when adding the bean to the JSP, the JSP does not show in the
browser, I get a n internal server error 500 instead.
It seems that Weblogic is not finding the javax.naming.NamingException
class when instantiating the bean.
When looking at the weblogic log, I see the following stack trace:
Fri Aug 18 15:12:06 EDT 2000:<E> <ServletContext-General> Servlet failed
with Exception
java.lang.NoClassDefFoundError: javax/naming/NamingException
at java.lang.ClassLoader.resolveClass0(Native Method)
at java.lang.ClassLoader.resolveClass(ClassLoader.java:579)
at
weblogic.utils.classloaders.GenericClassLoader.reallyLoadClass(GenericClassLoader.java,
Compiled Code)
at
weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java,
Compiled Code)
at
weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java,
Compiled Code)
at java.beans.Beans.instantiate(Beans.java:194)
at java.beans.Beans.instantiate(Beans.java:55)
at weblogic.servlet.jsp.JspLexer.processBeanTag(JspLexer.java:1138)
at weblogic.servlet.jsp.JspLexer.mXML_OPEN_USEBEAN(JspLexer.java,
Compiled Code)
at weblogic.servlet.jsp.JspLexer.mXML_THING(JspLexer.java:1554)
at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java, Compiled Code)
at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java, Compiled
Code)
at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java, Compiled Code)
at weblogic.servlet.jsp.JspParser.doit(JspParser.java, Compiled Code)
at weblogic.servlet.jsp.JspParser.parse(JspParser.java:116)
at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:97)
at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java,
Compiled Code)
at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java, Compiled
Code)
at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:173)
at weblogic.servlet.jsp.JspStub.checkForReload(JspStub.java:92)
at
weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:191)
at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:118)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:744)
at
weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:692)
at
weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:251)
at
weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:363)
at
weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:263)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
Any idea on how to fix this?
Thanks for any help,
David
yes, weblogicaux.jar is definitely in the weblogic.class.path. i've even tried starting the server from the command line, declaring the classes there. my "trade.xml" document has the URI set as "http://localhost:7001/BizTalkServer". when i enter this on the "BizClient.jsp" form, i get the error discussed below. however, if i enter "http://localhost:7001", even though this is not the explicit location of the BizTalk server, the server returns:
Thank you! Your trade has been recieved. A BizTalk document has been sent to http://localhost:7001/ with the following information: etc...............
So there appears to be something wrong with the "/BizTalkServer" setup on my machine. Any ideas?
Kumar Allamraju <[email protected]> wrote:
>Make sure weblogicaux.jar is in your weblogic.class.path
>
>i.e -Dweblogic.class.path=$WL_HOME/lib/weblogicaux.jar:$WL_HOME/classes etc etc...
>
>--
>Kumar
>
>Mike Bachers wrote:
>
>> I'm currently struggling with a similar problem, although as a newcomer to WL I'm having some trouble figuring it out. I'm trying to run the BizTalk server example (http://www.weblogic.com/docs51/examples/xml/biztalk/index.html) under Windows 2000 and JDK1.2.2. I'm able to proceed without problems until I submit the form on the "BizClient.jsp" page. At this point, I receive this error:
>> ------------------------------------------------
>> There was a problem connecting to the BizTalk server. Exception caught: java.io.FileNotFoundException: Response: '500' for url: 'http://localhost:7001/BizTalkServer'
>> ------------------------------------------------
>>
>> At the same time, the WL console spits this out:
>> ------------------------------------------------
>> java.lang.NoClassDefFoundError: javax/naming/NamingException
>> ....
>> ------------------------------------------------
>>
>> I know this class is in the weblogicaux.jar, and it's included in my classpath. I think David's fix (see below) is getting at my problem, too, but I'm not sure. Anyone relate?
>>
>> "David R. Heffelfinger" <[email protected]> wrote:
>> >Figured it out. The problem was that the beans were in a directory
>> >in the JAVA_CLASSPATH in weblogic.properties. Moved the directory to
>> >WEBLOGIC_CLASSPATH and the problem went away.
>> >
>> >David
>> >
>> >"David R. Heffelfinger" wrote:
>> >
>> >> Hello,
>> >>
>> >> I am developing a JSP which contains a JavaBean.
>> >> This bean is a wrapper for a session EJB, the getProperty() methods in
>> >> the bean call methods on the EJB's remote interface.
>> >>
>> >> I have tested this bean as a stand alone application by adding a
>> >> main(String[] args) method to it and it works.
>> >>
>> >> However, when adding the bean to the JSP, the JSP does not show in the
>> >> browser, I get a n internal server error 500 instead.
>> >> It seems that Weblogic is not finding the javax.naming.NamingException
>> >> class when instantiating the bean.
>> >>
>> >> When looking at the weblogic log, I see the following stack trace:
>> >>
>> >> Fri Aug 18 15:12:06 EDT 2000:<E> <ServletContext-General> Servlet failed
>> >> with Exception
>> >>
>> >> java.lang.NoClassDefFoundError: javax/naming/NamingException
>> >>
>> >> at java.lang.ClassLoader.resolveClass0(Native Method)
>> >>
>> >> at java.lang.ClassLoader.resolveClass(ClassLoader.java:579)
>> >>
>> >> at
>> >> weblogic.utils.classloaders.GenericClassLoader.reallyLoadClass(GenericClassLoader.java,
>> >> Compiled Code)
>> >>
>> >> at
>> >> weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java,
>> >> Compiled Code)
>> >>
>> >> at
>> >> weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java,
>> >> Compiled Code)
>> >>
>> >> at java.beans.Beans.instantiate(Beans.java:194)
>> >>
>> >> at java.beans.Beans.instantiate(Beans.java:55)
>> >>
>> >> at weblogic.servlet.jsp.JspLexer.processBeanTag(JspLexer.java:1138)
>> >>
>> >> at weblogic.servlet.jsp.JspLexer.mXML_OPEN_USEBEAN(JspLexer.java,
>> >> Compiled Code)
>> >>
>> >> at weblogic.servlet.jsp.JspLexer.mXML_THING(JspLexer.java:1554)
>> >>
>> >> at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java, Compiled Code)
>> >>
>> >> at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java, Compiled
>> >> Code)
>> >>
>> >> at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java, Compiled Code)
>> >>
>> >> at weblogic.servlet.jsp.JspParser.doit(JspParser.java, Compiled Code)
>> >>
>> >> at weblogic.servlet.jsp.JspParser.parse(JspParser.java:116)
>> >>
>> >> at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:97)
>> >>
>> >> at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java,
>> >> Compiled Code)
>> >>
>> >> at weblogic.servlet.jsp.JspStub.compilePage(JspStub.java, Compiled
>> >> Code)
>> >>
>> >> at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:173)
>> >>
>> >> at weblogic.servlet.jsp.JspStub.checkForReload(JspStub.java:92)
>> >>
>> >> at
>> >> weblogic.servlet.internal.ServletStubImpl.getServlet(ServletStubImpl.java:191)
>> >>
>> >> at
>> >> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:118)
>> >>
>> >> at
>> >> weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:744)
>> >>
>> >> at
>> >> weblogic.servlet.internal.ServletContextImpl.invokeServlet(ServletContextImpl.java:692)
>> >>
>> >> at
>> >> weblogic.servlet.internal.ServletContextManager.invokeServlet(ServletContextManager.java:251)
>> >>
>> >> at
>> >> weblogic.socket.MuxableSocketHTTP.invokeServlet(MuxableSocketHTTP.java:363)
>> >>
>> >> at
>> >> weblogic.socket.MuxableSocketHTTP.execute(MuxableSocketHTTP.java:263)
>> >>
>> >> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java, Compiled Code)
>> >>
>> >> Any idea on how to fix this?
>> >>
>> >> Thanks for any help,
>> >> David
>> >
>
-
Problems with client.jar - generated from webservices toolkit from JDK 1.1.7
We have deployed a web application using the webservices in WL 6.1 using JDK 1.3.1.
The clients were able to successfully access the servlet it generated and download
the client.jar. Unfortunately this client.jar seems to be dependent on JDK 1.2
and beyond. It seems to use java.util.Map class in the JNDI-SOAP SPI.
Is there any workaround or fix to this problem, so this jar can be used from a
JDK 1.1.7 env?.
Our objective is to use WL 6.1 EJB's from WL 4.5.1 using Webservices. Are there
any known problems with this approach (Ofcourse other than this).
Thank you.
Dora Potluri
Here is the stack trace from using the client.jar
Class not found java.lang.ClassNotFoundException: java.util.Map
[Root exception is java.lang.ClassNotFoundException: java.util.Map]javax.naming.
NamingException: Class not found java.lang.ClassNotFoundException: java.util.Map
at java.lang.Throwable.<init>(Compiled Code)
at java.lang.Exception.<init>(Compiled Code)
at javax.naming.NamingException.<init>(Compiled Code)
at weblogic.soap.http.SoapContext.throwNamingException(Compiled Code)
at weblogic.soap.http.SoapContext.lookup(Compiled Code)
at javax.naming.InitialContext.lookup(Compiled Code)
at weatherEJB.WeatherBean.getTemp(Compiled Code)
at weatherEJB.WeatherBeanEOImpl.getTemp(Compiled Code)
at weatherEJB.WeatherBeanEOImpl_WLSkel.invoke(Compiled Code)
at weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(Compiled Code
at weblogic.rmi.extensions.BasicRequestHandler.handleRequest(Compiled
Co
de)
at weblogic.rmi.extensions.BasicRequestDispatcher$BasicExecuteRequest.ex
ecute(Compiled Code)
at weblogic.t3.srvr.ExecuteThread.run(Compiled Code)
Fri Sep 21 10:47:12 CDT 2001:<I> <EJB> Transaction: '1001087185816_1' rolled bac
k due to EJB exception:Yes, there is an expectation that the client jar will be run on JDK 1.3x. WLS 6.1 is certified on JDK 1.3x only. This
applies to the WebServices client as well. For details on platform support see
http://e-docs.bea.com/wls/platforms/index.html
Thanks,
Jim
Jim Rivera
Product Manager, WebLogic Server
BEA Systems, Inc.
Dora Potluri wrote:
I started testing using the client.jar generated by webservices WL 6.1 and found
that it uses reflection API interfaces that are not available til JDK 1.3. Is
there an expectation that the clients of Webservices are all going to be JDK 1.3.X.
Here is the stack trace we get.
java.lang.NoClassDefFoundError: java/lang/reflect/InvocationHandler
at weblogic.soap.http.SoapContext.lookup(SoapContext.java:76)
at javax.naming.InitialContext.lookup(InitialContext.java:280)
at weatherEJB.WeatherBean.getTemp(WeatherBean.java:106)
at weatherEJB.WeatherBeanEOImpl.getTemp(WeatherBeanEOImpl.java:47)
at weatherEJB.WeatherBeanEOImpl_WLSkel.invoke(WeatherBeanEOImpl_WLSkel.java:90)
at weblogic.rmi.extensions.BasicServerObjectAdapter.invoke(BasicServerObjectAdapter.java:261)
at weblogic.rmi.extensions.BasicRequestHandler.handleRequest(BasicRequestHandler.java:56)
at weblogic.rmi.extensions.BasicRequestDispatcher$BasicExecuteRequest.execute(BasicRequestDispatcher.java:166)
at weblogic.t3.srvr.ExecuteThread.run(Compiled Code) -
Problem using DataSource for JDBC applications
import javax.sql.*;
import java.sql.*;
import java.io.*;
import java.text.*;
import javax.naming.*;
public class CreateMovieTables {
//static String driver="COM.cloudscape.core.JDBCDriver";
//static String url="jdbc:cloudscape:";
String leadActor,title,leadActress,type,dateOfRelease;
Connection connection;
Statement statement;
DataSource dataSource;
public void initialize() throws SQLException,NamingException{
//Class.forName(driver);
Context initialContext = new InitialContext();
//connection = DriverManager.getConnection(url + "Movies;create=true");
dataSource = (DataSource) initialContext.lookup("jdbc/Cloudscape");
connection = dataSource.getConnection();
the code goes on
when i start the j2ee sdk server, the cloudscape server the message i get when i run the program is...
No local string for datasource.wrongclient
java.sql.SQLException:
at com.sun.enterprise.resource.JdbcDataSource.getConnection(JdbcDataSource.java:40)
at CreateMovieTables.initialize(CreateMovieTables.java:23)
at CreateMovieTables.main(CreateMovieTables.java:86)
can anyone please suggest as to where i may be going wrong
thanx
-NDKI don't agree that a User or System DSN is needed - that's a Windows idiom.
I haven't used the J2EE SDK to set up a data source, but I know that when I do it in Tomcat I've got to put a <resource-ref> tag in the web.xml that identifies the JNDI lookup string, and then the JDBC driver/URL/username/password details under a <Resource> tag in the context.xml to tell the data source how to create the JDBC connection.
My <resource-ref> name is "jdbc/APIPrototype". My JNDI lookup string looks like "java:comp/env/jdbc/DataSourceName".
You've got to do more than just put the JNDI lookup string in the Context lookup. Your error message sounds like the server is saying you've haven't done that set-up work.
Just a guess - perhaps it's something else, but I couldn't tell from your note. - MOD -
Linkage Error Looking up EJB from BPEL (11g)
I am using 11g TP3.
I have a BPEL process that is using WSIF to call a plain java class. Then from this class I am attempting to lookup an EJB in another application (but on the same server).
My code looks like this...
env.put( Context.INITIAL_CONTEXT_FACTORY, "oracle.j2ee.rmi.RMIInitialContextFactory" );
env.put( Context.SECURITY_PRINCIPAL, "fmwadmin" );
env.put( Context.SECURITY_CREDENTIALS, "welcome" );
env.put(Context.PROVIDER_URL, "ormi://localhost:23891/DisEM");
javax.naming.InitialContext ctx =
new javax.naming.InitialContext(env);
Object obj = ctx.lookup("DisConfigManager");
I get a Linkage error on the lookup stating it "violates loader constraints" on class com/evermind/server/rmi/RMIClientConnection
Below is the full error text. Any help would be appreciated. Thanks.
Mar 26, 2008 8:49:31 AM oracle.j2ee.util.AnnotatedLogger log
WARNING: Exception returned by remote server: java.lang.LinkageError: Class com/evermind/server/rmi/RMIClientConnection violates loader constraints
08/03/26 08:49:31 got an exception looking up DisConfigManager: javax.naming.NamingException: Error resolving reference <Reference Class Name: javax.ejb.EJBObject
Type: location
Content: test-managers_DisConfigManager_BeanBinding
Type: CachePolicy
Content: NEVER
: javax.naming.NamingException: Lookup error: javax.naming.NamingException: Class com/evermind/server/rmi/RMIClientConnection violates loader constraints [Root exception is java.lang.LinkageError: Class com/evermind/server/rmi/RMIClientConnection violates loader constraints]; nested exception is: javax.naming.NamingException: Class com/evermind/server/rmi/RMIClientConnection violates loader constraints [Root exception is java.lang.LinkageError: Class com/evermind/server/rmi/RMIClientConnection violates loader constraints] [Root exception is javax.naming.NamingException: Class com/evermind/server/rmi/RMIClientConnection violates loader constraints [Root exception is java.lang.LinkageError: Class com/evermind/server/rmi/RMIClientConnection violates loader constraints]]
08/03/26 08:49:31 <INFO> WSIFBinding=> [MIB2ScanCartridge/MIB2ScanCartridge!1.0*2008-02-27_13-37-54_124.FinalizeScanService]:finalize Performing outbound request/response interaction..
Mar 26, 2008 8:49:43 AM oracle.j2ee.util.AnnotatedLogger logI was mistaken in this posting. I was able to access the EJB from the startup class so there must be something else that I am doing to cause this problem. I'd still like to know why I get those invalid guid errors though.
By the way, please forgive me for using the gender-specific gentlemen in my posting. That was accidental. -
Use descriptive message from Exception
This piece of code
if (AliasesDB.validateAddress(personInfo, add).equals("invalid.format")) {
log.info(LogHead.getLogInfo(request, personInfo) + add + "Add alias failed - invalid format.");
actionErrors.add(ActionErrors.GLOBAL_MESSAGE, new ActionMessage("error.webapp.format"));
saveErrors(request, actionErrors);
return (mapping.findForward(INVALIDALIAS));
}calls AliasesDB.validateAddress() - a method that validates an email address and returns a descriptive String such as 'SUCCESS' or a descriptive error message such as 'invalid.format' depending on the results of the validation of the email string.
I think that this may be a clunky design, due to my incomplete understanding of how Java exceptions work. I have available to me another method that I could use to validate an email string.
public static boolean isNameInUse(String name, Connection c, Ldap dir) throws IOException, SQLException, NamingException
PreparedStatement nameQ = c.prepareStatement("SELECT username FROM creservednames WHERE username=?");
nameQ.setString(1,name);
ResultSet rs = nameQ.executeQuery();
if(rs.next() == true)
rs.close();
nameQ.close();
return true;
rs.close();
nameQ.close();
// search LDAP with base dc=company,dc=com
// this includes current accounts in ou=people
// and reserved identifiers in ou=reserve
DirContext dc = dir.getContext();
SearchControls sc = new SearchControls();
sc.setSearchScope(SearchControls.SUBTREE_SCOPE);
sc.setReturningAttributes(new String[] {"uid"});
javax.naming.NamingEnumeration ne = dc.search("dc=company,dc=com","(|(uid="+name+")(altnName="+name+")(mailLocalAddress="+name+"@company.com))",sc);
if(ne.hasMore()){
return true;
return false;
}My requirements are that I need to be able to do something based on the results of a validation operation that could have several different outcomes. I took a look at the javadoc for NamingException - is it possible to rewrite my code so that a custom string is returned when NamingException is thrown?Thank you!
I was going to ask ...
the problem with the isNameInUse() method is it is boolean, but I'd like to allow for multiple error conditions so that I can redirect with an error message based on several types of error conditions. I was wondering if there was a way to use the NamingException class to generate multiple types of error message depending on the error condition. -
I have a server multihomed with five different sites. There seems to be a
problem with connecting any of the sites using the console. The error I get
is:
Cannot connect:
Unknown NamingException, class= javax.naming.NamingException
Any one that can help figure this one out would be greatly appreciated.
Thanks in advance.
Tim
Is there nobody in the WebLogic Portal Developers fraternity who could possibly reply to my query? This is an urgent project requirement and needs to be resolved ASAP? Please help us out
-
Hi Folks,
We use two different versions of weblogic server. Weblogic 5.10 sp9
running on Solaris 2.8 and Weblogic 5.10 sp11 running on AIX 4.3.3. I
have no problems attaching to the sp9 server via my NT Weblogic
Consule.
My problem stems from the sp11 version. When I attempt to try and
attach to it I get the following error:
Unknow NamingException, class=javax.Naming.namingException
I have read other newsgroup posts that talk about sp11 being buggy.
Does anyone know of a way round this error ( perhaps some other way to
attach to the server ) or a way to launch the AIX Weblogic Consule via
the command line.
Or, is there a third party software that I can use to view the
weblogic pool , jdbc connections, and garbage collection via GUI
interface?
Cheers,
Mark NoonanMake sure you are starting console with SP11 jars in the classpath.
I just tried it here and i'm able to connect to console.
Mark Noonan wrote:
Hi Folks,
We use two different versions of weblogic server. Weblogic 5.10 sp9
running on Solaris 2.8 and Weblogic 5.10 sp11 running on AIX 4.3.3. I
have no problems attaching to the sp9 server via my NT Weblogic
Consule.
My problem stems from the sp11 version. When I attempt to try and
attach to it I get the following error:
Unknow NamingException, class=javax.Naming.namingException
I have read other newsgroup posts that talk about sp11 being buggy.
Does anyone know of a way round this error ( perhaps some other way to
attach to the server ) or a way to launch the AIX Weblogic Consule via
the command line.
Or, is there a third party software that I can use to view the
weblogic pool , jdbc connections, and garbage collection via GUI
interface?
Cheers,
Mark Noonan -
Need help in retrieving attributes from LDAP using JNDI
I am trying to retrieve attributes from LDAP using JNDI, but I'm getting the following error when I try to run my Java program.
Exception in thread "main" java.lang.NoClassDefFoundError: javax/naming/NamingException
I have all the jar files in my classpath: j2ee.jar, fscontext.jar and providerutil.jar. The interesting thing is that it gets compiled just fine but gives an error at run-time.
Could anyone tell me why I'm getting this error? Thanks!
Here's my code:
import javax.naming.*;
import javax.naming.directory.*;
import java.util.*;
import java.io.*;
class Getattr {
public static void main(String[] args) {
// Identify service provider to use
Hashtable env = new Hashtable(11);
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
// user info
String userName = "username";
String password = "password";
// LDAP server specific information
String host = "ldaphostname";
String port = "portnumber";
String basedn = "o=organization,c=country";
String userdn = "cn=" + userName + "," + basedn;
env.put(Context.PROVIDER_URL, "ldap://" + host + ":" + port + "/" + basedn);
env.put(Context.SECURITY_PRINCIPAL, userdn);
env.put(Context.SECURITY_CREDENTIALS, password);
try {
System.setErr(new PrintStream(new FileOutputStream(new File("data.txt"))));
// Create the initial directory context
DirContext ctx = new InitialDirContext(env);
// Ask for all attributes of the object
Attributes attrs = ctx.getAttributes("cn=" + userName);
NamingEnumeration ne = attrs.getAll();
while(ne.hasMore()){
Attribute attr = (Attribute) ne.next();
if(attr.size() > 1){
for(Enumeration e = attr.getAll(); e.hasMoreElements() ;) {
System.err.println(attr.getID() + ": " + e.nextElement());
} else {
System.err.println(attr.getID() + ": " + attr.get());
// Close the context when we're done
ctx.close();
} catch(javax.naming.NamingException ne) {
System.err.println("Naming Exception: " + ne);
} catch(IOException ioe) {
System.err.println("IO Exception: " + ioe);That doesn't work either. It seems its not finding the NamingException class in any of the jar files. I don't know why? Any clues?
-
Using weblogic console without jdk
Hi,
We are not allowed to have compilers installed in our production environment. Thus we have to remove the jdk that is shipped with the weblogic installation and only use the jre. For our own applications we precompile the JSP pages at build time, so we don't need the jdk.
The problem is that the weblogic admin console is also built with JSPs. Does anyone know if it is possible to tell weblogic to install the admin console with pre-compiled JSPs? Or is there another way to use the console whithout having the jdk installed?
Best regards
OrjanHi.
I need a bit more detail. What exactly do you mean when you say you have
multihomed the server with 5 different web sites? What is your configuration?
How are you connecting to a specific instance? With a java program or
browser? What URL are you using?
A single instance of WLS will bind to only 1 IP address using the
weblogic.system.bindAddr property. Are you starting 5 instances of the server,
each binding to a unique IP address? Having a multihomed machine does not mean
that a single instance of WLS is listening for incoming requests on all IP
addresses.
Thanks,
Michael
Tim Nields wrote:
I am currently running Weblogic 5.10. I have successfully managed to
multihome the server with 5 different websites. However I am running into
problems when attempting to connect to a specific instance. The error that
I am receiving is:
Cannot Connect:
Unknown NamingException, class= javax.naming.NamingException
I have a mirrored machine and I am able to connect using the weblogic
console, but I can't connect to a single one on the other. Can anyone
please offer some help as to why this would be occuring.
Thanks in advance.
Tim Nields--
Michael Young
Developer Relations Engineer
BEA Support -
How to attach console to server
My weblogic server run on a Unix box. I want to manage it from Win-NT
box so I install weblogic console on my NT. When I run Console and
try to attach the weblogic instance by specifying username/password
and DNS host name, I got -
Cannot Connect: Unknown NamingException, class=
javax.naming.NamingException
I make sure the port number. I tried with the default protocl
(Socket) and other protocols. AM I doing something wrong.
WL5.1SP11 on Unix, WL Console 5.1 on Win-NT 4.0
Please help.
-RajHi Raj,
Try this.
Port 7001.Protocol SSL.
HTH,
Bharat Varma
[email protected] (Raj) wrote:
My weblogic server run on a Unix box. I want to manage it from Win-NT
box so I install weblogic console on my NT. When I run Console and
try to attach the weblogic instance by specifying username/password
and DNS host name, I got -
Cannot Connect: Unknown NamingException, class=
javax.naming.NamingException
I make sure the port number. I tried with the default protocl
(Socket) and other protocols. AM I doing something wrong.
WL5.1SP11 on Unix, WL Console 5.1 on Win-NT 4.0
Please help.
-Raj -
How to attach console to a running server
My weblogic server run on a Unix box. I want to manage it from Win-NT
box so I install weblogic console on my NT. When I run Console and
try to attach the weblogic instance by specifying username/password
and DNS host name, I got -
Cannot Connect: Unknown NamingException, class=
javax.naming.NamingException
I make sure the port number is correct. I tried with the default protocl
(Socket) and other protocols. AM I doing something wrong.
WL5.1SP11 on Unix, WL Console 5.1 on Win-NT 4.0
Please help.
-RajHi Raj,
Try this.
Port 7001.Protocol SSL.
HTH,
Bharat Varma
[email protected] (Raj) wrote:
My weblogic server run on a Unix box. I want to manage it from Win-NT
box so I install weblogic console on my NT. When I run Console and
try to attach the weblogic instance by specifying username/password
and DNS host name, I got -
Cannot Connect: Unknown NamingException, class=
javax.naming.NamingException
I make sure the port number. I tried with the default protocl
(Socket) and other protocols. AM I doing something wrong.
WL5.1SP11 on Unix, WL Console 5.1 on Win-NT 4.0
Please help.
-Raj -
Not able to get group name by using memberof class, getting Total groups as 0 even I am member of that group. Through this memberof class I am trying to find full qualified name(DN) of my group.
code I have used:
//specify the LDAP search filter
String searchFilter = "(&(objectClass=user)(CN=Username))";
//Specify the Base for the search
String searchBase = "";
Also I have used,
String searchFilter = "(&(objectClass=user)(CN=Username))";
//Specify the Base for the search
String searchBase = "ou=ibmgroups,o=ibm.com";
But in both cases I am getting value for Total groups as 0.
Code Reference:
* memberof.java
* December 2004
* Sample JNDI application to determine what groups a user belongs to
import java.util.Hashtable;
import javax.naming.*;
import javax.naming.ldap.*;
import javax.naming.directory.*;
public class memberof {
public static void main (String[] args) {
Hashtable env = new Hashtable();
String adminName = "CN=Administrator,CN=Users,DC=ANTIPODES,DC=COM";
String adminPassword = "XXXXXXX";
String ldapURL = "ldap://mydc.antipodes.com:389";
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
//set security credentials, note using simple cleartext authentication
env.put(Context.SECURITY_AUTHENTICATION,"simple");
env.put(Context.SECURITY_PRINCIPAL,adminName);
env.put(Context.SECURITY_CREDENTIALS,adminPassword);
//connect to my domain controller
env.put(Context.PROVIDER_URL,ldapURL);
try {
//Create the initial directory context
LdapContext ctx = new InitialLdapContext(env,null);
//Create the search controls
SearchControls searchCtls = new SearchControls();
//Specify the search scope
searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);
//specify the LDAP search filter
String searchFilter = "(&(objectClass=user)(CN=Andrew Anderson))";
//Specify the Base for the search
String searchBase = "DC=antipodes,DC=com";
//initialize counter to total the group members
int totalResults = 0;
//Specify the attributes to return
String returnedAtts[]={"memberOf"};
searchCtls.setReturningAttributes(returnedAtts);
//Search for objects using the filter
NamingEnumeration answer = ctx.search(searchBase, searchFilter, searchCtls);
//Loop through the search results
while (answer.hasMoreElements()) {
SearchResult sr = (SearchResult)answer.next();
System.out.println(">>>" + sr.getName());
//Print out the groups
Attributes attrs = sr.getAttributes();
if (attrs != null) {
try {
for (NamingEnumeration ae = attrs.getAll();ae.hasMore();) {
Attribute attr = (Attribute)ae.next();
System.out.println("Attribute: " + attr.getID());
for (NamingEnumeration e = attr.getAll();e.hasMore();totalResults++) {
System.out.println(" " + totalResults + ". " + e.next());
catch (NamingException e) {
System.err.println("Problem listing membership: " + e);
System.out.println("Total groups: " + totalResults);
ctx.close();
catch (NamingException e) {
System.err.println("Problem searching directory: " + e);
Any help will be highly appreciated.Not able to get group name by using memberof class, getting Total groups as 0 even I am member of that group. Through this memberof class I am trying to find full qualified name(DN) of my group.
code I have used:
//specify the LDAP search filter
String searchFilter = "(&(objectClass=user)(CN=Username))";
//Specify the Base for the search
String searchBase = "";
Also I have used,
String searchFilter = "(&(objectClass=user)(CN=Username))";
//Specify the Base for the search
String searchBase = "ou=ibmgroups,o=ibm.com";
But in both cases I am getting value for Total groups as 0.
Code Reference:
* memberof.java
* December 2004
* Sample JNDI application to determine what groups a user belongs to
import java.util.Hashtable;
import javax.naming.*;
import javax.naming.ldap.*;
import javax.naming.directory.*;
public class memberof {
public static void main (String[] args) {
Hashtable env = new Hashtable();
String adminName = "CN=Administrator,CN=Users,DC=ANTIPODES,DC=COM";
String adminPassword = "XXXXXXX";
String ldapURL = "ldap://mydc.antipodes.com:389";
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
//set security credentials, note using simple cleartext authentication
env.put(Context.SECURITY_AUTHENTICATION,"simple");
env.put(Context.SECURITY_PRINCIPAL,adminName);
env.put(Context.SECURITY_CREDENTIALS,adminPassword);
//connect to my domain controller
env.put(Context.PROVIDER_URL,ldapURL);
try {
//Create the initial directory context
LdapContext ctx = new InitialLdapContext(env,null);
//Create the search controls
SearchControls searchCtls = new SearchControls();
//Specify the search scope
searchCtls.setSearchScope(SearchControls.SUBTREE_SCOPE);
//specify the LDAP search filter
String searchFilter = "(&(objectClass=user)(CN=Andrew Anderson))";
//Specify the Base for the search
String searchBase = "DC=antipodes,DC=com";
//initialize counter to total the group members
int totalResults = 0;
//Specify the attributes to return
String returnedAtts[]={"memberOf"};
searchCtls.setReturningAttributes(returnedAtts);
//Search for objects using the filter
NamingEnumeration answer = ctx.search(searchBase, searchFilter, searchCtls);
//Loop through the search results
while (answer.hasMoreElements()) {
SearchResult sr = (SearchResult)answer.next();
System.out.println(">>>" + sr.getName());
//Print out the groups
Attributes attrs = sr.getAttributes();
if (attrs != null) {
try {
for (NamingEnumeration ae = attrs.getAll();ae.hasMore();) {
Attribute attr = (Attribute)ae.next();
System.out.println("Attribute: " + attr.getID());
for (NamingEnumeration e = attr.getAll();e.hasMore();totalResults++) {
System.out.println(" " + totalResults + ". " + e.next());
catch (NamingException e) {
System.err.println("Problem listing membership: " + e);
System.out.println("Total groups: " + totalResults);
ctx.close();
catch (NamingException e) {
System.err.println("Problem searching directory: " + e);
Any help will be highly appreciated. -
Problem with Dynamically accessing EJB Class objects in WL 7.0 SP1
I am trying to build a component which has the ability to instantiate and execute
an known EJB method on the fly.
I have managed to build the component but when I try and execute it I get a ClassNotFoundException.
I know that the EJB I am trying to invoke is deployed and available on the server,
as I can see it in the console, I also seen to have been able to get the remote
interface of the object, my problem occurs when I try and access the class object
so I can perform a create on the object and then execute my method
The code I have written is below:
private Object getRemoteObject(Context pCtx, String pJNDIName, String pHomeBean)
throws Exception {
String homeCreate = "create";
Class []homeCreateParam = { };
Object []homeCreateParamValues = {};
try {
//This call seems to work and doesn't throw an exception
Object home = pCtx.lookup(pJNDIName);
//However this call throws a java.lang.ClassNotFoundException
Class homeBean = Class.forName(pHomeBean);
Method homeCreateMethod = homeBean.getMethod(homeCreate,homeCreateParam);
return homeCreateMethod.invoke(home, homeCreateParamValues);
} catch (NamingException ne) {
logStandardErrorMessage("The client was unable to lookup the EJBHome.
Please make sure ");
logStandardErrorMessage("that you have deployed the ejb with the JNDI
name "+pJNDIName+" on the WebLogic server ");
throw ne;
} catch (Exception e) {
logStandardErrorMessage(e.toString());
throw e;
Any advice would be really appreciated, I'm fast running out of ideas, I suspect
it has something to do with the class loader but I'm not sure how to resolve it
Regards
Jo CorlessHello Joanne,
Congratulations! I'm very happy that you've managed to fix your problem. It's
always essential to understand how to package applications when deploying on BEA
WebLogic. Usually, by throwing everything into an EAR file solves just about all
the class loader problems. :-) Let us know if you have any further problems that
we can assist you with.
Best regards,
Ryan LeCompte
[email protected]
http://www.louisiana.edu/~rml7669
"Joanne Corless" <[email protected]> wrote:
>
>
I've fixed it!!!!!!!!
Thanks to everyone who gave me help!!!!
The class loader was the culprit which is what I suspected all along.
As soon
as I put the 2 jar files I was using into an EAR file the problem went
away!!!!!
Thanks again
Jo Corless
"Ryan LeCompte" <[email protected]> wrote:
Hello Joanne,
As Mr. Woollen mentioned, I also believe it's a problem with the class
loader.
You need to be careful how you arrange your EJBs, because WebLogic has
a specific
method in which it loads classes in an EAR, JAR, and WAR file(s). Please
refer
to http://dev2dev.bea.com/articles/musser.jsp for more information about
BEA WebLogic
class loading mechanisms and caveats. Also, try printing out the various
methods
that are available on the object that was returned to you via reflection.
For
example, use the getMethods() method, which returns an array of Method
objects
that you can subsequently cycle through and print out the various method
names.
This way you can discover if the class found/returned to you is indeed
the one
you intend to locate.
Hope this helps,
Ryan LeCompte
[email protected]
http://www.louisiana.edu/~rml7669
Rob Woollen <[email protected]> wrote:
I believe the issue is the home interface class for this EJB is not
available in the class loader which is doing the reflection.
If you do:
getClass().getClassLoader().loadClass(homeInterfaceClassName)
I suspect it will fail. Reflection still requires that the class be
loadable.
-- Rob
Joanne Corless wrote:
Hi Slava,
If I make my code look like you describe below I get a compliationerror telling
me that
home.getMethod() is not recognised (no such method)
If I change it slightly and use
Method homeCreateMethod =
home.getClass().getMethod(homeCreate,homeCreateParam);
The code will compile OK but when executed it still throws a NoSuchMethodException
Any ideas ?
Thanks for your help so far
Regards
Jo Corless
Your code should look like
Object home = pCtx.lookup(pJNDIName);
Method homeCreateMethod =
home.getMethod(homeCreate,homeCreateParam);
return homeCreateMethod.invoke(home, homeCreateParamValues);
Regards,
Slava Imeshev
"Joanne Corless" <[email protected]> wrote in message
news:[email protected]...
Hi Ryan,
I also wanted to mention that if you do a "header search" in this
particular
newsgroup
with the search query as "reflection", you will see many previousmessages
regarding
reflection and EJBs. I believe you could learn a lot from thedifficulties
that
others have faced and solved.I tried that and although there was a number of similar cases noneof them
actually
seem to fix my issue. Thanks for the suggestion though
Are the EJBs that you are trying to access accessible via your
system
classpath?
Try to avoid having them accessible via the main system classpath,and
only bundle
them in your appropriate EJB jar files (contained in an EAR file,for
example).Maybe I should have laid the problem out a little clearer.
I have a number of EJB's bundled up in a JAR file which is hot deployedto
the
server. Within this first JAR file is an EJB (SSB) component that
needs
to
be
able to invoke a known method on another EJB. This second EJB may
or
may
not be
within the first JAR file but it also will be hot deployed.
The component trying to invoke the method on the 2nd EJB has to
be
able to
create
an instance of the 2nd EJB without actually knowing anything bar
a
JNDI
Name which
is passed in at runtime.
I can get as far as doing the
Object home = pCtx.lookup(pJNDIName);
This returned a class with the name
"com.csc.edc.projects.allders.httppostoffice.postman.PostmanBean_mp8qy2_Home
Impl_WLStub"
My problem seems to occur when I try and invoke the create method
Method homeCreate = home.getClass().getMethod("create", new Class[0]);
My code throws a java.lang.NoSuchMethodException at this point so
I
am
unable
to progress to the next step of :
Object bean = homeCreate.invoke(home, null);
So I can return the instantiated bean back to the calling client.
Why am I getting the NoSuchMethodException, is is because I am gettinga
stub
back rather than the home interface and if so how do I get the truehome
interface
from the bean
Thanks in advance
Jo Corless
Maybe you are looking for
-
How can I fine tune the performance of my IMS5.1 mailserver?
I installed the IMS5.1 on Solaris 8 with default parameters, without IDA. It is used as a mail relay. It seems to have/keep about 700 msgs in the tcp_local channel but none in the process channel. It uses the cpu very much, in my opinion too much (10
-
my iphone wont sync all my movies, 1 of 3 sync but not the others. They are all the same format (mp4. I can see them in itunes but they wont transfer onto the iphone.
-
My iphone fell down and when i tried to take a picture with it, the camera went blurry and made weird noises. Whenever i reopen the camera its ok for a second and then it goes blurry and noisy again. What shall i do?
-
Essbase Issue temp file location.
Is there a way to change the location where Essbase writes a temp file when data load(text file) is being done. It usually writes to Windows Temp location. Also will Essbase writies similar temp file when data is loaded from sql too? If anyone are fa
-
CRM Leasing - BRI (Billing Request Item) net value is "0"
In CRM Leasing, while quotation is created BRIu2019s (Billing Request Items) are generated. But these BRIu2019s are currently generated with net value u201CZerou201D. There are generated based on Cash Flow. Can anyone help me understand why the net v