Where to find .jar files so I can implement import java.util.logging
I'm trying to figure out how to take an application built for Websphere and port it to WebLogic. I've come across this blog entry http://blogs.sun.com/fkieviet/entry/using_java.util.logging_in_bea_weblogic and would like to try creating and using the startup class.
I have not been able to find the correct jar files.
import weblogic.common.T3ServicesDef;
import weblogic.common.T3StartupDef;
import weblogic.logging.LoggingHelper;
In reading the documentation on using the NonCatalogLogger APIs at http://download.oracle.com/docs/cd/E12840_01/wls/docs103/i18n/writing.html I also see some code calling for the following imports
import weblogic.jndi.Environment;
import weblogic.logging.NonCatalogLogger;
1. Does anyone know where I can grab these?
2. There must be a strategy for finding these .jars that people use. If so, what is it?
I thought I understood you, but the more I look at what you've set here, I'll just be honest and admit that the I don't know what you are saying here:
'You should be able to add the "weblogic.jar" in the WebLogic distribution to your classpath.' - What doe this mean?
1. Go to my xxxWeb app Dynamic Web Project and right-click and select Build Path / Configure Build Bath / Libraries - Select Add external JARS and navigate to the weblogic.jar
2. Go to my xxxWeb app Dynamic Web Project and right-click and select Build Path / Configure Build Bath / Libraries - Select Add Library and try to go from there?
3. Go to my xxxWeb app Dynamic Web Project and right-click and select Build Path / Configure Build Bath / Libraries - Select Add Variable and try to go from there?
4. Go to my xxxWeb app Dynamic Web Project and right-click and select Build Path / Configure Build Bath and do something else?
5. Something else?
Also, I don't know what you mean here:
'You don't need to (and you shouldn't) copy that jar file, just have it in your compilation classpath. It will be present automatically at runtime.'
Sorry for being so simple here but I've been trouble shooting why I can't follow what look like pretty simple steps to implement over-riding the ApplicationLifecycleListener Class to use existing java.util.logging.Logger code by adding the following to the the weblogic-application.xml:
<wls:listener>
<wls:listener-class>com.qualcomm.weblogic.log.listener.UtilLogWrapper</wls:listener-class>
</wls:listener>
And including as a referenced jar file, a simple POJO class instance of com.qualcomm.weblogic.log.listener.UtilLogWrapper.
My resrouces for this are:
1. http://blogs.sun.com/fkieviet/entry/using_java.util.logging_in_bea_weblogic.
2. http://www.oracle.com/technology/pub/articles/drolet-ant.html.
Maybe my weblogic.jar is at the root of the problem.
I hope you can 'dumb this down' for me with a simple explanation of steps to do what you outlined above.
Similar Messages
-
Can't create log file with java.util.logging
Hi,
I have created a class to create a log file with java.util.logging
This class works correctly as standalone (without jdev/weblogic)
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.*;
public class LogDemo
private static final Logger logger = Logger.getLogger( "Logging" );
public static void main( String[] args ) throws IOException
Date date = new Date();
DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
String dateStr = dateFormat.format(date);
String logFileName = dateStr + "SEC" + ".log";
Handler fh;
try
fh = new FileHandler(logFileName);
//fh.setFormatter(new XMLFormatter());
fh.setFormatter(new SimpleFormatter());
logger.addHandler(fh);
logger.setLevel(Level.ALL);
logger.log(Level.INFO, "Initialization log");
// force a bug
((Object)null).toString();
catch (IOException e)
logger.log( Level.WARNING, e.getMessage(), e );
catch (Exception e)
logger.log( Level.WARNING, "Exception", e);
}But when I use this class...
import java.io.File;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.FileHandler;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.XMLFormatter;
public class TraceUtils
public static Logger logger = Logger.getLogger("log");
public static void initLogger(String ApplicationName) {
Date date = new Date();
DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
String dateStr = dateFormat.format(date);
String logFileName = dateStr + ApplicationName + ".log";
Handler fh;
try
fh = new FileHandler(logFileName);
fh.setFormatter(new XMLFormatter());
logger.addHandler(fh);
logger.setLevel(Level.ALL);
logger.log(Level.INFO, "Initialization log");
catch (IOException e)
System.out.println(e.getMessage());
}and I call it in a backingBean, I have the message in console but the log file is not created.
TraceUtils.initLogger("SEC");why?
Thanks for your help.I have uncommented this line in logging.properties and it works.
# To also add the FileHandler, use the following line instead.
handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandlerBut I have another problem:
jdev ignore the parameters of the FileHandler method .
And it creates a general log file with anothers log files created each time I call the method logp.
So I play with these parameters
fh = new FileHandler(logFileName,true);
fh = new FileHandler(logFileName,0,1,true);
fh = new FileHandler(logFileName,10000000,1,true);without succes.
I want only one log file, how to do that? -
Java.util.logging - different log files for different loggers
I'm having trouble configuring Java logging to use different log files for different loggers.
In log4j, I would do this by configuring multiple loggers each with a different appender. But how can I do this with Java (java.util.logging) logging?
This is the basic idea of what I'd like to do:
com.mycompany.app1.level = FINEST
com.mycompany.app1.<log file> = logfile1.log
com.mycompany.app2.level = ALL
com.mycompany.app2.<log file> = logfile2.log
Any suggestions?This kind of thing?
import java.io.IOException;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.logging.SimpleFormatter;
public class LogTest {
private Logger app1;
private Logger app2;
public LogTest() {
// setup loggers
try {
// first logger
app1 = Logger.getLogger("com.mycompany.app1");
FileHandler filehandler = new FileHandler( "logfile1.log" );
filehandler.setFormatter(new SimpleFormatter());
app1.addHandler(filehandler);
// second logger
app2 = Logger.getLogger("com.mycompany.app2");
filehandler = new FileHandler( "logfile2.log" );
filehandler.setFormatter(new SimpleFormatter());
app2.addHandler(filehandler);
} catch(IOException ioex) {
ioex.printStackTrace();
private void logStuff() {
app1.log(Level.SEVERE, "a message for log 1");
app2.log(Level.SEVERE, "a message for log 2");
app2.log(Level.WARNING, "another message for log 2");
* @param args
public static void main(String[] args) {
new LogTest().logStuff();
} -
Where are the jar files downloaded.
When I run a javafx sample, the first time, it downloads so many jarfiles to a particular place on my box. When I run another sample, it downloads some other jar files, and I can bet some of the jar files downloaded by the previous sample are also downloaded by this sample, I am just thinking, if there is a central place where all downloads go to, then can we have an app check in that folder to see if a jar file is present before downloading it again??
satrinisoftinc wrote:
When I run a javafx sample, the first time, it downloads so many jarfiles to a particular place on my box. When I run another sample, it downloads some other jar files, and I can bet some of the jar files downloaded by the previous sample are also downloaded by this sample, I am just thinking, if there is a central place where all downloads go to, then can we have an app check in that folder to see if a jar file is present before downloading it again??
saHey trinisoftinc - I recommend you go investigate java webstart (jnlp). This behavior should not unique to JavaFX applications packed into jnlp but Java as well. I believe it's quite complex and I think Sun have done the right thing here. Duplication is better than potential inconsistencies between supposedly 'identical' jar's. Also, who really sign's jar's anyway.... not many... if any ;) -
import javax.mail.*;
import javax.mail.internet.*;
i need jar files for the javax.
can anybody help me out in this.
also i would like to know how to know which jar file we need for every import.
is there any better way to know about them.I think there is something named like mail.jar that java provides. Look in the Java Mail API documentation/walkthrough for details on where to download it from.
There is no really easy way to figure out what jar file is required for an import since Jar files can be named anything, and are basically an archive of class or java files. -
Find jar file using imported packages
Hi,
Shall i know how to find jar name..I'm having imported files..
For an eg,
i'm having the below one..
import org.bouncycastle.tools.openpgp.util.PGPParams;
import org.bouncycastle.tools.openpgp.util.ProcessingEngine;How to find jar by using the above imported packages?sabre150 wrote:
You can't.
Do you mean you want to download the BouncyCastle openpgp jars? If so then visit www.bouncycastle.org .
Edited by: sabre150 on Sep 7, 2009 11:46 AM
I give up on the OP. He has been doing this pgp now for more than 10 weeks and he seems unable to do more than ask daft questions or repeatedly ask for code.Maybe he's Italian. I mean, Deepa is in Deepa Shita. ;-) -
i've tried multiply times to update itunes 10.5 but it keeps saying that it can't find the file and i can't reinstall itunes because it will delete the 100 gigabites of info on it what can i do
I've had all kinds of trouble keeping my iTunes software current over the past year, but have found the easiest way to remedy the issue is to simply download the latest version of iTunes as though I am a first-time user and then just install it into the directory my current version of iTunes is using. Doing this has allowed me to update my software without losing any of my media/data. Hope this helps! Best of luck!!!
-
Where is the jar file contain this package
Dear Everybody
Could you tell me where is the .jar file that contain this package
oracle.security.idm
Thanks for your helpHi,
check jdeveloper_home\jdeveloper_10133_<version>\jlib\identitystore.jar
Frank -
Where is the .jar file that contain this package oracle.security.idm
Dear Everybody
Could you tell me where is the .jar file that contain this package
oracle.security.idm
Thanks for your helpHi,
check jdeveloper_home\jdeveloper_10133_<version>\jlib\identitystore.jar
Frank -
I have been trying to import old family dvd's into iMovie. I receive the following message "None of the selected files or folders can be imported" Is there a problem with the format not being recognized by Imovie? Same home dvd's work on internal dvd player. Any Ideas?
You need to convert the VOB files in the TS-Folder of the DVD back to DV which iMovie is designed to handle. For that you need mpegStreamclip:
http://www.squared5.com/svideo/mpeg-streamclip-mac.html
which is free, but you must also have the Apple mpeg2 plugin :
http://store.apple.com/us/product/D2187Z/A/quicktime-mpeg-2-playback-component-f or-mac-os-x
(unless you are running Lion in which case see below))
which is a mere $20.
Another possibility is to use DVDxDV:
http://www.dvdxdv.com/NewFolderLookSite/Products/DVDxDV.overview.htm
which costs $25.
For the benefit of others who may read this thread:
Obviously the foregoing only applies to DVDs you have made yourself, or other home-made DVDs that have been given to you. It will NOT work on copy-protected commercial DVDs, which in any case would be illegal.
And from the TOU of these forums:
Keep within the Law
No material may be submitted that is intended to promote or commit an illegal act.
Do not submit software or descriptions of processes that break or otherwise ‘work around’ digital rights management software or hardware. This includes conversations about ‘ripping’ DVDs or working around FairPlay software used on the iTunes Store.
If you are running Lion or later:
From the MPEG Streamclip homepage
The installer of the MPEG-2 Playback Component may refuse to install the component in Lion. Apple states the component is unnecessary in Lion onwards, however MPEG Streamclip still needs it. See this:
http://support.apple.com/kb/HT3381
To install the component in Lion, please download MPEG Streamclip 1.9.3b7 beta above; inside the disk image you will find the Utility MPEG2 Component Lion: use it to install the MPEG-2 Playback Component in Lion. The original installer's disk image (QuickTimeMPEG2.dmg) is required.
The current versions of MPEG Streamclip cannot take advantage of the built-in MPEG-2 functionality of Lion. For MPEG-2 files you still need to install the QuickTime MPEG-2 Playback Component, which is not preinstalled in Lion. (The same applies to Mountain Lion even though that has it preinstalled.) You don't have to install QuickTime 7. -
Trying to import a .mov file made with gotomeeting - no problems in past doing this. After 3 attempts recording the hour long video and trying to upload it to iMovie, it says No importable files -None of the selected files or folders can be imported. Change the selection and try again. What could the reason be?
After much research and troubleshooting, GoToMeeting replied with the final answer: We do not support the uploading of recordings to editing software. If you are having issues uploading a recording, unfortunately, we do not have tools or steps to resolve this. It is not a supported feature. I am sorry for any inconvenience this may have caused you.
The no longer plan to support editing of recordings made with their software. So, we are planning to find a new meeting provider. -
I have a standard DVD, with a VIDEO_TS folder holding some .VOB files. How can I import it to iTunes ?
I have a standard DVD, with a VIDEO_TS folder holding some .VOB files. How can I import it to iTunes ?
-
Can i import java fx in jsp or html?
can i import java fx in jsp or html?
coolsayan.2009 wrote:
just to test i did rigt-click on my web-based jsp project project->new item->other->javaFX stage and wrote the example code like:
but got all red under lined word in all the lines what to do???Ouch! Not being familiar with NetBean, I am not sure, but I fear you mix stuff.
"web-based jsp project" => so you write JSP or HTML stuff there, no? Like including the dtfx.js file and putting the javafx({ ... }) call in the proper places.
"wrote the example code like (JavaFX code)" => Maybe it should be in a separate JavaFX project? Then generate the .jar file and use it in the above project.
Now maybe I am misleading (if there is a a JavaFX stage in new items of the projects, perhaps NB allows it?) so I hope somebody knowing NB better than me will help you.
Just in case: JavaFX code goes to .fx files; you cannot embed JFX code in JSP pages. -
I have a menuapp to launch many applications, all running in same JVM and i want to add logging information to them, using java.util.logging.
Intention is to redirect the logginginfo to a specific file within the menuapp. Then i want all logging from all applications written in same file. Finally, if needed (but i don't think it is), i will include code to write logging to specific file per app (class). The latter is probably not neccessary because there are tools to analyse the logging-files and allow to select filters on specific classes only.
The applications are in their own packages/jars and contain following logging-code:
// Redirect error output
try {
myHandler = new FileHandler("myLogging.xml",1000000,2);
} catch (IOException e) {
System.out.println("Could not create file. Using the console handler");
myLogger.addHandler(myHandler);
myLogger.info("Our first logging message");
myLogger.severe("Something terrible happened");
...When i launch the menuapplication, it writes info to "myLogging.xml.0"
but when i launch an application, the app writes info to "myLogging.xml.0.1"
I already tried to leave out the creation of a new Filehandler (try/catch block in code above) but it doesn't help.
Is it possible to write loginfo to same specific file?You should open/close it somehow at every write from different processes.
But I personally prefer different file names to your forced merging, though. -
Cannot extract Zip file with Winzip after zipping with java.util.zip
Hi all,
I write a class for zip and unzip the text files together which can be zip and unzip successfully with Java platform. However, I cannot extract the zip file with Winzip or even WinRAR after zipping with Java platform.
Please help to comment, thanks~
Below is the code:
=====================================================================
package myapp.util;
import java.io.* ;
import java.util.TreeMap ;
import java.util.zip.* ;
import myapp.exception.UserException ;
public class CompressionUtil {
public CompressionUtil() {
super() ;
public void createZip(String zipName, String fileName)
throws ZipException, FileNotFoundException, IOException, UserException {
FileOutputStream fos = null ;
BufferedOutputStream bos = null ;
ZipOutputStream zos = null ;
File file = null ;
try {
file = new File(zipName) ; //new zip file
if (file.isDirectory()) //check if it is a directory
throw new UserException("Invalid zip file ["+zipName+"]") ;
if (file.exists() && !file.canWrite()) //check if it is readonly
throw new UserException("Zip file is ReadOnly ["+zipName+"]") ;
if (file.exists()) //overwrite the existing file
file.delete();
file.createNewFile();
//instantiate the ZipOutputStream
fos = new FileOutputStream(file) ;
bos = new BufferedOutputStream(fos) ;
zos = new ZipOutputStream(bos) ;
this.writeZipFileEntry(zos, fileName); //call to write the file into the zip
zos.finish() ;
catch (ZipException ze) {
throw ze ;
catch (FileNotFoundException fnfe) {
throw fnfe ;
catch (IOException ioe) {
throw ioe ;
catch (UserException ue) {
throw ue ;
finally {
//close all the stream and file
if (fos != null)
fos.close() ;
if (bos != null)
bos.close();
if (zos != null)
zos.close();
if (file != null)
file = null ;
}//end of try-catch-finally
private void writeZipFileEntry(ZipOutputStream zos, String fileName)
throws ZipException, FileNotFoundException, IOException, UserException {
BufferedInputStream bis = null ;
File file = null ;
ZipEntry zentry = null ;
byte[] bArray = null ;
try {
file = new File(fileName) ; //instantiate the file
if (!file.exists()) //check if the file is not exist
throw new UserException("No such file ["+fileName+"]") ;
if (file.isDirectory()) //check if the file is a directory
throw new UserException("Invalid file ["+fileName+"]") ;
//instantiate the BufferedInputStream
bis = new BufferedInputStream(new FileInputStream(file)) ;
//Get the content of the file and put into the byte[]
int size = (int) file.length();
if (size == -1)
throw new UserException("Cannot determine the file size [" +fileName + "]");
bArray = new byte[(int) size];
int rb = 0;
int chunk = 0;
while (((int) size - rb) > 0) {
chunk = bis.read(bArray, rb, (int) size - rb);
if (chunk == -1)
break;
rb += chunk;
}//end of while (((int)size - rb) > 0)
//instantiate the CRC32
CRC32 crc = new CRC32() ;
crc.update(bArray, 0, size);
//instantiate the ZipEntry
zentry = new ZipEntry(fileName) ;
zentry.setMethod(ZipEntry.STORED) ;
zentry.setSize(size);
zentry.setCrc(crc.getValue());
//write all the info to the ZipOutputStream
zos.putNextEntry(zentry);
zos.write(bArray, 0, size);
zos.closeEntry();
catch (ZipException ze) {
throw ze ;
catch (FileNotFoundException fnfe) {
throw fnfe ;
catch (IOException ioe) {
throw ioe ;
catch (UserException ue) {
throw ue ;
finally {
//close all the stream and file
if (bis != null)
bis.close();
if (file != null)
file = null ;
}//end of try-catch-finally
}Tried~
The problem is still here~ >___<
Anyway, thanks for information sharing~
The message is:
Cannot open file: it does not appear to be a valid archive.
If you downloaded this file, try downloading the file again.
The problem may be here:
if (fos != null)
fos.close() ;
if (bos != null)
bos.close();
if (zos != null)
zos.close();
if (file != null)
file = null ;
The fos is closed before bos so the last buffer is not
saved.
zos.close() is enough.
Maybe you are looking for
-
Cross-reference does not work inside the object states
Hi All, I use InDesign CS5.5. I have four pages document. first three page has full for text and the fourth page has multi-state object. I am trying to insert the cross reference from the third page to the multi-state object (fourth multi-state objec
-
Hi all, A table can hold maximum how many columns in oracle 9i? also For a table in oracle 9i, how many compostite key can be created? Thanks. GowriShankar.N
-
My iphone 4 has mild water damage. As a result, it will not sync with it's former XP computer with the cable. I deleted the phone's data in the troubleshooting process. I want to get it back by syncing over wifi, but I did not set up this capability
-
Just a comment/question on OS upgrades (VZW/Sprint).
First, the question: I upgraded the 8330 Curve OS to 4.5 on a friend's device (VZW). No problem, everything seems to work as near as he can tell, but for some reason it is very laggy...I searched and couldn't find a specific answer to the question.
-
Hot spots to trigger image states in Apps
I watched one of Terry White's videos on Adobe TV in which he used buttons (pins) on a map to reveal different images which were basically the different states of a multi-state object. He then output this to an iPad and everything worked fine. I've t