Question: The wos2 **server.bat** sets the carbon class path to pick up jars from the lib folder however the **server.sh** tries to pick them up from bin.. see code below.. this causes us a big problem because in the dss documentation it says to put the database connector jars in the lib folder:

```
CARBON_CLASSPATH=""
if [ -e "$JAVA_HOME/lib/tools.jar" ]; then
    CARBON_CLASSPATH="$JAVA_HOME/lib/tools.jar"
fi
for f in "$CARBON_HOME"/bin/*.jar
do
    if [ "$f" != "$CARBON_HOME/bin/*.jar" ];then
        CARBON_CLASSPATH="$CARBON_CLASSPATH":$f
    fi
done
for t in "$CARBON_HOME"/lib/commons-lang*.jar
do
    CARBON_CLASSPATH="$CARBON_CLASSPATH":$t
done 

```

Can anyone explain this?

Answer: 
WSO2 Carbon is the OSGi based platform for all WSO2 java products. In Carbon, there are four different “lib” folders. If you have ever tried any of the Carbon based products, you may have thought “why are there four different libs?”. If so, this post will provide you the answer for that question.
These are the “lib” folders that you can find in Carbon.

[1] CARBON\_HOME/webapps/ROOT/WEB-INF/lib
Carbon is a web app which is deployed in an embedded tomcat instance. This is the lib folder which is specific to Carbon web app just like any other web app has in WEB-INF/lib folder. Bridge servlet is the one who forwards each and every incoming request into the OSGi environment of Carbon. We have used this lib to place our Bridge Servlet. Tomcat pics it up from there and hands over the incoming requests to it.

[2] CARBON\_HOME/repository/components/lib
This is the place to put your normal jars if you want them to become pure bundles in the OSGi environment. All packages in these bundles are exported into the OSGi environment. As you may know, Carbon can be extended as you wish. You can add your own bundles into it. So If you have dependent jars for those bundles, you can place those in this lib.

[3] CARBON\_HOME/repository/lib
This is the place where all client libraries exist. When you run ‘ant’ from CARBON\_HOME/bin, all needed jars are put into this folder. If you want to write a client (or you can generate it using the WSDL2Java tool in WSAS) and test it, the set of all jars you need in the classpath can be found in this lib. For example, WSAS samples are run by adding all these libs into client classpath.

[4] CARBON\_HOME/lib
This is the place where we put all jars which are needed by tomcat to start and some others for specific reasons. This is same as the Tomcat root lib. These libraries can be seen from all webapps deployed. And also, if you place the same jar in this lib and also inside Carbon web app, it will be picked up from this root lib as Tomcat uses parent first class loading.

\*\*\* there are few libraries that are available in bin folder to get initiate the OSGi service and some special things. You can't put any jars in to the bin to reflect OSGi level or any other class loaders.
You have to put the database connector jar into DSS\_HOME/repository/components/lib directory and restart the server[1]. It adds them into server class path. 

[1]<https://docs.wso2.com/display/DSS301/Changing+the+RDBMS>