Java.io.IOException: error in poll: Input/output error
Hello,
My server is running on Linux 7.1, IBM JDK 1.3 and WLS 6.1. When the
following error is thrown in weblogic.log, the server is stopped by this
error. This error keeps happening once it occurs for about every one second.
####<Dec 23, 2001 3:12:46 AM SGT> <Error> <Posix Performance Pack>
<MyPC.1st-cube.com> <myserver> <ExecuteThread: '12' for queue:
'default'><><><000000> <Uncaught Throwable in processSockets>
java.io.IOException: error in poll: Input/output error
at weblogic.socket.PosixSocketMuxer.poll(Native Method)
at
weblogic.socket.PosixSocketMuxer.processSockets(PosixSocketMuxer.java:371)
at
weblogic.socket.SocketReaderRequest.execute(SocketReaderRequest.java:24)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:137)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:120)
Can anyone help?
Thanks.
Regards,
Mo
I too am seeing a slight variation of this error with JM 1.3.1. Unfortunately, the message has since been deleted. Any ideas?
java.io.IOException: Error in encoded stream, got 2
at com.sun.mail.util.BASE64DecoderStream.decode(BASE64DecoderStream.java:148)
at com.sun.mail.util.BASE64DecoderStream.read(BASE64DecoderStream.java:53)
at com.sun.mail.util.BASE64DecoderStream.read(BASE64DecoderStream.java:78)
at java.io.FilterInputStream.read(FilterInputStream.java:90)
at javax.activation.DataHandler.writeTo(DataHandler.java:289)
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1147)
at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:668)
at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:233)
at com.sun.mail.handlers.multipart_mixed.writeTo(multipart_mixed.java:67)
at javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:839)
at javax.activation.DataHandler.writeTo(DataHandler.java:295)
Similar Messages
-
Java.io.IOException: Error writing to server after installing SP17
After installing SP17 in production, we are seeing message in AE failing with com.sap.aii.af.ra.ms.api.RecoverableException: java.io.IOException: Error writing to server.
The messages don't make it to IS and are stuck in AE.
We've checked pipeline url / sm59 entry for INTEGRATION_DIRECTORY_HMI using user - XIISUSER, we did a full cache refresh.
They all appear to be set correctly.
We'll take any ideas and suggestions.
Thank you.Yes...we have been working all night on this. The FM did create an entry but it does no look like its recognising.
This is what we see in the Adapter messaging tool.
2006-09-18 13:28:24 Error Returning synchronous error notification to calling application: Received HTTP response code 401 : Unauthorized.
2006-09-18 13:28:24 Error Transmitting the message using connection http://host:8176/sap/xi/engine?type=entry failed, due to: Received HTTP response code 401 : Unauthorized.
2006-09-18 13:28:24 Error The message status set to FAIL.
2006-09-18 13:28:24 Error Returning to application. Exception: Received HTTP response code 401 : Unauthorized
Any help? -
Oc4jDcmServlet : java.io.IOException: Error writing to server
I've been using the following ant task to do a remote deployment to an OC4J container :
<tasks>
<java jar="../../../../../MAVEN-WORK/portal-lib/oc4j_remote_deploy.jar" fork="yes" maxmemory ="512m">
<jvmarg value="-Djava.protocol.handler.pkgs=HTTPClient"/>
<arg value="http://wblv-ep-sp05:1824/Oc4jDcmServletAPI/"/>
<arg value="ias_admin"/>
<arg value="admin_dev3"/>
<arg value="redeploy"/>
<arg value="/app/oracle/product/oc4jext10.1.2-d3"/>
<arg value="../portal-ear/target/portal.ear"/>
<arg value="portal"/>
<arg value="OC4J_portal"/>
</java>
</tasks>
This has worked before , but I'm suddenly getting error when trying to run it .The error message and stack trace are shown below :
[INFO] Executing tasks
[java] Initializing log
[java] Servlet interface for OC4J DCM commands
[java] Command timeout defined at 600 seconds
[java] Executing DCM command...
[java] Executing command redeploy /app/oracle/product/oc4jext10.1.2-d3 ../e
portal-ear/target/ePortalep2x-QA-V-02_00_5-20070220.ear eportal OC4J_Eportal
[java] Command = REDEPLOY
[java] Reading application's ear file
[java] Ear file was successfully read
[java] Opening connection to Oc4jDcmServlet
[java] Setting userName to ias_admin
[java] Sending command to DCM servlet
[java] **** Could not check HTTP response code
[java] ** Thread[main,5,main] ** Sun Feb 25 20:47:34 CAT 2007 ** ** EXCEP
TION: java.io.IOException: Error writing to server
[java] java.io.IOException: Error writing to server
[java] at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Htt
pURLConnection.java:416)
[java] at sun.net.www.protocol.http.HttpURLConnection.writeRequests(Htt
pURLConnection.java:428)
[java] at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Ht
tpURLConnection.java:934)
[java] at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.
java:367)
[java] at oracle.j2ee.tools.remote_deploy.Oc4jDcmClient.isHttpResponseO
k(Unknown Source)
[java] at oracle.j2ee.tools.remote_deploy.Oc4jDcmClient.sendCommand(Unk
nown Source)
[java] at oracle.j2ee.tools.remote_deploy.Oc4jDcmCommand.execute(Unknow
n Source)
[java] at oracle.j2ee.tools.remote_deploy.Oc4jDcmCommand.redeployApplic
ation(Unknown Source)
[java] at oracle.j2ee.tools.remote_deploy.Oc4jDcmMain.main(Oc4jDcmMain.
java:63)
[java] #### HTTP response is NOT ok
[java] Closing connection to Oc4jDcmServlet
[java] #### DCM command did not complete successfully (-1)
[java] #### HTTP return code was -1
[java] Java Result: -1
[INFO] Executed tasks
It seems to stall at the "Sending command to DCM servlet" stage , then fails.
Does the DCM servlet write out logs that I can look at?Where is the Oc4jDcmServlet.ear located in an OC4J container directory hierarchy?How do I redeploy the Oc4jDcmServlet.ear ?
This was working a few hours ago as seen here in my previous logs (and I do not understand what could have gone wrong) :
** Thread[main,5,main] ** Thu Feb 22 14:50:39 CAT 2007 ** Initializing log
** Thread[main,5,main] ** Thu Feb 22 14:50:39 CAT 2007 ** Servlet interface for OC4J DCM commands
** Thread[main,5,main] ** Thu Feb 22 14:50:39 CAT 2007 ** Command timeout defined at 600 seconds
** Thread[main,5,main] ** Thu Feb 22 14:50:39 CAT 2007 ** Executing command redeploy /app/oracle/product/oc4jext10.1.2-d3 ../portal-ear/target/portal.ear portal OC4J_portal
** Thread[main,5,main] ** Thu Feb 22 14:50:39 CAT 2007 ** Command = REDEPLOY
** Thread[main,5,main] ** Thu Feb 22 14:50:39 CAT 2007 ** Reading application's ear file
** Thread[main,5,main] ** Thu Feb 22 14:50:45 CAT 2007 ** Ear file was successfully read
** Thread[main,5,main] ** Thu Feb 22 14:50:45 CAT 2007 ** Opening connection to Oc4jDcmServlet
** Thread[main,5,main] ** Thu Feb 22 14:50:45 CAT 2007 ** Setting userName to ias_admin
** Thread[main,5,main] ** Thu Feb 22 14:50:45 CAT 2007 ** Sending command to DCM servlet
** Thread[main,5,main] ** Thu Feb 22 14:50:50 CAT 2007 ** HTTP response code = 200, HTTP response msg = OK
** Thread[main,5,main] ** Thu Feb 22 14:50:50 CAT 2007 ** Command was successfully sent to Oc4jDcmServlet
** Thread[main,5,main] ** Thu Feb 22 14:50:50 CAT 2007 ** Receiving session id from servlet to check command status
** Thread[main,5,main] ** Thu Feb 22 14:50:50 CAT 2007 ** Session id = 0afb65197201792b582df0d486285eef6aa19c1ab64
** Thread[main,5,main] ** Thu Feb 22 14:50:50 CAT 2007 ** Please, wait for command to finish...
** Thread[main,5,main] ** Thu Feb 22 14:51:00 CAT 2007 ** Checking command status...
** Thread[main,5,main] ** Thu Feb 22 14:51:00 CAT 2007 ** Setting userName to ias_admin
** Thread[main,5,main] ** Thu Feb 22 14:51:00 CAT 2007 ** Setting Cookie to JSESSIONID=0afb65197201792b582df0d486285eef6aa19c1ab64
** Thread[main,5,main] ** Thu Feb 22 14:51:00 CAT 2007 ** Checking command status
** Thread[main,5,main] ** Thu Feb 22 14:51:00 CAT 2007 ** HTTP response code = 200, HTTP response msg = OK
** Thread[main,5,main] ** Thu Feb 22 14:51:00 CAT 2007 ** Command has not finished yet
** Thread[main,5,main] ** Thu Feb 22 14:51:10 CAT 2007 ** Checking command status...
** Thread[main,5,main] ** Thu Feb 22 14:51:10 CAT 2007 ** Setting userName to ias_admin
** Thread[main,5,main] ** Thu Feb 22 14:51:10 CAT 2007 ** Setting Cookie to JSESSIONID=0afb65197201792b582df0d486285eef6aa19c1ab64
** Thread[main,5,main] ** Thu Feb 22 14:51:10 CAT 2007 ** Checking command status
** Thread[main,5,main] ** Thu Feb 22 14:51:10 CAT 2007 ** HTTP response code = 200, HTTP response msg = OK
** Thread[main,5,main] ** Thu Feb 22 14:51:10 CAT 2007 ** Command has not finished yet
** Thread[main,5,main] ** Thu Feb 22 14:51:20 CAT 2007 ** Checking command status...
** Thread[main,5,main] ** Thu Feb 22 14:51:20 CAT 2007 ** Setting userName to ias_admin
** Thread[main,5,main] ** Thu Feb 22 14:51:20 CAT 2007 ** Setting Cookie to JSESSIONID=0afb65197201792b582df0d486285eef6aa19c1ab64
** Thread[main,5,main] ** Thu Feb 22 14:51:20 CAT 2007 ** Checking command status
** Thread[main,5,main] ** Thu Feb 22 14:51:20 CAT 2007 ** HTTP response code = 200, HTTP response msg = OK
** Thread[main,5,main] ** Thu Feb 22 14:51:20 CAT 2007 ** Command has not finished yet
** Thread[main,5,main] ** Thu Feb 22 14:51:30 CAT 2007 ** Checking command status...
** Thread[main,5,main] ** Thu Feb 22 14:51:30 CAT 2007 ** Setting userName to ias_admin
** Thread[main,5,main] ** Thu Feb 22 14:51:30 CAT 2007 ** Setting Cookie to JSESSIONID=0afb65197201792b582df0d486285eef6aa19c1ab64
** Thread[main,5,main] ** Thu Feb 22 14:51:30 CAT 2007 ** Checking command status
** Thread[main,5,main] ** Thu Feb 22 14:51:30 CAT 2007 ** HTTP response code = 200, HTTP response msg = OK
** Thread[main,5,main] ** Thu Feb 22 14:51:30 CAT 2007 ** Command has not finished yet
** Thread[main,5,main] ** Thu Feb 22 14:51:40 CAT 2007 ** Checking command status...
** Thread[main,5,main] ** Thu Feb 22 14:51:40 CAT 2007 ** Setting userName to ias_admin
** Thread[main,5,main] ** Thu Feb 22 14:51:40 CAT 2007 ** Setting Cookie to JSESSIONID=0afb65197201792b582df0d486285eef6aa19c1ab64
** Thread[main,5,main] ** Thu Feb 22 14:51:40 CAT 2007 ** Checking command status
** Thread[main,5,main] ** Thu Feb 22 14:51:40 CAT 2007 ** HTTP response code = 200, HTTP response msg = OK
** Thread[main,5,main] ** Thu Feb 22 14:51:40 CAT 2007 ** Command has not finished yet
** Thread[main,5,main] ** Thu Feb 22 14:51:50 CAT 2007 ** Checking command status...
** Thread[main,5,main] ** Thu Feb 22 14:51:50 CAT 2007 ** Setting userName to ias_admin
** Thread[main,5,main] ** Thu Feb 22 14:51:50 CAT 2007 ** Setting Cookie to JSESSIONID=0afb65197201792b582df0d486285eef6aa19c1ab64
** Thread[main,5,main] ** Thu Feb 22 14:51:50 CAT 2007 ** Checking command status
** Thread[main,5,main] ** Thu Feb 22 14:51:50 CAT 2007 ** HTTP response code = 200, HTTP response msg = OK
** Thread[main,5,main] ** Thu Feb 22 14:51:50 CAT 2007 ** Command has not finished yet
** Thread[main,5,main] ** Thu Feb 22 14:52:00 CAT 2007 ** Checking command status...
** Thread[main,5,main] ** Thu Feb 22 14:52:00 CAT 2007 ** Setting userName to ias_admin
** Thread[main,5,main] ** Thu Feb 22 14:52:00 CAT 2007 ** Setting Cookie to JSESSIONID=0afb65197201792b582df0d486285eef6aa19c1ab64
** Thread[main,5,main] ** Thu Feb 22 14:52:00 CAT 2007 ** Checking command status
** Thread[main,5,main] ** Thu Feb 22 14:52:00 CAT 2007 ** HTTP response code = 200, HTTP response msg = OK
** Thread[main,5,main] ** Thu Feb 22 14:52:00 CAT 2007 ** Command has finishedI looked at the log.xml file under the dcm/logs/daemon_logs directory and saw this :
<MESSAGE>
<HEADER>
<TSTZ_ORIGINATING>2007-02-26T08:49:13.203+02:00</TSTZ_ORIGINATING>
<COMPONENT_ID>DCM</COMPONENT_ID>
<MSG_TYPE TYPE="ERROR"></MSG_TYPE>
<MSG_LEVEL>1</MSG_LEVEL>
<HOST_ID>wblv-ep-sp05</HOST_ID>
<HOST_NWADDR>10.251.101.25</HOST_NWADDR>
<MODULE_ID>oracle/defaultLogger/ExceptionLogger</MODULE_ID>
<THREAD_ID>Deamon Worker for TaskMaster of iAS instance at: /app/oracle/product/oc4jext10.1.2-d3 JVM Id = 1b09468.110df14be01.-8000</THREAD_ID>
<USER_ID>oracle</USER_ID>
</HEADER>
<CORRELATION_DATA>
<EXEC_CONTEXT_ID><UNIQUE_ID>10.251.101.25:47620:1172472553186:2846</UNIQUE_ID><SEQ>0</SEQ></EXEC_CONTEXT_ID>
</CORRELATION_DATA>
<PAYLOAD>
<MSG_TEXT>principals specified in application is not a valid path: /app/oracle/product/oc4jext10.1.2-d3/j2ee/home/config/../application-deployments/ADFBCManager/principals.xml</MSG_TEXT>
</PAYLOAD>
</MESSAGE>
The same MSG_TEXT appears in the log every time i had a failed deploy. -
Java.io.IOException: Error initializing HTTP tunnel connection:
Hi,
I am running sample Midlet to communicate to any URL like http://www.google.com or my internal servlet. It is opening the connection but when I try to open the inputstream it gives me following error.
java.io.IOException: Error initializing HTTP tunnel connection:
HTTP/1.1 407 Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )
Via: 1.1 TPSL-PROXY
Proxy-Authenticate: Negotiate
Proxy-Authenticate: Kerberos
Proxy-Authenticate: NTLM
Proxy-Authenticate: Digest qop="auth",algorithm=MD5-sess,nonce="3ace49b386edc8013f52a8f9b7c0638bfb8a6ca60b76bf826632da7cd6185c30d3c61c1a61a0aa91",charset=utf-8,realm="TPSL.LOCAL"
Connection: close
Proxy-Connection: close
Pragma: no-cache
Cache-Control: no-cache
Content-Type: text/html
Content-Length: 722
at com.sun.midp.io.j2me.http.Protocol.doTunnelHandshake(+333)
at com.sun.midp.io.j2me.http.Protocol.connect(+145)
at com.sun.midp.io.j2me.http.Protocol.streamConnect(+57)
at com.sun.midp.io.j2me.http.Protocol.startRequest(+12)
at com.sun.midp.io.j2me.http.Protocol.sendRequest(+38)
at com.sun.midp.io.j2me.http.Protocol.sendRequest(+6)
at com.sun.midp.io.j2me.http.Protocol.closeOutputStream(+4)
at com.sun.midp.io.BaseOutputStream.close(+14)
at HTTPTest.getGrade(+155)
at HTTPTest.startApp(+8)
at javax.microedition.midlet.MIDletProxy.startApp(+7)
at com.sun.midp.midlet.Scheduler.schedule(+270)
at com.sun.midp.main.Main.runLocalClass(+28)
at com.sun.midp.main.Main.main(+80)
I think it is going through SSL handshake which implemented in HTTP protocol in J2ME.
I have already done the proxy setup and authentication in Sun Wireless toolkit > preferences > Network configuration.
Still error is there. Please help me regarding this, not able to go ahead and rest in peace.
thanks & regards,
mJKHi,
have you checked proxy settings in WTK preferences?
Peter -
Java.io.IOException: Error in HTTP operation
hai
My Application is working fine in emulator and working fine under Via OTA and also works fine in Nokia 7210 ,but i install in Nokia 6230i i got the error java.io.IOException: Error in HTTP operation,when i type the same url in Nokia 6230i browser the result came back from the server ,only in application its not working ,plese help me regarding this , what is the problem
my code for Http Connection
System.out.println("in here");
HttpConnection c = null;
InputStream is = null;
try
System.out.println("in try");
c=(HttpConnection)Connector.open(url);
c.setRequestMethod(HttpConnection.GET);
c.setRequestProperty("User-Agent", "Profile/MIDP-2.0 Configuration/CLDC-1.0");
c.setRequestProperty("Content-Language", "en-US");
System.out.println("after passing url");
int rc = c.getResponseCode();
if (rc != HttpConnection.HTTP_OK)
throw new IOException("HTTP response code: " + rc);
System.out.println("after responce");
is = c.openInputStream();
ByteArrayOutputStream bin = new ByteArrayOutputStream();
byte[] buffer = new byte[3000];
int rd;
while ( (rd=is.read(buffer))!= -1)
bin.write(buffer,0,rd);
System.out.println("after getting data");
bin.flush();
return bin.toString();
Thanks & regards
Ravi varmaYou still did not answer my question on the other forum: what is the value of rc? int rc = c.getResponseCode();Mihai
-
Hi All,
I am getting IOException for some of the messages.
Even though I set
<system-property mail.mime.base64.ignoreerrors='true' />I am still getting exception
Java version i am using is Java 1.4.2
any help would be appreciated
Thanks,
AmitYou're probably using an older version of JavaMail. The property was
added in JavaMail 1.3.2 -
I am learning java and when I got to input output (the sample program is a BMI calculator) in my book i had to stop because i got a weird error.
Error:
BMICalculator.java:17 cannot find symbol
symbol : method create(java.io.InputStream)
location : class java.util.Scanner
Scanner stdin = Scanner.create(System.in);
^
And the line it has a problem with:
Scanner stdin = Scanner.create(System.in);
I would appreciate any help.impot java.util.*;
public class BMICalculator {
public static void main(String[]args) {
final double KILOGRAMS_PER_POUND = 0.454;
final double METERS_PER_FOOT = 0.3046;
System.out.println("BMI Calculator\n");
//Line it has a problem with
Scanner stdin = Scanner.create(System.in);
System.out.print("Enterweight (lbs): ");
double weight = stdin.nextDouble();
System.out.print("Enter height (feet); );
double height = stdin.nextDouble();
double metricWeight= weight * KILOGRAMS_PER_POUND;
double metricHeight = height * METERS_PER_FOOT;
double bmi = metricWeight / (metricHeight * metricHeight);
System.out.println("A person with");
System.out.println(" weight " + witght + " (lbs) ");
System.out.println(" height " + height + " (feet) ");
System.out.println("has a BMI of " + Math.round(bmi));
} -
Java.io.IOException during large file processing on PI 7.1
Hello Colleagues,
for a large file scenario on our PI 7.1 System we have to verify with big file size we are able to process over PI.
During handing over the large file (200 MB XML) form the Adapter Frame Work (File Adapter) to the Integration Engine we receive following error:
Transmitting the message to endpoint http://<host>:<port>/sap/xi/engine?type=entry using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: Error transmitting the message over HTTP. Reason: java.io.IOException: Error writing to server.
The message processing stopped and message still lies at Adapter Frame Work. Large files up to 100 MB we are able to process successfully.
Please, could you tell me why this happened and how we are able to solve it?
Because there is not a java.outofmemory exception however a IO exception i think it could be an memory issue?!
Many thanks in advance!
Regards,
JochenHi Jochen,
Indeed the error is IO Error and it is because the Adapter engine was not able to send the message to Integration server. But it happens due to memory/heap size issues.
Look at these thread, they are having the same problem. Please try the remedy measures suggested by them
Mail to Proxy scenario with attachment. AF channel error.
Error with huge file
problem with big file in file-to-proxy scenario
Is there any additional information in Adapter messaging tool.?
Regards
Suraj
Edited by: S.R.Suraj on Oct 1, 2009 8:55 AM -
Attempt to process file failed with java.io.IOException
Hi,
The scenario is from Idoc to flat file and messages are getting processed successfully in XI. but in receiver communication channel error is coming:
Attempt to process file failed with java.io.IOException: Error during STOR/APPE epilogue: com.sap.aii.adapter.file.ftp.FTPEx: 426 Connection closed; transfer aborted.
MP: exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: Error during STOR/APPE epilogue: com.sap.aii.adapter.file.ftp.FTPEx: 426 Connection closed; transfer aborted.: java.io.IOException: Error during STOR/APPE epilogue: com.sap.aii.adapter.file.ftp.FTPEx: 426 Connection closed; transfer aborted.Hi,
If you are using FTP then,
1. Make sure that the FTP sever does not have issues with Firewall or a Proxy server access.
2. Also verify that the specified FTP user ID has the necessary WRITE or overwrite authorization?
Regards,
Sarvesh
***Reward points, if it helped you. -
IOException: error 10054
after I run my program on emulator with monitor I get this exception:
java.io.IOException: error 10054 during TCP read
what is wrong?you have to send more details what you are doing. Does app run without problem when you aren't using network monitor.
-
Keystore java.io.IOException
Hi all, when i try to generate a secretkey and store it in a keystore, but i get an io exception for some reason.
it says:
Exception in thread "main" java.security.KeyStoreException: java.io.IOException:
Error initialising store of key store.
i really don't know what i'm doing wrong, a little bit of help would be usefull
this is a piece of my code:
private static String FILENAME = "keystore.ks";
private void registerUserKey(char[] password) throws Exception{
// Generate secret key for HMACRIPEMD160
KeyGenerator kg = KeyGenerator.getInstance("HMACRIPEMD160");
SecretKey sk = kg.generateKey();
// Create a keystore and place the key in it
// I use an UBER keystore, which is provided by Bouncycastle.
KeyStore keyStore = KeyStore.getInstance("UBER");
keyStore.load(null, null);
String alias = "exampleKey";
keyStore.setKeyEntry(alias, sk, password, null);
FileOutputStream fos = new FileOutputStream(FILENAME);
keyStore.store(fos, password);
fos.close();
}my days of wandering forums of all kind have finally paid off.
seems like adding the specific classpath option solves my problems
so now i run and compile my files with this line
java -Xbootclasspath:c:\jdk1.2.2\jre\lib\ext\jce-jdk12-118.jar;c:\jdk1.2.2\jr
e\lib\rt.jar; myfilename
and it works fine.
if there is anybody who can tell me why it doesn't work when i change my classpath (and class), that would be hugely appreciated.
But at least now i can run my applications -
Help!! ioexception error
hi, i been having this error --> java.io.IOException: Error: Attempt to clear a buffer that's already been flushed
when i attempt to forward using <jsp:forward page=abc.jsp/>
anyone can offer any suggestions?hi.
hmm, but i didn't flush anything except for the tag <jsp:include page="Header.jsp" flush=true"/>.
I tried removing the flush but it will give mi error msg.
any suggestions? -
Cannot run program "keytool": java.io.IOException
Hi,
I would like to follow the procedure to change the master password
of glassfish server hosting APEX listener
using the change-master-password subcommand, but the utility keytool
is not found:
glassfish@ahost:/opt/glassfish3/glassfish/domains/mydom01/config> /opt/glassfish3/bin/asadmin
/opt/glassfish3/bin/asadmin
Use "exit" to exit and "help" for online help.
asadmin> change-master-password mydom01
Enter the current master password> changeit
Enter the new master password> changedit
Enter the new master password again> changedit
Cannot run program "keytool": java.io.IOException: error=2, No such file or directory
Command change-master-password failed.
asadmin>
Command multimode failed.
glassfish@ahost:/opt/glassfish3/glassfish/domains/mydom01/config> which java
/usr/bin/java
glassfish@ahost:/opt/glassfish3/glassfish/domains/mydom01/config>
All of glassfish is running fine apart from this.
keytool could be found in /usr/java/latest/bin/keytool.
Do we need to have this in the path? There is no requirement in the
install guide for this, nor did the RPM installation adjust the system
path accordingly.
Hopefully someone can tell my how things ought to be regarding keytool?
Thanks, TomHi Tom,
the procedure to change the master password of glassfish server hosting APEX listener... sounds more like a GlassFish-related topic to me. I guess you'd get the best answers for such questions in a GlassFish-related forum...
For what it's worth, I'll try my best anyway:
Cannot run program "keytool": java.io.IOException: error=2, No such file or directoryThis seems to be a pretty clear error message: keytool , which is probably used to manage the keys for GlassFish users, wasn't found. This means, you're either running on an OS that is not officially certified for GlassFish, or you GlassFish hasn't been configured properly.
You ran
glassfish@ahost:/opt/glassfish3/glassfish/domains/mydom01/config> which java
/usr/bin/java... which indicates you assume your GlassFish is running without JAVA_HOME being set. If that's true, I'd begin to setup you GlassFish properly starting with that parameter.
Anyway, you also found out that
keytool could be found in /usr/java/latest/bin/keytool.... which is not +/usr/bin+ and hence probably not in the global search path of the user on whose behalf your GlassFish is running. So, you could either create a link-set[*] for +/usr/bin/keytool+ to (finally) point to +/usr/java/latest/bin/keytool+, or you setup JAVA_HOME to be +/usr/java/latest+ .
[*] Note that depending on your OS there might be more than one stage of indirection, e.g. my Ubuntu has +/usr/bin/java+ pointing to +/etc/alternatives/java+ which is pointing to +/usr/lib/jvm/java-6-sun/jre/bin/java+ where +/usr/lib/jvm/java-6-sun/+ is pointing to the directory containing the actual JDK to be used. You'll probably find something like that on your system as well. My Ubuntu box has a link for +/usr/bin/keytool+, so I get that when running "which keytool".
Do we need to have this in the path? There is no requirement in the install guide for this, nor did the RPM installation adjust the system path accordingly.Again, this is not a GlassFish forum.
I hope my hints help you solve your problem. If they don't, please choose the appropriate forum for your next post on that topic. And I guess, giving some more information on your OS and how you manage your JDK (and which version you use) will help people there to help you.
Thanks,
Udo -
Java.io.IOException: Cannot run program "ant"
Hi all,
I'm running a Job in Hudson.
I build this job from a Hudson Master Server but the job is built in a Hudson Linux Node.
This is the result:
Started by user builder
Building remotely on Linux-Node
Updating http://150.200.20.200:8000/mvtv_all/DESCOS/MVTVc_D2ph1/branches revision: 17-may-2013 16:01:46 depth:infinity ignoreExternals: false
At revision 529
Updating http://150.200.200.200:8000/mvtv_all/DESCOS/KaluModules/branches revision: 17-may-2013 16:01:46 depth:infinity ignoreExternals: false
At revision 529
no change for http://159.200.300.20:8000/mvtv_all/DESCOS/MVTVc_D2ph1/branches since the previous build
no change for http://159.230.300.20:8000/mvtv_all/DESCOS/KaluModules/branches since the previous build
No emails were triggered.
[bt] $ ant -file build.xml -DSUBSYSTEM=ALL -DTARGET=makeBuild -DCRLIST= -DOWNER= -DbuildTool.patch.release=$RELEASE -DbuildTool.system=$SYSTEM -DbuildTool.patch.type=$PATCH_TYPE -DbuildTool.subsystem=ALL -DbuildTool.buildRules=pkgBuild -DbuildTool.dynamicView=$WORKSPACE/ALL -DbuildTool.compilationRules=compile -DbuildTool.patch.name=$PATCH_NAME makeBuild
FATAL: command execution failed.Maybe you need to configure the job to choose one of your Ant installations?
java.io.IOException: Cannot run program "ant" (in directory "/hudson/buildTool/src/bt"): error=2, No existe el fichero o el directorio
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
at hudson.Proc$LocalProc.<init>(Proc.java:192)
at hudson.Proc$LocalProc.<init>(Proc.java:164)
at hudson.Launcher$LocalLauncher.launch(Launcher.java:639)
at hudson.Launcher$ProcStarter.start(Launcher.java:274)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:794)
at hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:768)
at hudson.remoting.UserRequest.perform(UserRequest.java:114)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:283)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.io.IOException: error=2, No existe el fichero o el directorio
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:135)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1021)
... 15 more
Do you know something about this issue?
Thanks and RegardsNo, and this is not the Hudson forums either. But see this error?
FATAL: command execution failed.Maybe you need to configure the job to choose one of your Ant installations?Try posting that in Google and see what you get. That's basic misery solution research 101. Post the error in Google. 999/1000 times someone has already run into it before. Please learn from their experiences by reading through them. -
Hi,
I use ridc to check in file into Oracle Center Content server. There is no problem at the beginning. But after running for several days, there is following error.
I must restart my program to solve this issue.
Can anyone help me solve this problem?
Thanks,
Tony
2013-07-11 12:24:31,189 ERROR [BatchEventHandler] com.edocs.common.api.integration.contmgmt.ContentException: oracle.stellent.ridc.protocol.ProtocolEx
ception: java.io.IOException: Input terminated before being able to read line
at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:95)
at com.edocs.common.reporting.batch.BatchEventHandler.processBatchRequest(BatchEventHandler.java:284)
at com.edocs.common.reporting.batch.BatchEventHandler.service(BatchEventHandler.java:138)
at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.executeInternal(BatchReportProcessorTask.java:156)
at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.doProcessTask(BatchReportProcessorTask.java:68)
at com.edocs.pwc.tasks.CommonTask.processTask(CommonTask.java:166)
at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.__WL_invoke(Unknown Source)
at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.processTask(Unknown Source)
at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:85)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Caused by: oracle.stellent.ridc.protocol.ProtocolException: java.io.IOException: Input terminated before being able to read line
at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:149)
at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:108)
at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:81)
... 17 more
Caused by: java.io.IOException: Input terminated before being able to read line
at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readLine(HdaBinderSerializer.java:371)
at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readToEnd(HdaBinderSerializer.java:335)
at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:165)
at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:71)
at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:126)
... 19 more
2013-07-11 12:24:33,005 ERROR [BatchEventHandler] com.edocs.common.api.integration.contmgmt.ContentException: oracle.stellent.ridc.protocol.ProtocolEx
ception: java.io.IOException: Input terminated before being able to read line
at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:95)
at com.edocs.common.reporting.batch.BatchEventHandler.processBatchRequest(BatchEventHandler.java:284)
at com.edocs.common.reporting.batch.BatchEventHandler.service(BatchEventHandler.java:138)
at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.executeInternal(BatchReportProcessorTask.java:156)
at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.doProcessTask(BatchReportProcessorTask.java:68)
at com.edocs.pwc.tasks.CommonTask.processTask(CommonTask.java:166)
at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.__WL_invoke(Unknown Source)
at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.processTask(Unknown Source)
at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:85)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Caused by: oracle.stellent.ridc.protocol.ProtocolException: java.io.IOException: Input terminated before being able to read line
at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:149)
at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:108)
at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:81)
... 17 more
Caused by: java.io.IOException: Input terminated before being able to read line
at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readLine(HdaBinderSerializer.java:371)
at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readToEnd(HdaBinderSerializer.java:335)
at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:165)
at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:71)
at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:126)
... 19 more
2013-07-11 12:24:37,870 ERROR [BatchEventHandler] com.edocs.common.api.integration.contmgmt.ContentException: oracle.stellent.ridc.protocol.ProtocolEx
ception: java.io.IOException: Input terminated before being able to read line
at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:95)
at com.edocs.common.reporting.batch.BatchEventHandler.processBatchRequest(BatchEventHandler.java:284)
at com.edocs.common.reporting.batch.BatchEventHandler.service(BatchEventHandler.java:138)
at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.executeInternal(BatchReportProcessorTask.java:156)
at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.doProcessTask(BatchReportProcessorTask.java:68)
at com.edocs.pwc.tasks.CommonTask.processTask(CommonTask.java:166)
at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.__WL_invoke(Unknown Source)
at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.processTask(Unknown Source)
at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:85)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Caused by: oracle.stellent.ridc.protocol.ProtocolException: java.io.IOException: Input terminated before being able to read line
at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:149)
at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:108)
at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:81)
... 17 more
Caused by: java.io.IOException: Input terminated before being able to read line
at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readLine(HdaBinderSerializer.java:371)
at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readToEnd(HdaBinderSerializer.java:335)
at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:165)
at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:71)
at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:126)
... 19 more
2013-07-11 12:24:39,722 ERROR [BatchEventHandler] com.edocs.common.api.integration.contmgmt.ContentException: oracle.stellent.ridc.protocol.ProtocolEx
ception: java.io.IOException: Input terminated before being able to read line
at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:95)
at com.edocs.common.reporting.batch.BatchEventHandler.processBatchRequest(BatchEventHandler.java:284)
at com.edocs.common.reporting.batch.BatchEventHandler.service(BatchEventHandler.java:138)
at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.executeInternal(BatchReportProcessorTask.java:156)
at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask.doProcessTask(BatchReportProcessorTask.java:68)
at com.edocs.pwc.tasks.CommonTask.processTask(CommonTask.java:166)
at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.__WL_invoke(Unknown Source)
at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:40)
at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl.processTask(Unknown Source)
at com.edocs.common.reporting.tasks.batchprocessor.BatchReportProcessorTask_9qwgr6_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.activation.ActivatableServerRef.invoke(ActivatableServerRef.java:85)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:522)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:146)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:518)
at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Caused by: oracle.stellent.ridc.protocol.ProtocolException: java.io.IOException: Input terminated before being able to read line
at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:149)
at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:108)
at com.edocs.common.integration.contmgmt.UCMContentManager.saveContent(UCMContentManager.java:81)
... 17 more
Caused by: java.io.IOException: Input terminated before being able to read line
at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readLine(HdaBinderSerializer.java:371)
at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.readToEnd(HdaBinderSerializer.java:335)
at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:165)
at oracle.stellent.ridc.model.serialize.HdaBinderSerializer.parseBinder(HdaBinderSerializer.java:71)
at oracle.stellent.ridc.protocol.ServiceResponse.getResponseAsBinder(ServiceResponse.java:126)
... 19 moreThe following is my testing code.
package ebilling;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.SecureRandom;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.List;
import java.util.Properties;
import java.util.concurrent.LinkedBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import oracle.stellent.ridc.IdcClient;
import oracle.stellent.ridc.IdcClientManager;
import oracle.stellent.ridc.IdcContext;
import oracle.stellent.ridc.model.DataBinder;
import oracle.stellent.ridc.model.DataObject;
import oracle.stellent.ridc.model.DataResultSet;
import oracle.stellent.ridc.model.TransferFile;
import oracle.stellent.ridc.protocol.ServiceResponse;
import org.apache.commons.lang.StringUtils;
public class UCMContentManager {
* Check in a file into a Oracle WebCenter Content Server and return content id of uploaded content item in Oracle WebCenter Content Server.
* @param properties The Oracle WebCenter Content Server connection properties.
* @param contentFile This file will be checked in a Oracle WebCenter Content Server.
* @param path The location path of checked in file in Oracle WebCenter Content Server. This path includes the file name.<br>
* For example, "/folder1/folder2/file1.txt". The "file1.txt" is the file name part. <br>
* The file name will be used as dDocName in Oracle WebCenter Server. It must be unique.<br>
* @throws ContentException The exception when uploading file into Oracle WebCenter Content Server.
* @return The content id of uploaded content item in Oracle WebCenter Content Server.
public String saveContent(Properties properties, File contentFile, String path) throws ContentException{
if(path.endsWith(SLASH)) {
throw new ContentException("Require file name in Content Management Server");
if(!path.startsWith(SLASH)) {
throw new ContentException("The file store path in Content Management Server should be absolute.");
if (path.indexOf("//") != -1) {
path = path.replace("//", SLASH);
String[] paths = path.split(SLASH);
String[] parents = new String[paths.length - 1];
String itemName = paths[paths.length-1];
System.arraycopy(paths, 0, parents, 0, paths.length-1);
ServiceResponse response = null;
try {
IdcClientManager manager = new IdcClientManager();
IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
client.getConfig().setProperty ("http.library", "apache4");
String user = properties.getProperty(USERNAME_PROPERTY);
String pwd = properties.getProperty(PASSWORD_PROPERTY);
IdcContext connectionContext = new IdcContext(user, pwd);
pwd = null;
//create the parent folders if they don't exist
String folderGUID = makeFolders(properties, parents);
//check in the file
DataBinder requestData = client.createBinder();
requestData.putLocal("IdcService", "CHECKIN_UNIVERSAL");
requestData.putLocal("IsJava", "1");
requestData.putLocal("dDocName", itemName);
requestData.putLocal("dDocTitle", itemName);
requestData.putLocal("dDocType", "Binary");
requestData.putLocal("dSecurityGroup", "Public");
requestData.addFile("primaryFile", new TransferFile(contentFile));
response = client.sendRequest(connectionContext, requestData);
DataBinder responseData = response.getResponseAsBinder();
//String did = responseData.getLocal("dID");
String dDocname = responseData.getLocal("dDocName");
closeResponse(response);
//link the file in a folder
requestData = client.createBinder();
requestData.putLocal("IdcService", "FLD_CREATE_FILE");
requestData.putLocal("fParentGUID", folderGUID);
String fileType = "owner";
requestData.putLocal("fFileType", fileType);
requestData.putLocal("dDocName", dDocname);
response = client.sendRequest(connectionContext, requestData);
return dDocname;
} catch (Throwable e) {
throw new ContentException(e);
} finally{
closeResponse(response);
public void deleteContent(Properties properties, String contentId) throws ContentException{
List<String> didList = getDIds(properties, contentId);
contentId = contentId.toUpperCase();
ServiceResponse response = null;
try {
IdcClientManager manager = new IdcClientManager();
IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
client.getConfig().setProperty ("http.library", "apache4");
String user = properties.getProperty(USERNAME_PROPERTY);
String pwd = properties.getProperty(PASSWORD_PROPERTY);
IdcContext connectionContext = new IdcContext(user, pwd);
pwd = null;
DataBinder requestData = null;
for(int i=0; i<didList.size(); i++) {
String did = didList.get(i);
requestData = client.createBinder();
requestData.putLocal("IdcService", "DELETE_DOC");
requestData.putLocal("dDocName", contentId);
requestData.putLocal("dID", did);
response = client.sendRequest(connectionContext, requestData);
closeResponse(response);
//delete parent folder
// try {
// requestData = client.createBinder();
// requestData.putLocal("IdcService", "FLD_DELETE");
// requestData.putLocal("item1", "path:" + parentPath);
// requestData.putLocal("constructDialog", "1");
// response = client.sendRequest(connectionContext, requestData);
// } catch (Exception e) {
// // TODO: handle exception
} catch (Exception e) {
throw new ContentException(e);
} finally {
closeResponse(response);
public int getFileCountInFolder(Properties properties, String path) throws ContentException{
ServiceResponse response = null;
try {
IdcClientManager manager = new IdcClientManager();
IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
client.getConfig().setProperty ("http.library", "apache4");
String user = properties.getProperty(USERNAME_PROPERTY);
String pwd = properties.getProperty(PASSWORD_PROPERTY);
IdcContext connectionContext = new IdcContext(user, pwd);
pwd = null;
DataBinder binder = client.createBinder();
binder.putLocal("IdcService", "FLD_BROWSE");
binder.putLocal("path", path);
response = client.sendRequest(connectionContext, binder);
DataBinder result = response.getResponseAsBinder();
String num = result.getLocal("numFiles");
return Integer.parseInt(num);
catch (Exception e) {
throw new ContentException(e);
} finally {
closeResponse(response);
private String getFolderGUID(Properties properties, String path) throws ContentException {
ServiceResponse response = null;
String tmpFolderGUID = null;
try {
IdcClientManager manager = new IdcClientManager();
IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
client.getConfig().setProperty ("http.library", "apache4");
String user = properties.getProperty(USERNAME_PROPERTY);
String pwd = properties.getProperty(PASSWORD_PROPERTY);
IdcContext connectionContext = new IdcContext(user, pwd);
pwd = null;
DataBinder requestData = client.createBinder();
requestData.putLocal("IdcService", "FLD_INFO");
requestData.putLocal("path", path);
response = client.sendRequest(connectionContext,
requestData);
DataResultSet result = response.getResponseAsBinder().getResultSet("FolderInfo");
tmpFolderGUID = result.getRows().get(0).get("fFolderGUID")
.toString();
if(StringUtils.isBlank(tmpFolderGUID))
tmpFolderGUID = null;
} catch (Exception e) {
} finally {
closeResponse(response);
return tmpFolderGUID;
public boolean deleteFolder(Properties properties, String path) throws ContentException {
if(getFolderGUID(properties, path)==null)
return false;
int fileCount = getFileCountInFolder(properties, path);
ServiceResponse response = null;
if(fileCount==0) {
try {
IdcClientManager manager = new IdcClientManager();
IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
client.getConfig().setProperty ("http.library", "apache4");
String user = properties.getProperty(USERNAME_PROPERTY);
String pwd = properties.getProperty(PASSWORD_PROPERTY);
IdcContext connectionContext = new IdcContext(user, pwd);
pwd = null;
DataBinder binder = client.createBinder();
binder.putLocal("IdcService", "FLD_DELETE");
binder.putLocal("item1", "path:" + path);
binder.putLocal("constructDialog", "1");
response = client.sendRequest(connectionContext, binder);
return true;
catch (Exception e) {
throw new ContentException(e);
} finally {
closeResponse(response);
} else {
return false;
private String buildPath(String[] arr, int i) {
StringBuilder buf = new StringBuilder();
for(int j=0; j<=i; j++) {
buf.append(arr[j]);
buf.append(SLASH);
return buf.toString();
private String makeFolders(Properties properties, String[] paths) throws ContentException{
String folderGUID = "";
ServiceResponse response = null;
try {
IdcClientManager manager = new IdcClientManager();
IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
client.getConfig().setProperty ("http.library", "apache4");
String user = properties.getProperty(USERNAME_PROPERTY);
String pwd = properties.getProperty(PASSWORD_PROPERTY);
IdcContext connectionContext = new IdcContext(user, pwd);
pwd = null;
String parentFolderGUID = null;
for(int i=0; i<paths.length; i++) {
String fullPath = buildPath(paths, i);
DataBinder requestData = null;
parentFolderGUID = folderGUID;
folderGUID = getFolderGUID(properties, fullPath);
boolean exists = folderGUID!=null;
DataResultSet result = null;
if(!exists) {
//create new folder
try {
requestData = client.createBinder();
requestData.putLocal("IdcService", "FLD_CREATE_FOLDER");
requestData.putLocal("fParentGUID", parentFolderGUID);
requestData.putLocal("fFolderName", paths[i]);
response = client.sendRequest(connectionContext, requestData);
} finally {
closeResponse(response);
//retrieve folderGUID of new folder
folderGUID = getFolderGUID(properties, fullPath);
} catch (Throwable e) {
throw new ContentException(e);
} finally{
closeResponse(response);
return folderGUID;
public List<String> getDIds(Properties properties, String contentId) throws ContentException{
contentId = contentId.toUpperCase();
List<String> didList = new ArrayList<String>();
ServiceResponse response = null;
try {
IdcClientManager manager = new IdcClientManager();
IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
client.getConfig().setProperty ("http.library", "apache4");
String user = properties.getProperty(USERNAME_PROPERTY);
String pwd = properties.getProperty(PASSWORD_PROPERTY);
IdcContext connectionContext = new IdcContext(user, pwd);
pwd = null;
DataBinder requestData = null;
requestData = client.createBinder();
requestData.putLocal("IdcService", "GET_SEARCH_RESULTS");
requestData.putLocal("SortField", "dInDate");
requestData.putLocal("SortType", "DESC");
requestData.putLocal("QueryText", "dDocName <matches> `" + contentId +"`");
response = client.sendRequest(connectionContext, requestData);
DataBinder result = response.getResponseAsBinder();
DataResultSet resultSet = result.getResultSet("SearchResults");
for (DataObject dataObject : resultSet.getRows()) {
// System.out.println("ID : " + dataObject.get("dID")+" dDocName : "
// + dataObject.get("dDocName") + " Title : " + dataObject.get("dDocTitle")
// + " Author : " + dataObject.get("dDocAuthor") + " Security Group : "
// + dataObject.get("dSecurityGroup"));
String did = dataObject.get("dID");
didList.add(did);
//break;
} catch (Exception e) {
throw new ContentException(e);
} finally{
closeResponse(response);
return didList;
* Get the file content represented by contentId from a Oracle WebCenter Content Server.
* The return value is the input stream of retrieved file content.
* @param properties The Oracle WebCenter Content Server connection properties.
* @param contentId The Content ID for the content item in Oracle WebCenter Content Server.
* @throws ContentException The exception when retrieving content from Oracle WebCenter Content Server.
* @return The input stream of retrieved file content.
public InputStream retrieveContent(Properties properties, String contentId) throws ContentException{
try {
return new FileInputStream(retrieveContentFile(properties, contentId));
} catch (Throwable e) {
throw new ContentException(e);
public File retrieveContentFile(Properties properties, String contentId) throws ContentException {
contentId = contentId.toUpperCase();
ServiceResponse response = null;
try {
IdcClientManager manager = new IdcClientManager();
IdcClient client = manager.createClient(properties.getProperty(URL_PROPERTY));
client.getConfig().setProperty ("http.library", "apache4");
String user = properties.getProperty(USERNAME_PROPERTY);
String pwd = properties.getProperty(PASSWORD_PROPERTY);
IdcContext connectionContext = new IdcContext(user, pwd);
pwd = null;
DataBinder binder = client.createBinder();
binder.putLocal("IdcService", "GET_FILE");
//binder.putLocal("dID", dID);
binder.putLocal("dDocName", contentId);
binder.putLocal("RevisionSelectionMethod", "Latest");
response = client.sendRequest(connectionContext, binder);
InputStream in = null;
OutputStream out = null;
String edxhome = System.getProperty("edx.home");
File tmpParent = new File(edxhome);
tmpParent = new File(tmpParent, "Output");
tmpParent = new File(tmpParent, "tmp");
tmpParent.mkdirs();
File tmpFile = File.createTempFile("down_", "_ucm", tmpParent);
tmpFile.deleteOnExit();
try {
in = response.getResponseStream();
out = new FileOutputStream(tmpFile);
byte[] buf = new byte[1024];
int read = -1;
while((read = in.read(buf))!=-1) {
out.write(buf, 0, read);
} finally{
try {
if(in!=null)
in.close();
} catch (Exception e2) {
try {
if(out!=null)
out.close();
} catch (Exception e2) {
return tmpFile;
} catch (Throwable e) {
throw new ContentException(e);
} finally{
closeResponse(response);
private void closeResponse(ServiceResponse response) {
if(response!=null) {
try {
response.close();
} catch (Exception e) {
private static final String SLASH = "/";
private static final String URL_PROPERTY = "contentServerURL";
private static final String USERNAME_PROPERTY = "contentServerUser";
private static final String PASSWORD_PROPERTY = "contentServerPassword";
static volatile boolean flag = false;
static class UploadTask implements Runnable{
public void run() {
try {
while(!flag) {
UCMContentManager manager = new UCMContentManager();
Properties properties = new Properties();
properties.put(URL_PROPERTY, "https://slc402124:16201/cs/idcplg");
properties.put(USERNAME_PROPERTY, "weblogic");
properties.put(PASSWORD_PROPERTY, "weblogic1");
File contentFile = new File("C:/toding/mypro/UCM/test.txt");
String parentPath = "/new/test/multiThreadUpload/";
String location = makePath(parentPath);
manager.saveContent(properties, contentFile, location);
System.out.println(location);
Thread.sleep(5000);
} catch (Exception e) {
e.printStackTrace();
flag = true;
public static void main(String[] args) throws Exception{
ThreadPoolExecutor executor = new ThreadPoolExecutor(10, 10, 60, TimeUnit.SECONDS,
new LinkedBlockingQueue<Runnable>());
for(int i=0; i<10; i++) {
UploadTask uploadTask = new UploadTask();
executor.execute(uploadTask);
while(!flag) {
Thread.sleep(5000);
executor.shutdown();
public static String makePath(String parentPath) {
StringBuilder buf = new StringBuilder();
buf.append(parentPath);
if(!parentPath.endsWith("/")) {
buf.append("/");
Calendar rightNow = Calendar.getInstance();
String pattern = "yyyyMMdd";
SimpleDateFormat simDateForm = new SimpleDateFormat(pattern);
String dateStr = simDateForm.format((rightNow).getTime());
pattern = "HHmmssSSS";
simDateForm = new SimpleDateFormat(pattern);
String timeStr = simDateForm.format((rightNow).getTime());
buf.append(dateStr);
buf.append("/");
buf.append(timeStr);
buf.append("_");
buf.append(random.nextInt(10000));
String finalLocation = buf.toString();
return finalLocation;
private static SecureRandom random = new SecureRandom();
Maybe you are looking for
-
Published page load times...:(
i notice my page take a little longer than i would expect. any particular reason? test it yourself: www.advancedsound.com.au thanks
-
How to Populate a table type variable from a cursor
Hi I have a stored procedure (P1) that returns a ref cursor as the output. Another procedure (P2) receives this ref cursor (C). In this procedure (P2), I want to do a Bulk Collect from this ref cursor (C) in a table type variable that has been declar
-
Photoshop CS5 - Save as Adobe pdf doesn't appear
HI, I AM TRYING TO SOLVE THIS PROBLEM WHOLE DAY. I HAVE MAC OSX 10.6.5 UPDATED, ACROBAT PRO 9.4.1 UPDATED, PHOTOSHOP CS 5 12.0.1 UPDATEM. BUT WHEN I WAS GO TO PRINT-PRINT SETTINGS-PDF THERE WHOLE UNDERLINE PRESETS DO NOTHING. /MEANS MAIL PDF, SAVE AS
-
Iphone 5 - Switchs on and off automatically
Hello, I have just encountered the following problem on my Iphone 5. I have bought my phone an year ago and updated IOS to IOS7 and had no issues till now. I was playing a game and the device shut down automaticall and immediatly reboots only to shut
-
Made site in Dreamweaver, doesn't display correctly using free hosts
Hello everyone I'm just a beginner using DW and have a slightly older version - DW MX2004. I have built my site in DW, and wanted to try a free web hosting service until I see if I like having a website and will actually be good at keeping it updated