 




<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IT Answers &#187; CLASSPATH</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/itanswers/tag/classpath/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/itanswers</link>
	<description></description>
	<lastBuildDate>Tue, 21 May 2013 22:12:10 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>JAVA classpath</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/java-classpath/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/java-classpath/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 16:37:42 +0000</pubDate>
		<dc:creator>Droutt</dc:creator>
				<category><![CDATA[CLASSPATH]]></category>
		<category><![CDATA[IFS]]></category>
		<category><![CDATA[Java]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Open Source team coded a series of Java .jar apps that I have placed in IFS in root/JAVA_HOME folder. I need guidance on how to create a CLASSPATH to the IFS folder so my CLP can call the JAVA app.   Do I define the CLASSPATH in the CLP or set up WRKENVVAR? Is there a [...]]]></description>
				<content:encoded><![CDATA[<p>Open Source team coded a series of Java .jar apps that I have placed in IFS in root/JAVA_HOME folder.<br/><br/> I need guidance on how to create a CLASSPATH to the IFS folder so my CLP can call the JAVA app.   Do I define the CLASSPATH in the CLP or set up WRKENVVAR?<br/><br/> Is there a better solution for placing the JAVA applications in IFS?<br/><br/></p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/java-classpath/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>UDF unable to load Java class. What do I need to do to make this work?</title>
		<link>http://itknowledgeexchange.techtarget.com/itanswers/udf-unable-to-load-java-class-what-do-i-need-to-do-to-make-this-work/</link>
		<comments>http://itknowledgeexchange.techtarget.com/itanswers/udf-unable-to-load-java-class-what-do-i-need-to-do-to-make-this-work/#comments</comments>
		<pubDate>Thu, 31 Jan 2008 20:37:56 +0000</pubDate>
		<dc:creator>OKONITA</dc:creator>
				<category><![CDATA[CLASSPATH]]></category>
		<category><![CDATA[Error SQL4304N]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux on Intel]]></category>
		<category><![CDATA[UDF]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Hi all, Right now I find myself in a position of doing it first, and learn setting up Java UDF later! I have managed to get the UDF registered but having problem getting the Java code to work. I need assistance to get this Double Metaphone Java UDF to work pretty quickly. Here is what [...]]]></description>
				<content:encoded><![CDATA[<p>Hi all,</p>
<p> Right now I find myself in a position of doing it first, and learn setting up Java UDF  later!<br />
I have managed to get the UDF registered but having problem getting the Java code to work. I need assistance to get this Double Metaphone Java UDF to work pretty quickly. Here is what I tried to run and the error </p>
<p>message that resulted:</p>
<p>                                         SQL<br />
select nm_frst, NM_LST, DB2ADMIN.DMPHONEJAVASCALAR(NM_LST)<br />
from FSNST201.BR_DOH_BIRTH_RECORD WHERE NM_FRST = &#8216;SKYLER&#8217;;<br />
                                      ERROR<br />
SQL4304N  Java stored procedure or user-defined function<br />
&#8220;DB2ADMIN.DMPHONEJAVASCALAR&#8221;, specific name &#8220;DMPHONEJAVASCALAR&#8221; could not load Java class </p>
<p>&#8220;/home/db2inst1/sqllib/fun&#8221;, reason code &#8220;&#8221;.  SQLSTATE=42724</p>
<p>Explanation:<br />
The Java class given by the EXTERNAL NAME clause of a CREATE PROCEDURE or CREATE FUNCTION statement could not be loaded. The reason codes are: </p>
<p> 1 The class was not found on the CLASSPATH.  </p>
<p> 2 The class did not implement the required interface (&#8220;COM.ibm.db2.app.StoredProc&#8221; or  &#8220;COM.ibm.db2.app.UDF&#8221;) </p>
<p>or lacked the Java &#8220;public&#8221; access flag.  </p>
<p> 3 The default constructor failed or was unavailable.  </p>
<p> 4 Could not load driver for &#8220;jdbc:default:connection&#8221;.  </p>
<p> 5 Could not establish default context.  </p>
<p>User Response: </p>
<p>Ensure that the compiled &#8220;.class&#8221; file is installed in the CLASSPATH, for example under &#8220;sqllib/function&#8221;.  </p>
<p>Ensure it implements the required Java interfaces and is &#8220;public&#8221;.<br />
sqlcode :  -4304<br />
sqlstate : 42724<br />
SQLCODE: -4304</p>
<p>I will appreciate it if someone can guide me to determine if at all I am properly set up to invoke a javaUDF, What do I need to look for, and how I can go about setting up my environment and the UDF to execute successfully. </p>
<p>Okay, here are my questions based on the error above:</p>
<p>(1) Yes, db2inst1 runs the instance. First, the CLASSPATH. I tried to find it using the command &#8220;Which java&#8221; and got  &#8220;/usr/bin/java&#8221; which is supposed to be my java home. Is this the same as CLASSPATH? When I looked in this directory, I found this &#8220;java &#8212;-&gt;/etc/alternatives/java&#8221;. So I navigated to this path, found and once again I found this &#8220;java -&gt; /usr/lib/jvm/jre-1.4.2-gcj/bin/java&#8221;. Once again, I navigated to this directory and found two scripts named &#8220;java&#8221;  and &#8220;rmiregistry&#8221;. I browsed the member called java and found this in the script the following lines that was of interest:</p>
<p>        params=&#8221;-Djava.home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre $params&#8221;<br />
        clp=&#8221;$CLASSPATH:/usr/share/java/libgcj-$GCC.jar&#8221;   </p>
<p>The above seem to point to the real classpath, right? How can I be sure of this? As I said, there are only the two members above in this dirctory. Nothing else. I have attached the actual java code as I have it. Please ake a look.</p>
<p>On error item #2, how can I find out if a class did or did not implement the required interface </p>
<p>(&#8220;COM.ibm.db2.app.StoredProc&#8221; or  &#8220;COM.ibm.db2.app.UDF&#8221;) or lacked the Java &#8220;public&#8221; access flag.? Is there any config or init file that I can look into to find out? Any environment variable? </p>
<p> 3 The default constructor failed or was unavailable.  What is this? How can I tell if it is available? Is this a system code or microcode of some sort? </p>
<p>4 Could not load driver for &#8220;jdbc:default:connection&#8221;.  Now, drivers I can understand but don&#8217;t know how to find out if it is available and loaded at startup. Anyway to find out?</p>
<p> 5 Could not establish default context. What could this be or mean?</p>
<p>Thanks in advance everyone who wishes to help.</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/itanswers/udf-unable-to-load-java-class-what-do-i-need-to-do-to-make-this-work/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using memcached
Database Caching 3/12 queries in 0.018 seconds using memcached
Object Caching 388/397 objects using memcached

Served from: itknowledgeexchange.techtarget.com @ 2013-05-22 00:28:03 -->