'set class path in weblogic 11g console

How to set class path in weblogic 11g console for classes present in web-inf/classes/

And my classes are in the below structure which needs to be set as class path to avoid exception which needs these classes to be loaded first.

/com/cdy/ws/a.class files
/com/cdy/ws/b.class files
/com/cdy/ws/c.class files

Please help,

Thanks



Solution 1:[1]

If you are looking for WebLogic specific... Lets say your web application dependent jars defined as:

WS_CLASSPATH=/com/cdy/ws 

set in your environment variable. That means your weblogic server can be loaded with weblogic.jar its relavent jars then, your WS_CLASSPATH can be added in the setDomainEnv.sh/cmc script find the EXT_PRE_CLASSPATH and assign to it.

EXT_PRE_CLASSPATH=$WS_CLASSPATH

There will be opposite side of CLASSPATH after the weblogic specific libraries available with EXT_POST_CLASSPATH in the setDomainEnv script.

Solution 2:[2]

The startup or shutdown class must be on the classpath of each server to which it is assigned.

To add a class to a server's classpath, do one of the following: If you use a script to start a server instance, open the script in a text editor. In the command that sets the classpath, add the pathname of the directory that contains your class root package.

Then restart the server.

For example, you create a startup class named StartBrowser in a package named com.mycompany.startup. You archive the class file in a JAR file named c:\myDomain\src\myJAR.jar.

The start script for your server must add c:\myDomain\src\myJAR.jar to the server's classpath.

If you use the Node Manager to start a server instance, do the following on each server that runs the startup class or shutdown class:

In the left pane of the Console, expand Environment and select Servers. On the Servers page, click on the server name. Select Configuration > Remote Start. In the Classpath field, enter the pathname for the classes that WebLogic Server requires to be on the classpath. Use an absolute pathname or a pathname that is relative to the Node Manager's home directory. Separate multiple classes with the type of separator that your operating system or shell requires.

For example, on Windows, use ; (semicolon) and in a BASH shell, use : (colon). For example, weblogic.jar must be on the classpath. For a complete list, refer to Required Environment and Syntax for weblogic.Server.

In the Classpath field, add the pathname for your class or for a JAR file that contains your class.

For example, you create a startup class named StartBrowser in a package named com.mycompany.startup. You archive the class file in a JAR file named c:\myDomain\src\myJAR.jar. In this case, the Classpath field should contain the following value: c:\Oracle\Middleware\wlserver_10.3\server\lib\weblogicsp.jar;c:\Oracle\Middleware\wlserver_10.3\server\lib\weblogic.jar;c\myDomain\src\myJAR.jar

Solution 3:[3]

step1)Class path can be set using ./setWLSEnv.sh(/wlserver_10.3/server/bin) step2)Adding a jar file to class path abc.jar to this location(wlserver_10.3/server/lib) and follow step1

If in case you need to set Domain ./setWlEnv.sh(Domain_Home/bin) avil here  

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 PavanDevarakonda
Solution 2 luis.espinal
Solution 3 Parvatha