0
class file location
New Here
,
/t5/coldfusion-discussions/class-file-location/td-p/276150
Jun 05, 2007
Jun 05, 2007
Copy link to clipboard
Copied
I am not sure if this would be an admin type question but
here goes:
I have a Coldfusion 6.1 server riding on Weblogic 8 ish and I am trying to do a small java example... *sigh*
I am getting a "class not found" error and so I went looking for my classpath, since it didn't seem to be what was default in the documentation. *sigh*
So I find that it is defaulting to .jar files and no directories. I can see that there are class files that are out in our coldfusion land so how does it see these? I am pretty ignorant of weblogic. I was curious how they can be reading the files, if they are, when the paths that I see only point to jar files. So, no explanation is too simple, please use small words and type slow for me. How should/do I change the path since I have to change it in Weblogic not CF admin. Is there some kind of default folder I am missing? I even tried adding my class to cfclasses under the cf file directory. Any help (and I need a lot) would be greatly appreciated.
Thank you in advance for your infinite patience and any help you can provide!!!
~Va 🙂
I have a Coldfusion 6.1 server riding on Weblogic 8 ish and I am trying to do a small java example... *sigh*
I am getting a "class not found" error and so I went looking for my classpath, since it didn't seem to be what was default in the documentation. *sigh*
So I find that it is defaulting to .jar files and no directories. I can see that there are class files that are out in our coldfusion land so how does it see these? I am pretty ignorant of weblogic. I was curious how they can be reading the files, if they are, when the paths that I see only point to jar files. So, no explanation is too simple, please use small words and type slow for me. How should/do I change the path since I have to change it in Weblogic not CF admin. Is there some kind of default folder I am missing? I even tried adding my class to cfclasses under the cf file directory. Any help (and I need a lot) would be greatly appreciated.
Thank you in advance for your infinite patience and any help you can provide!!!
~Va 🙂
TOPICS
Advanced techniques
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Engaged
,
/t5/coldfusion-discussions/class-file-location/m-p/276151#M24552
Jun 05, 2007
Jun 05, 2007
Copy link to clipboard
Copied
(Note: I would recommend you package up your class file into
a jar file with your own package name.)
Place your packaged jar file containing the class file in your cf_webapp_root\WEB-INF\lib folder.
Read this tech note for more information
http://www.adobe.com/support/coldfusion/j2ee/cfmx7j2ee_weblogic_deploy.html
Place your packaged jar file containing the class file in your cf_webapp_root\WEB-INF\lib folder.
Read this tech note for more information
http://www.adobe.com/support/coldfusion/j2ee/cfmx7j2ee_weblogic_deploy.html
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Engaged
,
/t5/coldfusion-discussions/class-file-location/m-p/276152#M24553
Jun 05, 2007
Jun 05, 2007
Copy link to clipboard
Copied
Additional info: Even though the tech note is for cfmx 7, it
should still give you some useful information.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
ironyx
AUTHOR
New Here
,
/t5/coldfusion-discussions/class-file-location/m-p/276153#M24554
Jun 07, 2007
Jun 07, 2007
Copy link to clipboard
Copied
I appreciate the reply and link. I will check the path you
specified. I thought you put classes under
cf_webapp_root\WEB-INF\classes and .jar files under
cf_webapp_root\WEB-INF\lib. But anything is worth a try since it
will not be easier to get a classpath changed.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Guide
,
/t5/coldfusion-discussions/class-file-location/m-p/276154#M24555
Jun 07, 2007
Jun 07, 2007
Copy link to clipboard
Copied
>> I thought you put classes
cf_webapp_root\WEB-INF\classes
>> and .jar files under cf_webapp_root\WEB-INF\lib
That's correct. Place jar files in ...\lib and class files in the \classes directory. CF should automatically detect them on restart.
http://livedocs.adobe.com/coldfusion/7/htmldocs/00001561.htm
>> and .jar files under cf_webapp_root\WEB-INF\lib
That's correct. Place jar files in ...\lib and class files in the \classes directory. CF should automatically detect them on restart.
http://livedocs.adobe.com/coldfusion/7/htmldocs/00001561.htm
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
ironyx
AUTHOR
New Here
,
/t5/coldfusion-discussions/class-file-location/m-p/276155#M24556
Jun 07, 2007
Jun 07, 2007
Copy link to clipboard
Copied
Oh, so you still have to hit restart even if the
<reload>TRUE</reload> is set in the
cf_root\wwwroot\WEB-INF\jrun-web.xml file?
That clears some things up... I read that it had problems but I thought it was because the setting above wasn't normally set....
That clears some things up... I read that it had problems but I thought it was because the setting above wasn't normally set....
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Guide
,
/t5/coldfusion-discussions/class-file-location/m-p/276156#M24557
Jun 07, 2007
Jun 07, 2007
Copy link to clipboard
Copied
The setting in jrun-web.xml is
suppposed to work ... yes. I've personally had problems with
it, but I've also heard of it working successfully for others. My
suggestion is to enable the setting, restart .. drop a test class
file in the ...\classes folder and see if CF recognizes it. If it
does, then the setting works for you 😉
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
ironyx
AUTHOR
New Here
,
/t5/coldfusion-discussions/class-file-location/m-p/276157#M24558
Jun 07, 2007
Jun 07, 2007
Copy link to clipboard
Copied
Well, since right now I have my class under the
cf_webapp_root\WEB-INF\classes and the reload option was ALREADY
set, I am hoping that it is not working... and that's why it can't
find my class file. Otherwise... I guess I have to figure out where
weblogic is looking.
Thanks!
Thanks!
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Guide
,
/t5/coldfusion-discussions/class-file-location/m-p/276158#M24559
Jun 07, 2007
Jun 07, 2007
Copy link to clipboard
Copied
You must restart the first time you change the jrun-web.xml
setting. Afterwards, you should not have to restart CF whenever you
add a new class or jar to the WEB-INF folders. Assuming the setting
works correctly.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Guide
,
/t5/coldfusion-discussions/class-file-location/m-p/276159#M24560
Jun 07, 2007
Jun 07, 2007
Copy link to clipboard
Copied
Wish I knew more about weblogic paths. Out of curiousity, did
you try adding a jar file to the "lib" directory?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
ironyx
AUTHOR
New Here
,
/t5/coldfusion-discussions/class-file-location/m-p/276160#M24561
Jun 07, 2007
Jun 07, 2007
Copy link to clipboard
Copied
No, but then I don't know much about java. Trying to do the
simplest test I could to check configuration of the java (and that
is working so well...) Not knowing java I used the code for a class
file called simple math that I found in a little article and then
did a createObject to call it and pass two numbers to add and
output the result.
All I get is :
Object Instantiation Exception.
Class not found: SimpleMath.
Now i have tried to change the classpath in the regedit under the weblogic properties (don't like playing there) and it didn't work. I checked the cf admin and found that the changes didn't propogate, so obviously I am changing them in the wrong place. If this were through just cf on jrun I might have a chance, but now I am tackling two monsters I am unfamiliar with. I do appreciate all the help though. I know its difficult to help without being there to click.
If you have any suggestions on where to look (I know RTFM, but it is mostly geared towards an install not how to trace through config issues.) please feel free to put in two cents, or more.
Thanks a bunch,
Va.
All I get is :
Object Instantiation Exception.
Class not found: SimpleMath.
Now i have tried to change the classpath in the regedit under the weblogic properties (don't like playing there) and it didn't work. I checked the cf admin and found that the changes didn't propogate, so obviously I am changing them in the wrong place. If this were through just cf on jrun I might have a chance, but now I am tackling two monsters I am unfamiliar with. I do appreciate all the help though. I know its difficult to help without being there to click.
If you have any suggestions on where to look (I know RTFM, but it is mostly geared towards an install not how to trace through config issues.) please feel free to put in two cents, or more.
Thanks a bunch,
Va.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Guide
,
/t5/coldfusion-discussions/class-file-location/m-p/276161#M24562
Jun 07, 2007
Jun 07, 2007
Copy link to clipboard
Copied
When you checked the cfadmin what was the class path? I'm
also wondering, do you have any other custom or special jars
installed on the server. For example, some people install POI to
create excel files. That jar has to be in the CF class path. So
perhaps you could do a search to find out where the custom jars
reside.
Stupid question, but you placed the compiled java .class files into the WEB-INF\classes directory, and not the .java source files right?
Stupid question, but you placed the compiled java .class files into the WEB-INF\classes directory, and not the .java source files right?
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Engaged
,
/t5/coldfusion-discussions/class-file-location/m-p/276162#M24563
Jun 07, 2007
Jun 07, 2007
Copy link to clipboard
Copied
I f you want to try the jar method, here's a quicky on how to
jar up your file as a package.
in a work folder, create a folder structure for your package, convention uses reverse internet domain (i.e. com.adobe.packagename)
for this one, we'll use a simple one level package called ironyx. So create a folder called ironyx.
copy the java file you want to package up into the ironyx folder
at the top of the java file place the following;
package ironyx;
Compile the java file.
Using a command prompt in the parent folder of the ironyx folder, type the following;
jar -cf ironyx.jar ironyx
This will jar up the ironyx folder contents, including both the java and class files into an ironyx.jar file. You can delete the source java files prior to creation of the jar file if you wish.
Copy the jar file to ColdFusion WEB-INF\lib directory, bounce the cf instance
A typical cf execution might look like
<cfset mySimpleMath= CreateObject("java","ironyx.SimpleMath")>
<!--- Usually you Initialize the object, but that depends on the constructors of the class--->
<cfset mySimpleMath.init()>
<!--- Execute the method --->
<cfset result = mySimpleMath.addNumbers(num1, num2)>
Note: If you're using the SimpleMath class file from http://builder.com.com/5100-6370-5177283.html, they have a text formatting error for the method. There should be spaces in publicintaddNumbers and it should look like
public int addNumbers
in a work folder, create a folder structure for your package, convention uses reverse internet domain (i.e. com.adobe.packagename)
for this one, we'll use a simple one level package called ironyx. So create a folder called ironyx.
copy the java file you want to package up into the ironyx folder
at the top of the java file place the following;
package ironyx;
Compile the java file.
Using a command prompt in the parent folder of the ironyx folder, type the following;
jar -cf ironyx.jar ironyx
This will jar up the ironyx folder contents, including both the java and class files into an ironyx.jar file. You can delete the source java files prior to creation of the jar file if you wish.
Copy the jar file to ColdFusion WEB-INF\lib directory, bounce the cf instance
A typical cf execution might look like
<cfset mySimpleMath= CreateObject("java","ironyx.SimpleMath")>
<!--- Usually you Initialize the object, but that depends on the constructors of the class--->
<cfset mySimpleMath.init()>
<!--- Execute the method --->
<cfset result = mySimpleMath.addNumbers(num1, num2)>
Note: If you're using the SimpleMath class file from http://builder.com.com/5100-6370-5177283.html, they have a text formatting error for the method. There should be spaces in publicintaddNumbers and it should look like
public int addNumbers
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
ironyx
AUTHOR
New Here
,
/t5/coldfusion-discussions/class-file-location/m-p/276163#M24564
Jun 08, 2007
Jun 08, 2007
Copy link to clipboard
Copied
Alright, works. It had to be changed through a weblogic
classpath setting which when finding the right one propogated
through coldfusion and worked.
And a very nice discovery is weblogic detects any class added without a restart.
I do have a problem with my calls now which c_wigginton might have the answer for in his last post for me. I will try it out.
New to java and weblogic... wow, fun in a nails down the chalkboard sort of way, but it should get better right? There always seems to be some fairly large knowledge leaps we have to make... thanks for helping!!!!
And a very nice discovery is weblogic detects any class added without a restart.
I do have a problem with my calls now which c_wigginton might have the answer for in his last post for me. I will try it out.
New to java and weblogic... wow, fun in a nails down the chalkboard sort of way, but it should get better right? There always seems to be some fairly large knowledge leaps we have to make... thanks for helping!!!!
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Guide
,
/t5/coldfusion-discussions/class-file-location/m-p/276165#M24566
Jun 08, 2007
Jun 08, 2007
Copy link to clipboard
Copied
>>It had to be changed through a weblogic classpath
setting which when finding
>>the right one propogated through coldfusion and worked.
Just for future knowledge, what is the classpath setting /variable name? Never know when I might have to endure similar torture myself!
>>the right one propogated through coldfusion and worked.
Just for future knowledge, what is the classpath setting /variable name? Never know when I might have to endure similar torture myself!
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Guide
,
/t5/coldfusion-discussions/class-file-location/m-p/276164#M24565
Jun 08, 2007
Jun 08, 2007
Copy link to clipboard
Copied
>>And a very nice discovery is weblogic detects any
class
>>added without a restart.
That is nice!
>>wow, fun in a nails down the chalkboard sort of way,
>>but it should get better right?
Yes... after a little torture as you've discovered 😉
>>added without a restart.
That is nice!
>>wow, fun in a nails down the chalkboard sort of way,
>>but it should get better right?
Yes... after a little torture as you've discovered 😉
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
ironyx
AUTHOR
New Here
,
/t5/coldfusion-discussions/class-file-location/m-p/276166#M24567
Jun 11, 2007
Jun 11, 2007
Copy link to clipboard
Copied
You can either do it in a startup script, which we did
because there were some issues with our syntax so it is our
"interim fix" with just set classpath = <-- which didn't work
with just the append syntax, the whole thing had to be typed out,
still not sure why...
But you should be able to fix the config.xml under
<ServerStart Arguments ClassPath>
Or under the console under Servers > Remote Start > Class Path (here you have to put the entire path and just append what you need to the end because it doesn't automatically append, it overwrites
Some of this may be intuitive but it was not to me and I am still working on the syntax for the path because it works in a startup script but not in the console or config file, go figure.
I am a little limited mentally though, so it would probably be a lot easier to someone else. 🙂
Take care,
Va.
But you should be able to fix the config.xml under
<ServerStart Arguments ClassPath>
Or under the console under Servers > Remote Start > Class Path (here you have to put the entire path and just append what you need to the end because it doesn't automatically append, it overwrites
Some of this may be intuitive but it was not to me and I am still working on the syntax for the path because it works in a startup script but not in the console or config file, go figure.
I am a little limited mentally though, so it would probably be a lot easier to someone else. 🙂
Take care,
Va.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Guide
,
/t5/coldfusion-discussions/class-file-location/m-p/276167#M24568
Jun 11, 2007
Jun 11, 2007
Copy link to clipboard
Copied
Thanks for sharing.
I've had classpath problems too, so I guess it means we're both "challenged" 😉
I've had classpath problems too, so I guess it means we're both "challenged" 😉
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
ironyx
AUTHOR
New Here
,
/t5/coldfusion-discussions/class-file-location/m-p/276168#M24569
Jun 12, 2007
Jun 12, 2007
Copy link to clipboard
Copied
Quick question, I know if you load the classpath it reads
classes in the WEB_INF/classes folder, but does it treat .jar files
the same or do you have to reference them specifically? Of course,
I mean in theory 🙂
I am doing jasper reports... and want to call it from coldfusion and was wondering if I included the jasper .jar files if I would be able to point to WEB-INF/lib or if I have to have WEB-INF/lib/specific.jar
Thanks again for your help!
Va. 🙂
I am doing jasper reports... and want to call it from coldfusion and was wondering if I included the jasper .jar files if I would be able to point to WEB-INF/lib or if I have to have WEB-INF/lib/specific.jar
Thanks again for your help!
Va. 🙂
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Guide
,
/t5/coldfusion-discussions/class-file-location/m-p/276169#M24570
Jun 12, 2007
Jun 12, 2007
Copy link to clipboard
Copied
Yes, it should treat jar files the same way. ie. Just point
it at WEB-INF/lib rather than individual jar files. At least that's
been my experience 🙂
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
ironyx
AUTHOR
New Here
,
LATEST
/t5/coldfusion-discussions/class-file-location/m-p/276170#M24571
Jun 12, 2007
Jun 12, 2007
Copy link to clipboard
Copied
I am so glad to hear that... I will let you know one way or
the other how it works out...
Thanks!
Va.
Thanks!
Va.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

