JAVA File handling. ( Urgent Response Appreciated)
Hi I'm pretty new to Java. I would appreciate if any one could write programme for me for the below scenario:
Write a Java program which accepts the name of a text file, reads in that file, and prints out the following information about the file:
1. a list of all letters (A through Z) in that file, disregarding case (e.g. count ?a? and ?A? as two occurrences of the letter A), ordered with the most frequently used letter first and the least frequently used letter last, along with the number of times each letter was used,
2. an alphabetized list of all distinct words in that file with the number of times each word was used,
3. the average number of letters in a word, and
4. the average number of words in a sentence.
Use the following example paragraph to set up your test input text file:
Any experienced programmer engaged in writing programs for use by others knows that, once his program is working correctly, good output is a must. Few people really care how much time and trouble a programmer has spent in designing and debugging a program. Most people see only the results. Often, by the time a programmer has finished tackling a difficult problem, any output may look great. The programmer knows what it means and how to interpret it. However, the same cannot be said for others, or even for the programmer himself six months hence.
Hi that's not assignment question.Please do not lie. It is very not good. It is painfully obvious that that is an assignment question.
I tried to frame
my problem as questions so that its easy to
understand. I cannot provide the programm becuase I
deleted my whole programe This is another lie. That makes you zero for two thus far.
solution. Please provide me with solution. I'm need
of it .Stop begging like a dog.
Start learning.
Start here http://java.sun.com/docs/books/tutorial/java/index.html
and don't come back until you have some basic code written.
Similar Messages
-
how can i transfer my notes from my old iphone 3GS to my new iphone 5S/Urgent response appreciated.thanks a lot.cheers
Contacts should be in your supported computer contacts application.
Did you sync with your computer befor? Check your computer's Address book/Contacts/Outlook or some other contacts application.
* Your contacts are part of the backup to preserve recent calls and favorites lists. Back up your contacts to a supported personal information manager (PIM), iCloud, or another cloud-based service to avoid any potential contact data loss. -
Java.lang.StackOverflowError**Urgent Response Required !!!
All,
I have included a custom page in iProcurement 11.5.10. The page was created using jdev and XML Import Command was to import the page to JDR tables. A custom menu is defined for the application where in the page was included as a seperate tab. The requirement is to make the application route to that page when iProcurement responsibility is clicked. This is happening but when the page is tried to revisit from anyother tab , there is an exception thrown for the page.
It looks like below:
Request URI:/OA_HTML/OA.jsp
Exception:
java.lang.StackOverflowError
Did i miss out something while defining functions and menus. Any pointers will be of great help.
Thanks.Hi,
I am not able to run the page locally from jDEv. It was not able to open the application. I ran the page directly in the application from the starting of page development. There is no exception thrown as usual. Its actually another HTML file opened which shows the error as mentioned previously. I am not able to give details as I cannot attach a screen shot here.
Thanks. -
Hi Genious,
I m maintaining a error log file in my java application.now i want as soon log file exceed size limit 1024 kb. a new file should be created in same folder with datetime stamp.
pls give any me any idea how to achieve same ASAP.long fileSize = currentLogFile.length();
// bytes to kb - 1048576 = 1024 * 1024
if (filesize >= 1048576)
To continue to log, depending on your code...you would probably need to close your streams from the old file, close the file, then create a new file with the new stamp.
For example, if you had a simple log method:
private void log (String tempString)
if (logFile.length > 1048576)
pbuffer.close();
logFile.close();
DateFormat df = new SimpleDateFormat("ddMMyy");
String tempString = df.format(calendar.getTime());
File file = new File("C:/log" + tempString + System.currentTimeMillis() + ".txt");
pbuffer = new BufferedWriter(new FileWriter(file.getName()));
pbuffer.write(tempString);
}The example depends on what you are using to write the file...here I am just using a simple BufferedWriter to do all the file writing. Maybe this will help you however. :) -
Is File handling in Java Swing possible?
Hi I need to know whether file handling in Java Swing is possible or not?
cents wrote:
Thanks for ur answer.....Actually I just wanted to know whether "Reading from a file" and "Writing to a file" in Java Swing is possible or not?
Edited by: cents on Mar 16, 2010 9:35 AMWhat did google tell you? Did you see anything interesting in the API? -
M new to this forum + new to java please help me with file handling program
hi i want to make a file handling program where in i want to input a text file say f1 whose style is mentioned as below
aaa...bcd
aaabbc
acdce
a..dd
abbcd
now i want to write d out put of file f1 to file f2 but only those string entries widout any ... in them how to do that :-(( please help :((import java.io.*;
import java.lang.*;
class javcsse{
void javsce (){
BufferedReader in;
PrintWriter out;
String line;
try
in = new BufferedReader(new FileReader("e:\\cntcs\\n7.txt"));
out = new PrintWriter("e:\\cntcs\\n8.txt");
line = in.readLine();
while(line != null)
if(line.contains("...") && line.contains("....")){
break ;
else{
if(line.contains("cc"))
System.out.println(line+"\n");
out.println(line);
line = in.readLine();
in.close();
out.close();
} catch (Exception ex)
System.err.println(ex.getMessage());
public class javcse{
public static void main(String[] args) {
new javcsse();
}hey i wrote this code yet could u tell y is it still not working :(( -
Urgent! Pls help me! Can't compile any *.java files
I am a new user to Java2SDK. I am using Win2K sever and I have installed Java2SDK1.4.0 in D drive. When I compile any *.java files, a message " 'javac' is not recognized as an internal or external command, operable program or batch file" appears. How can I solve this problem?
Please help me. I am busy with my homework. Thank you very much.In your PATH variable include %JAVA_HOME%\bin;
For example:
C:\jdk1.4\bin; -
URGENT Wanting to turn java files into an exectuable file
Hi i have a swing program thats made up of a number of java files. Is there a way i can make an executable for them???
You can export it from your IDE if using one. It is straightforward in Eclipse for instance. I never had any major problems when exporting to the same OS as I developed on. Use Google.
-
Converting Jsp file to Java file-Urgent
hi,
Is it possible to convert Jsp file to a Java file?
Vijayalakshmi
Chennai
IndiaHi
Put all the logic u have put in the JSP, into a servlet and compile it.
Your webserver also does almost the same thing, it take the JSP and converts it into a servlet.
Dave -
Spliting a big java file(Urgent)
Does anyone knows how can i split a java file with many classes into many files with onli 1 class in each.
class a
class b extends a
like u can split........(make sure that all classes must be in one package ) -
Hello All,
I have a client that are using Crystal Reports embeded in their java web. They have stated that each time a report is run, a file handle is open and stays open for the rpt file.
Has anyone has any experience with forcing java to release the rpt file handle?
Thanks,
ClarkThanks for the response.
They are in a IBM Java RAD environment using Crystal v11 which is embedded with the suite. I sent them the following snippet to release the file. This should work right?
//Release report.
reportClientDoc.close();
Clark -
Make a FileChannel from file handle
I have native file handle ( void* fileHandle ) , I want a java.nio.channels.FileChannel for the same.
I am working on windows.
The native library that I am using claims to be cross platform ( pismo file mount ).
I am not sure if this is always equivalent to FileDescriptor.handle
Something I found :
http://www.kfu.com/~nsayer/Java/jni-filedesc.html
JNIEXPORT void JNICALL Java_Example_prepare_1fd(JNIEnv *env, jclass _ignore, jstring filename, jobject fdobj) {
jfieldID field_fd;
jclass class_fdesc;
int fd;
char *fname;
fname = (*env)->GetStringUTFChars(env, filename, NULL);
fd = open(fname, O_RDWR | O_NONBLOCK);
(*env)->ReleaseStringUTFChars(env, filename, fname);
class_fdesc = (*env)->GetObjectClass(env, fdobj);
field_fd = (*env)->GetFieldID(env, class_fdesc, "fd", "I");
(*env)->SetIntField(env, fdobj, field_fd, fd);
}In this only the filedescriptor is set not the file handle.
Looking at the code below
java.io.FileDescriptor
public boolean valid() {
return ((handle != -1) || (fd != -1));
}it seems initializing either file handle
or file descriptor should work. So for my case just setting the FileDescriptor.handle should work?!
Because what I have from the native side is just the file handle.
I can test my assumption for windows (may be linux if i have patience) .
But what I want to know is if this is a rule of thumb, and will work on all platforms.
That is, setting only one of filedescriptor (java.io.FileDescriptor.fd ) or file handle (java.io.FileDescriptor.handle)
will work on all platforms ?
After that I suppose I'll just
public FileChannel getFileChannel(long fileHandle){
FileDescriptor fileDescriptor = new FileDescriptor();
setFileHandle(fileDescriptor,fileHandle);// some native method which sets java.io.FileDescriptor.handle = fileHandle
return new FileInputStream(fileDescriptor).getChannel();
}Any hint, suggestion, link would be appreciated.What I found of net, and in src.zip that I have
FileDescriptor has two feilds, long handle, and int fd;
But what I got from
http://elliotth.blogspot.com/2005/08/javaiofiledescriptor-on-win32.html
It says that it's so only on windows and on linux there is only int fd.
@ejp
thanks for a quick pointer -
Oc4j java.protocol.handler.pkgs
Can anyone help, I would like to set java.protocol.handler.pkgs to "com.evermind.protocol|com.sun.net.ssl.internal.www.protocol"
I have tried to modify the default from com.evermind.protocol, using -D and tried to provide the new setting in oc4j.properties. Neither have the desired effect. I have a workaround (set at runtime), but would like to set in *.xml.
In addition, I have looked at the ApplicationServer.class file and I think the above property is 'hardcoded' in the class.
Any help would be appreciated.Hi Deepak,
Thanks for the reply.
No. The tutorial sample is not deployed to the standalond oc4j server. Instead, I am trying to deploy it against the application server.
I had the problem when setting up the connection to the standalone oc4j server. The connection error was "Error When getting MBeanServer EJB" when selecting Standalone OC4J, or "javax.naming.NamingException [Root exception is java.io.EOFException]" when selecting Standalone OC4J 10.1.3.
Thanks.
- DCFL -
We get the followign when we navigate to the 'Peoplesoft' domain and then
add a servlet and attempt to "persist".
everything else seems to work fine.
By navigating to the peolesoft domain, we open the default server
and use "edit other domain" to pull up the console. then navigate to portal ->
edit descriptors.
OS is an Win2k Server.
Thanks in advance for any help.
---- Error starts below ------
java.io.FileNotFoundException: f:\bea\weblogic\wlserver6.1\config\peoplesoft\applications
(Access is denied)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:64)
at java.io.FileInputStream.(FileInputStream.java:95)
at weblogic.utils.jars.RandomAccessJarFile.copyJarToJarDir(RandomAccessJarFile.java:272)
at weblogic.utils.jars.RandomAccessJarFile.(RandomAccessJarFile.java:144)
at weblogic.servlet.internal.dd.DescriptorLoader.persist(DescriptorLoader.java:598)
at java.lang.reflect.Method.invoke(Native Method)
at weblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl.java:636)
at weblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:621)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
at com.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
at $Proxy79.persist(Unknown Source)
at weblogic.management.console.actions.mbean.DoPersistTopLevelDescriptorAction.perform(DoPersistTopLevelDescriptorAction.java:78)
at weblogic.management.console.actions.internal.ActionServlet.doAction(ActionServlet.java:171)
at weblogic.management.console.actions.internal.ActionServlet.doGet(ActionServlet.java:91)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2495)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2204)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
--------------- nested within: ------------------
weblogic.management.console.actions.ActionException: An error occurred while attempting
to persist 'WebDescriptor-5' - with nested exception:
[java.io.FileNotFoundException: f:\bea\weblogic\wlserver6.1\config\peoplesoft\applications
(Access is denied)]
at weblogic.management.console.actions.ErrorAction.(ErrorAction.java:68)
at weblogic.management.console.actions.mbean.DoPersistTopLevelDescriptorAction.perform(DoPersistTopLevelDescriptorAction.java:80)
at weblogic.management.console.actions.internal.ActionServlet.doAction(ActionServlet.java:171)
at weblogic.management.console.actions.internal.ActionServlet.doGet(ActionServlet.java:91)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:265)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:200)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:2495)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2204)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
Current Date
Fri Jun 20 14:16:52 CDT 2003
Console Release Build
Console Build
Server Release Build
6.1.2.0
Server Build
WebLogic Server 6.1 SP2 12/18/2001 11:13:46 #154529
All Server Product Versions
WebLogic Server 6.1 SP2 12/18/2001 11:13:46 #154529
WebLogic XML Module 6.1 SP2 12/18/2001 11:28:02 #154529
Server System Properties
awt.toolkit = sun.awt.windows.WToolkit bea.home = F:\bea\weblogic file.encoding
= Cp1252 file.encoding.pkg = sun.io file.separator = \ java.awt.fonts = java.awt.graphicsenv
= sun.awt.Win32GraphicsEnvironment java.awt.printerjob = sun.awt.windows.WPrinterJob
java.class.path = .;.\lib\weblogic_sp.jar;.\lib\weblogic.jar java.class.version
= 47.0 java.ext.dirs = F:\bea\weblogic\jdk131\jre\lib\ext java.home = F:\bea\weblogic\jdk131\jre
java.io.tmpdir = C:\DOCUME~1\lackp\LOCALS~1\Temp\ java.library.path = F:\bea\weblogic\jdk131\bin;.;C:\WINNT\System32;C:\WINNT;.\bin;f:\oracle\ora92\bin;C:\Program
Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem;C:\Program
Files\Dell\OpenManage\Array Manager;C:\Program Files\Dell\OpenManage\oma\bin;C:\Program
Files\Dell\OpenManage\OMSA\bin;C:\Program Files\Dell\OpenManage\LU\bin;C:\Program
Files\Dell\OpenManage\RAC\MN;C:\Program Files\Dell\OpenManage\oldiags\bin;C:\PROGRA~1\CA\Common\SCANEN~1;C:\PROGRA~1\CA\eTrust\INOCUL~1;f:\bea\tuxedo\bin
java.naming.factory.initial = weblogic.jndi.WLInitialContextFactory java.naming.factory.url.pkgs
= weblogic.jndi.factories java.protocol.handler.pkgs = weblogic.utils|weblogic.utils|weblogic.net|weblogic.management|weblogic.net|weblogic.net
java.runtime.name = Java(TM) 2 Runtime Environment, Standard Edition java.runtime.version
= 1.3.1-b24 java.security.policy = =F:\bea\weblogic\wlserver6.1/lib/weblogic.policy
java.specification.name = Java Platform API Specification java.specification.vendor
= Sun Microsystems Inc. java.specification.version = 1.3 java.vendor = Sun Microsystems
Inc. java.vendor.url = http://java.sun.com/ java.vendor.url.bug = http://java.sun.com/cgi-bin/bugreport.cgi
java.version = 1.3.1 java.vm.info = mixed mode java.vm.name = Java HotSpot(TM)
Client VM java.vm.specification.name = Java Virtual Machine Specification java.vm.specification.vendor
= Sun Microsystems Inc. java.vm.specification.version = 1.0 java.vm.vendor = Sun
Microsystems Inc. java.vm.version = 1.3.1-b24 javax.rmi.CORBA.PortableRemoteObjectClass
= weblogic.iiop.PortableRemoteObjectDelegateImpl javax.rmi.CORBA.UtilClass = weblogic.iiop.UtilDelegateImpl
javax.xml.parsers.DocumentBuilderFactory = weblogic.xml.jaxp.RegistryDocumentBuilderFactory
javax.xml.parsers.SAXParserFactory = weblogic.xml.jaxp.RegistrySAXParserFactory
javax.xml.transform.TransformerFactory = weblogic.xml.jaxp.RegistrySAXTransformerFactory
jmx.implementation.name = JMX RI jmx.implementation.vendor = Sun Microsystems
jmx.implementation.version = 1.0 jmx.specification.name = Java Management Extensions
jmx.specification.vendor = Sun Microsystems jmx.specification.version = 1.0 Final
Release line.separator = org.xml.sax.driver = weblogic.apache.xerces.parsers.SAXParser
os.arch = x86 os.name = Windows 2000 os.version = 5.0 path.separator = ; sun.boot.class.path
= F:\bea\weblogic\jdk131\jre\lib\rt.jar;F:\bea\weblogic\jdk131\jre\lib\i18n.jar;F:\bea\weblogic\jdk131\jre\lib\sunrsasign.jar;F:\bea\weblogic\jdk131\jre\classes
sun.boot.library.path = F:\bea\weblogic\jdk131\jre\bin sun.cpu.endian = little
sun.cpu.isalist = pentium i486 i386 sun.io.unicode.encoding = UnicodeLittle user.dir
= F:\bea\weblogic\wlserver6.1 user.home = C:\Documents and Settings\lackp user.language
= en user.name = lackp user.region = US user.timezone = America/Chicago weblogic.Domain
= psglisadm weblogic.Name = psglissvr weblogic.ProductionModeEnabled = true weblogic.security.jaas.Configuration
= weblogic.security.internal.ServerConfig weblogic.security.jaas.Policy = ./lib/Server.policy
Request Info
Protocol: HTTP/1.1
ServerName: 127.0.0.1
ServerPort: 7500
Secure: false
ContextPath: /console
ServletPath: /common/error.jsp
QueryString: MBean=psglisadm%3AApplication%3DPORTAL%2CLocation%3Dpsglissvr%2CName%3DWebDescriptor-5%2CType%3DWebDescriptor%2CWebAppComponent%3DPORTAL
PathInfo: null
PathTranslated: null
RequestURI: /console/common/error.jsp
AuthType: Basic
ContentType: null
CharacterEncoding: null
Locale: en_US
Method: GET
Session: weblogic.servlet.internal.session.MemorySessionData@92f6
RequestedSessionId: 2zcy822KqSaJQpWXGNL1nqUNyhuydJL83nKXQlVvxmElLHcP77pb!157731749!-1620044925!7500!9500!1056136434604
RequestedSessionIdFromCookie: true
RequestedSessionIdFromURL: false
UserPrincipal: system
RemoteUser: system
RemoteAddr: 127.0.0.1
RemoteHost: 127.0.0.1
Parameters
MBean = psglisadm:Application=PORTAL,Location=psglissvr,Name=WebDescriptor-5,Type=WebDescriptor,WebAppComponent=PORTAL
Attributes
wlinternalaction = weblogic.management.console.actions.internal.InternalActionContext@2229ca
java.util.Locale = en_US weblogic.auth.status = 0 weblogic.httpd.user = system
weblogic.management.console.catalog.Catalog = weblogic.management.console.catalog.XmlCatalog@34fa3c
weblogic.management.console.helpers.BrowserHelper = User-Agent: Mozilla/4.0 (compatible;
MSIE 6.0; Windows NT 5.0) IE: true Netscape: false Supported: true JavscriptHrefs:
false TableCellClick: true DocumentReloadedOnResize: false DropdownStretchable:
true CellSpacingBlank: false EmptyCellBlank: false ImgOnclickSupported: true TableBorderFancy:
true PartialToWideTables: false DisabledControlSupported: true weblogic.management.console.helpers.DebugHelper
= weblogic.management.console.helpers.DebugHelper@27a485 weblogic.management.console.helpers.UnitsHelper
= weblogic.management.console.helpers.UnitsHelper@46fe47 weblogic.management.console.helpers.UrlHelper
= weblogic.management.console.helpers.UrlHelper@65ce3c
Headers
Accept = image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */* Accept-Encoding
= gzip, deflate Accept-Language = en-us Authorization = Basic c3lzdGVtOmdsaXN0ZWFtMDM=
Connection = Keep-Alive Cookie = JSESSIONID=2zcy822KqSaJQpWXGNL1nqUNyhuydJL83nKXQlVvxmElLHcP77pb!157731749!-1620044925!7500!9500
Host = 127.0.0.1:7500 Referer = http://127.0.0.1:7500/console/actions/mbean/MBeanDescriptorFramesetAction?isNew=false&sidebarFrameId=wl_console_frame_1056136434809&frameId=wl_console_frame_1056136434850&MBean=peoplesoft%3AApplication%3DPORTAL%2CName%3DPORTAL%2CType%3DWebAppComponent&bodyFrameId=wl_console_frame_1056136434811
User-Agent = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
BrowserInfo
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
IE: true
Netscape: false
Supported: true
JavscriptHrefs: false
TableCellClick: true
DocumentReloadedOnResize: false
DropdownStretchable: true
CellSpacingBlank: false
EmptyCellBlank: false
ImgOnclickSupported: true
TableBorderFancy: true
PartialToWideTables: false
DisabledControlSupported: trueEditing other domains is a scenario fraught with peril, which is why it was
deprecated and removed from the console. It looks to me that the error
message sums up the problem, ther eis no applications directory in the
peoplesoft domain? Have you tried creating that directory from the file
system?
cheers
mbg
"Dan" <[email protected]> wrote in message
news:[email protected]...
>
We get the followign when we navigate to the 'Peoplesoft' domain and then
add a servlet and attempt to "persist".
everything else seems to work fine.
By navigating to the peolesoft domain, we open the default server
and use "edit other domain" to pull up the console. then navigate toportal ->
edit descriptors.
OS is an Win2k Server.
Thanks in advance for any help.
---- Error starts below ------
java.io.FileNotFoundException:f:\bea\weblogic\wlserver6.1\config\peoplesoft\applications
(Access is denied)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.(FileInputStream.java:64)
at java.io.FileInputStream.(FileInputStream.java:95)
atweblogic.utils.jars.RandomAccessJarFile.copyJarToJarDir(RandomAccessJarFile.
java:272)
at weblogic.utils.jars.RandomAccessJarFile.(RandomAccessJarFile.java:144)
atweblogic.servlet.internal.dd.DescriptorLoader.persist(DescriptorLoader.java:
598)
at java.lang.reflect.Method.invoke(Native Method)
atweblogic.management.internal.DynamicMBeanImpl.invokeLocally(DynamicMBeanImpl
.java:636)
atweblogic.management.internal.DynamicMBeanImpl.invoke(DynamicMBeanImpl.java:6
21)
atcom.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1555)
atcom.sun.management.jmx.MBeanServerImpl.invoke(MBeanServerImpl.java:1523)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:468)
at weblogic.management.internal.MBeanProxy.invoke(MBeanProxy.java:209)
at $Proxy79.persist(Unknown Source)
atweblogic.management.console.actions.mbean.DoPersistTopLevelDescriptorAction.
perform(DoPersistTopLevelDescriptorAction.java:78)
atweblogic.management.console.actions.internal.ActionServlet.doAction(ActionSe
rvlet.java:171)
atweblogic.management.console.actions.internal.ActionServlet.doGet(ActionServl
et.java:91)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:265)
atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:200)
atweblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:2495)
atweblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2204)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
--------------- nested within: ------------------
weblogic.management.console.actions.ActionException: An error occurredwhile attempting
to persist 'WebDescriptor-5' - with nested exception:
[java.io.FileNotFoundException:f:\bea\weblogic\wlserver6.1\config\peoplesoft\applications
(Access is denied)]
at weblogic.management.console.actions.ErrorAction.(ErrorAction.java:68)
atweblogic.management.console.actions.mbean.DoPersistTopLevelDescriptorAction.
perform(DoPersistTopLevelDescriptorAction.java:80)
atweblogic.management.console.actions.internal.ActionServlet.doAction(ActionSe
rvlet.java:171)
atweblogic.management.console.actions.internal.ActionServlet.doGet(ActionServl
et.java:91)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:265)
atweblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java
:200)
atweblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletCo
ntext.java:2495)
atweblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java
:2204)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
Current Date
Fri Jun 20 14:16:52 CDT 2003
Console Release Build
Console Build
Server Release Build
6.1.2.0
Server Build
WebLogic Server 6.1 SP2 12/18/2001 11:13:46 #154529
All Server Product Versions
WebLogic Server 6.1 SP2 12/18/2001 11:13:46 #154529
WebLogic XML Module 6.1 SP2 12/18/2001 11:28:02 #154529
Server System Properties
awt.toolkit = sun.awt.windows.WToolkit bea.home = F:\bea\weblogicfile.encoding
= Cp1252 file.encoding.pkg = sun.io file.separator = \ java.awt.fonts =java.awt.graphicsenv
= sun.awt.Win32GraphicsEnvironment java.awt.printerjob =sun.awt.windows.WPrinterJob
java.class.path = .;.\lib\weblogic_sp.jar;.\lib\weblogic.jarjava.class.version
= 47.0 java.ext.dirs = F:\bea\weblogic\jdk131\jre\lib\ext java.home =F:\bea\weblogic\jdk131\jre
java.io.tmpdir = C:\DOCUME~1\lackp\LOCALS~1\Temp\ java.library.path =F:\bea\weblogic\jdk131\bin;.;C:\WINNT\System32;C:\WINNT;.\bin;f:\oracle\ora9
2\bin;C:\Program
Files\Oracle\jre\1.3.1\bin;C:\ProgramFiles\Oracle\jre\1.1.8\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem
;C:\Program
Files\Dell\OpenManage\Array Manager;C:\ProgramFiles\Dell\OpenManage\oma\bin;C:\Program
Files\Dell\OpenManage\OMSA\bin;C:\ProgramFiles\Dell\OpenManage\LU\bin;C:\Program
Files\Dell\OpenManage\RAC\MN;C:\ProgramFiles\Dell\OpenManage\oldiags\bin;C:\PROGRA~1\CA\Common\SCANEN~1;C:\PROGRA~1
\CA\eTrust\INOCUL~1;f:\bea\tuxedo\bin
java.naming.factory.initial = weblogic.jndi.WLInitialContextFactoryjava.naming.factory.url.pkgs
= weblogic.jndi.factories java.protocol.handler.pkgs =weblogic.utils|weblogic.utils|weblogic.net|weblogic.management|weblogic.net|
weblogic.net
java.runtime.name = Java(TM) 2 Runtime Environment, Standard Editionjava.runtime.version
= 1.3.1-b24 java.security.policy ==F:\bea\weblogic\wlserver6.1/lib/weblogic.policy
java.specification.name = Java Platform API Specificationjava.specification.vendor
= Sun Microsystems Inc. java.specification.version = 1.3 java.vendor = SunMicrosystems
Inc. java.vendor.url = http://java.sun.com/ java.vendor.url.bug =
http://java.sun.com/cgi-bin/bugreport.cgi
java.version = 1.3.1 java.vm.info = mixed mode java.vm.name = JavaHotSpot(TM)
Client VM java.vm.specification.name = Java Virtual Machine Specificationjava.vm.specification.vendor
= Sun Microsystems Inc. java.vm.specification.version = 1.0 java.vm.vendor= Sun
Microsystems Inc. java.vm.version = 1.3.1-b24javax.rmi.CORBA.PortableRemoteObjectClass
= weblogic.iiop.PortableRemoteObjectDelegateImpl javax.rmi.CORBA.UtilClass= weblogic.iiop.UtilDelegateImpl
javax.xml.parsers.DocumentBuilderFactory =weblogic.xml.jaxp.RegistryDocumentBuilderFactory
javax.xml.parsers.SAXParserFactory =weblogic.xml.jaxp.RegistrySAXParserFactory
javax.xml.transform.TransformerFactory =weblogic.xml.jaxp.RegistrySAXTransformerFactory
jmx.implementation.name = JMX RI jmx.implementation.vendor = SunMicrosystems
jmx.implementation.version = 1.0 jmx.specification.name = Java ManagementExtensions
jmx.specification.vendor = Sun Microsystems jmx.specification.version =1.0 Final
Release line.separator = org.xml.sax.driver =weblogic.apache.xerces.parsers.SAXParser
os.arch = x86 os.name = Windows 2000 os.version = 5.0 path.separator = ;sun.boot.class.path
=F:\bea\weblogic\jdk131\jre\lib\rt.jar;F:\bea\weblogic\jdk131\jre\lib\i18n.ja
r;F:\bea\weblogic\jdk131\jre\lib\sunrsasign.jar;F:\bea\weblogic\jdk131\jre\c
lasses
sun.boot.library.path = F:\bea\weblogic\jdk131\jre\bin sun.cpu.endian =little
sun.cpu.isalist = pentium i486 i386 sun.io.unicode.encoding =UnicodeLittle user.dir
= F:\bea\weblogic\wlserver6.1 user.home = C:\Documents and Settings\lackpuser.language
= en user.name = lackp user.region = US user.timezone = America/Chicagoweblogic.Domain
= psglisadm weblogic.Name = psglissvr weblogic.ProductionModeEnabled =true weblogic.security.jaas.Configuration
= weblogic.security.internal.ServerConfig weblogic.security.jaas.Policy =./lib/Server.policy
>
>
Request Info
Protocol: HTTP/1.1
ServerName: 127.0.0.1
ServerPort: 7500
Secure: false
ContextPath: /console
ServletPath: /common/error.jsp
QueryString:MBean=psglisadm%3AApplication%3DPORTAL%2CLocation%3Dpsglissvr%2CName%3DWebDe
scriptor-5%2CType%3DWebDescriptor%2CWebAppComponent%3DPORTAL
PathInfo: null
PathTranslated: null
RequestURI: /console/common/error.jsp
AuthType: Basic
ContentType: null
CharacterEncoding: null
Locale: en_US
Method: GET
Session:weblogic.servlet.internal.session.MemorySessionData@92f6
RequestedSessionId:2zcy822KqSaJQpWXGNL1nqUNyhuydJL83nKXQlVvxmElLHcP77pb!157731749!-1620044925!7
500!9500!1056136434604
RequestedSessionIdFromCookie: true
RequestedSessionIdFromURL: false
UserPrincipal: system
RemoteUser: system
RemoteAddr: 127.0.0.1
RemoteHost: 127.0.0.1
Parameters
MBean =psglisadm:Application=PORTAL,Location=psglissvr,Name=WebDescriptor-5,Type=We
bDescriptor,WebAppComponent=PORTAL
>
Attributes
wlinternalaction =weblogic.management.console.actions.internal.InternalActionContext@2229ca
java.util.Locale = en_US weblogic.auth.status = 0 weblogic.httpd.user =system
weblogic.management.console.catalog.Catalog =weblogic.management.console.catalog.XmlCatalog@34fa3c
weblogic.management.console.helpers.BrowserHelper = User-Agent:Mozilla/4.0 (compatible;
MSIE 6.0; Windows NT 5.0) IE: true Netscape: false Supported: trueJavscriptHrefs:
false TableCellClick: true DocumentReloadedOnResize: falseDropdownStretchable:
true CellSpacingBlank: false EmptyCellBlank: false ImgOnclickSupported:true TableBorderFancy:
true PartialToWideTables: false DisabledControlSupported: trueweblogic.management.console.helpers.DebugHelper
= [email protected]nagement.console.helpers.UnitsHelper
= [email protected]nagement.console.helpers.UrlHelper
= weblogic.management.console.helpers.UrlHelper@65ce3c
Headers
Accept = image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, */*Accept-Encoding
= gzip, deflate Accept-Language = en-us Authorization = Basicc3lzdGVtOmdsaXN0ZWFtMDM=
Connection = Keep-Alive Cookie =JSESSIONID=2zcy822KqSaJQpWXGNL1nqUNyhuydJL83nKXQlVvxmElLHcP77pb!157731749!-1
620044925!7500!9500
Host = 127.0.0.1:7500 Referer =http://127.0.0.1:7500/console/actions/mbean/MBeanDescriptorFramesetAction?isNew=false&sidebarFrameId=wl_console_frame_1056136434809&frameId=wl_console_frame_1056136434850&MBean=peoplesoft%3AApplication%3DPORTAL%2CName%3DPORTAL%2CType%3DWebAppComponent&bodyFrameId=wl_console_frame_1056136434811
User-Agent = Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)
BrowserInfo
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT5.0)
IE: true
Netscape: false
Supported: true
JavscriptHrefs: false
TableCellClick: true
DocumentReloadedOnResize: false
DropdownStretchable: true
CellSpacingBlank: false
EmptyCellBlank: false
ImgOnclickSupported: true
TableBorderFancy: true
PartialToWideTables: false
DisabledControlSupported: true -
How to pass the value of variable to another java file?
Hi. I have 2 java files (LogonAction.java and PCAction.java). The value of variable(String getrole) depends on the logon user. How can I use this value of variable in PCAction.java? I want to execute a sql statement in PCAction.java which is (String sql="Select * from PP where role"+"='" + getrole + "'") Thanks a lot.
LogonAction.java is below:
package test;
import test.jdbc.util.ConnectionPool;
import java.sql.*
import java.util.*;
import javax.servlet.http.*;
import org.apache.commons.logging.*;
import org.apache.struts.action.*;
import org.apache.struts.util.*;
import org.apache.commons.beanutils.PropertyUtils;
public final class LogonAction extends Action {
private Log log = LogFactory.getLog("org.apache.struts.webapp.Example");
private ConnectionPool pool;
public LogonAction() {
pool = ConnectionPool.getInstance();
public String getrole;
public ActionForward execute(ActionMapping mapping,
ActionForm form,
HttpServletRequest request,
HttpServletResponse response)
throws Exception {
Locale locale = getLocale(request);
MessageResources messages = getResources(request);
ActionErrors errors = new ActionErrors();
String username = (String)PropertyUtils.getSimpleProperty(form, "username");
String password = (String)PropertyUtils.getSimpleProperty(form, "password");
String getusername=CheckUser(username,password);
getrole=getusername;
java.lang.System.out.println(getrole);
if ("".equals(getusername))
errors.add(ActionErrors.GLOBAL_ERROR,
new ActionError("error.password.mismatch"));
getusername=username+getusername;
// Report any errors we have discovered back to the original form
if (!errors.isEmpty()) {
saveErrors(request, errors);
return (mapping.getInputForward());
// Save our logged-in user in the session
HttpSession session = request.getSession();
session.setAttribute(Constants.USER_KEY, getusername);
if (log.isDebugEnabled()) {
log.debug("LogonAction: User '" + username +
"' logged on in session " + session.getId());
// Remove the obsolete form bean
if (mapping.getAttribute() != null) {
if ("request".equals(mapping.getScope()))
request.removeAttribute(mapping.getAttribute());
else
session.removeAttribute(mapping.getAttribute());
// Forward control to the specified success URI
return (mapping.findForward("success"));
* Look up the user, throwing an exception to simulate business logic
* rule exceptions.
* @param database Database in which to look up the user
* @param username Username specified on the logon form
* @exception ModuleException if a business logic rule is violated
public String CheckUser(String username,String password){
Connection con = null;
try
con = pool.getConnection();
String sql = "SELECT * from user WHERE userid = ? AND password= ?";
PreparedStatement ps = null;
ResultSet rs = null;
try {
if (con.isClosed()) {
throw new IllegalStateException("error.con.isClosed");
ps = con.prepareStatement(sql);
ps.setString(1,username);
ps.setString(2,password);
rs = ps.executeQuery();
String returnstr="";
while(rs.next())
returnstr=rs.getString("role");
java.lang.System.out.println(returnstr);
return returnstr;
} catch (SQLException e) {
e.printStackTrace();
throw new RuntimeException("error.ps.executeQuery");
} finally {
try {
if (ps != null)
ps.close();
if (rs != null)
rs.close();
} catch (SQLException e) {
e.printStackTrace();
throw new RuntimeException("error.rs.close");
catch (SQLException e)
e.printStackTrace();
throw new RuntimeException("Unable to get connection.");
finally
try
if (con != null)
con.close();
catch (SQLException e)
throw new RuntimeException(e.getMessage());
}You can use PreparedStatement and
String cmd = "select * from PP where role=?";
PreparedStatement stmt = conn.prepareStatement(cmd);
stmt.setString(1,theRole);
Maybe you are looking for
-
Can not display the tables in developer
Hi! I use the following applications: Database 1 NLSRTL 9.2.0.5.0 Production 2 Oracle9i Enterprise Edition 9.2.0.5.0 Production 4 TNS for 32-bit Windows: 9.2.0.5.0 Production PL/SQL Java™ Platform 1.5.0_06 O
-
Unable to Receive the Purchase Order
Hi Experts, A PO is created with 44 units of a material. the 44 units are divided into 4 batches.When trying to do the goods receipt, it id not first prompt for any serial numbers. Hence went ahead and did the goods receipt. But could not receive th
-
27 hours to restore my Time Machine?? Really??
I am upgrading my mid 2009 macbook pro. I have used Time Machine all,these years ro backup my laptop. I am at a point of restoring the old hard drive via the Time Machine backup. Can this be right..27 hours for about 230 GB data set???? Wouldn't it b
-
Syncing more files than what is in iTunes library?
Hi All, I did some cleanup work on my MP3 collection last night through updating metadata tags, etc. I then did a reimport of my collection into iTunes. I have roughly 3300 MP3 files. When my ATV started to sync last night, I noticed it trying to syn
-
The install thing freezes!
I tried a lot of times to install but it just doesn't work. (I also always tried to uninstalled it) What I do: 1. I go to the download page and press the yellow button 2. The other page loads 3. Internet Explorer asks if I want to install it and I pr