SOME MOST PROBALE ERROR IN MOST JAVA CODE
hi...
Otn team..
i want to know while i am running some program in netBeans it shows some error ...
1)class interface or enum expected.
2)illegal Start of type.
3)if i use super keyword to add some argument within it than it shows an error that
"Keyword super should be used at the start of method constructr"
4)Method does not override or implement method from a supertype
5)Class SalaryEmploy is public and should be declared in a file names SalaryEmploy..
can any one please help what are these error and why they comes??
1 - In
import java.util.Date;
public class Caos {
}You most likely forgot the 'class' keyword.
2 - It is very likely you have unbalanced '{' somewhere in your code.
3 - The super keyword is meant to invoke constructors on the super class, and this should happen before your own construction code ever happen, java language defines that the default super constructor is invoked if you do nothing to invoke it and if you invoke it you must do that as the very first thing in your constructor.
4 - You are marking something with @override which does not override anything, or just implements an interface method if you are using java 5.
5 - By definition, every public class should be declared on its own file and the file have to have the same name as the class, so class SalaryEmploy shouold be in SalaryEmploy.java
Similar Messages
-
Dear Experts,
I am trying toimplement a JAVA code in SAP NWDS (NetWeaver Develope Studio) and i have imported the necessary jar files also. However there are some errors that I am not able to solve. Below is the JAVA code that i am using
package JAVAinXSLT;
import com.sap.aii.mapping.api.AbstractTransformation;
import com.sap.aii.mapping.api.StreamTransformation;
import com.sap.aii.mapping.api.StreamTransformationException;
import java.util.*;
import java.text.*;
import com.sap.aii.mapping.api.TransformationInput;
public class Email extends AbstractTransformation
public static String getFromEmail(TransformationInput in)throws StreamTransformationException
try {
// Read Import Parameters
String paramFrom = in.getInputParameters().getString("PARAM_FROM");
return paramFrom;
catch (Throwable throwable)
throwable.printStackTrace();
public static String getToEmail(TransformationInput in)throws StreamTransformationException
try
// Read Import Parameters
String paramTo = in.getInputParameters().getString("PARAM_TO");
return paramTo;
catch (Throwable throwable)
throwable.printStackTrace();
The errors that I am getting are:
1) ERROR: The type Email must implement the inherited abstract method AbstractTransformation.transform(TransformationInput, TransformationOutput)
This is at public class Email extends AbstractTransformation
2) ERROR: This method must return a result of type String
At line public static String getFromEmail(TransformationInput in)throws StreamTransformationException
3) ERROR: This method must return a result of type String
At the line public static String getToEmail(TransformationInput in)throws StreamTransformationException
There seems to be error in declaration.....but I am not able to solve it. So please help me out here
Thanks,
Abhishek.Hi,
Refer the URL :http://help.sap.com/javadocs/pi/SP3/xpi/com/sap/aii/mapping/api/AbstractTransformation.html
regards,
ganga -
ORABPEL-05250 - Deployment error after embedding java code
hi i am getting the following error when deploying my composite i added embedded java and imported the necessary classes i think but if i take the embedded java out it deploys succsefully :
[09:17:17 PM] Received HTTP response from the server, response code=500
[09:17:17 PM] Error deploying archive sca_getPickFile_rev1.0.jar to partition "default" on server SANDPIT_SOA
[09:17:17 PM] HTTP error code returned [500]
[09:17:17 PM] Error message from server:
There was an error deploying the composite on SANDPIT_SOA: Error occurred during deployment of component: processGetPckFile to service engine: implementation.bpel, for composite: getPickFile: ORABPEL-05250
Error deploying BPEL suitcase.
error while attempting to deploy the BPEL component file "/u01/oracle/FSOAS/product/fmw/user_projects/domains/FSOAS_domain/servers/SANDPIT_SOA/dc/soa_e76b434b-6704-4820-b544-ad56277e0fd9"; the exception reported is: java.lang.RuntimeException: failed to compile execlets of processGetPckFile
This error contained an exception thrown by the underlying deployment module.
Verify the exception trace in the log (with logging level set to debug mode).
[09:17:17 PM] Check server log for more details.
[09:17:17 PM] Error deploying archive sca_getPickFile_rev1.0.jar to partition "default" on server SANDPIT_SOA
[09:17:17 PM] #### Deployment incomplete. ####
[09:17:17 PM] Error deploying archive file:/C:/JDeveloper/mywork/pdfService/getPickFile/deploy/sca_getPickFile_rev1.0.jar
(oracle.tip.tools.ide.fabric.deploy.common.SOARemoteDeployer)Hi
some times this error comes if the Packages for using JAVA are not i mported into BPEL Weused to get same error but after importing the packages the error usually used to be solved please check whether if the class files which you are using are correctly imported or not
ex
<import location="java.util.Properties"
importType="http://schemas.oracle.com/bpel/extension/java"/>
<import location="java.io.*"
importType="http://schemas.oracle.com/bpel/extension/java"/> -
XPathFactory error in embedded Java code
Hi,
I'm getting the following error when executing embedded Java code which does an XPath expression. Does anyone know why this is happening? Thanks.
[2006/03/13 17:55:22] "{http://schemas.oracle.com/bpel/extension}bindingFault" has been thrown. less
<bindingFault xmlns="http://schemas.oracle.com/bpel/extension">
<part name="summary">
<summary>Operation failed!; nested exception is: java.lang.IllegalArgumentException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: No XPathFctory implementation found for the object model: http://java.sun.com/jaxp/xpath/dom</summary>
</part>
<part name="detail">
<detail>java.lang.IllegalArgumentException: XPathFactory#newInstance() failed to create an XPathFactory for the default object model: http://java.sun.com/jaxp/xpath/dom with the XPathFactoryConfigurationException: javax.xml.xpath.XPathFactoryConfigurationException: No XPathFctory implementation found for the object model: http://java.sun.com/jaxp/xpath/dom</detail>
</part>
</bindingFault>Hi,
Refer the URL :http://help.sap.com/javadocs/pi/SP3/xpi/com/sap/aii/mapping/api/AbstractTransformation.html
regards,
ganga -
Error in simple java code.
Hi folks,
I am having some problem to compile this code, anybody can help me please ?
Thanks a lot.
Patricio.
package Duck02;
import java.util.List;
import com.sapportals.portal.prt.component.*;
import com.sapportals.wcm.repository.IResource;
import com.sapportals.wcm.repository.ResourceContext;
import com.sapportals.wcm.repository.ResourceFactory;
import com.sapportals.wcm.util.uri.RID;
import com.sapportals.portal.security.usermanagement.IUser;
import com.sap.netweaver.bc.rf.common.exception.*;
public class MyFirstComponent extends AbstractPortalComponent
public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
IResourceContext resourceContext = new ResourceContext(user);
RID rid = RID.getRID("/etc");
try {
IResource resource = ResourceFactory.getInstance().getResource(rid, resourceContext);
if( resource != null ) {
// resource found
System.out.println("resource " + resource.getRID() + " found");
} else {
// resource not found
System.out.println("resource " + resource.getRID() + " does not exist");
catch( ResourceException e ) {
// problem while retrieving the resource
System.out.println(
"exception while trying to get resource " + e.getRID()
+ ": " + e.getMessage()You could find the jar in your local installation directory of NWDS or you can send me an email at psingh(at)ust.net. Your code should look like following.
p
ackage Duck02;
import java.util.List;
import com.sapportals.portal.prt.component.*;
import com.sapportals.wcm.repository.IResource;
import com.sapportals.wcm.repository.ResourceContext;
import com.sapportals.wcm.repository.ResourceFactory;
import com.sapportals.wcm.util.uri.RID;
import com.sapportals.portal.security.usermanagement.IUser;
import com.sap.netweaver.bc.rf.common.exception.*;
public class MyFirstComponent extends AbstractPortalComponent
public void doContent(IPortalComponentRequest request, IPortalComponentResponse response)
IUser user = WPUMFactory.getUserFactory().getEP5User(request.getUser());
IResourceContext resourceContext = new ResourceContext(user);
RID rid = RID.getRID("/etc");
try {
IResource resource = ResourceFactory.getInstance().getResource(rid, resourceContext);
if( resource != null ) {
// resource found
System.out.println("resource " + resource.getRID() + " found");
} else {
// resource not found
System.out.println("resource " + resource.getRID() + " does not exist");
catch( ResourceException e ) {
// problem while retrieving the resource
System.out.println(
"exception while trying to get resource " + e.getRID()
+ ": " + e.getMessage() -
Error in embedding java code in Bpel process
I am calling one of the java snippet in my process which in turn uses the files from some jars.
But I am getting error :
<2006-11-07 12:08:51,227> <ERROR> <default.collaxa.cube.engine.bpel> BPELExecution
java.lang.ExceptionInInitializerError
at bpel.p0.ExecLetBxExe0.execute(ExecLetBxExe0.java:35)
at com.collaxa.cube.engine.ext.wmp.BPELXExecWMP.__executeStatements(BPELXExecWMP.java:52)
at com.collaxa.cube.engine.ext.wmp.BPELActivityWMP.perform(BPELActivityWMP.java:188)
at com.collaxa.cube.engine.CubeEngine.performActivity(CubeEngine.java:3408)
at com.collaxa.cube.engine.CubeEngine.handleWorkItem(CubeEngine.java:1836)
at com.collaxa.cube.engine.dispatch.message.instance.PerformMessageHandler.handleLocal(PerformMessageHandler.java:75)
at com.collaxa.cube.engine.dispatch.DispatchHelper.handleLocalMessage(DispatchHelper.java:166)
at com.collaxa.cube.engine.dispatch.DispatchHelper.sendMemory(DispatchHelper.java:252)
at com.collaxa.cube.engine.CubeEngine.endRequest(CubeEngine.java:5438)
at com.collaxa.cube.engine.CubeEngine.createAndInvoke(CubeEngine.java:1217)
at com.collaxa.cube.engine.delivery.DeliveryService.handleInvoke(DeliveryService.java:511)
at com.collaxa.cube.engine.ejb.impl.CubeDeliveryBean.handleInvoke(CubeDeliveryBean.java:335)
at ICubeDeliveryLocalBean_StatelessSessionBeanWrapper16.handleInvoke(ICubeDeliveryLocalBean_StatelessSessionBeanWrapper16.java:1796)
at com.collaxa.cube.engine.dispatch.message.invoke.InvokeInstanceMessageHandler.handle(InvokeInstanceMessageHandler.java:37)
at com.collaxa.cube.engine.dispatch.DispatchHelper.handleMessage(DispatchHelper.java:125)
at com.collaxa.cube.engine.dispatch.BaseScheduledWorker.process(BaseScheduledWorker.java:70)
at com.collaxa.cube.engine.ejb.impl.WorkerBean.onMessage(WorkerBean.java:86)
at com.evermind.server.ejb.MessageDrivenBeanInvocation.run(MessageDrivenBeanInvocation.java:123)
at com.evermind.server.ejb.MessageDrivenHome.onMessage(MessageDrivenHome.java:755)
at com.evermind.server.ejb.MessageDrivenHome.run(MessageDrivenHome.java:928)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.ClassCastException
at com.misys.eqplus.framework.management.instrumentation.ManagementEvent.<clinit>(ManagementEvent.java:36)
... 22 more
I am putting the jar files in my
BPEL_INF flder
and entering it in this in C:\OraBPELPM_1integration\orabpel\domains\default\config\domain
properties file in C:\OraBPELPM_1\integration\orabpel\domains\default\config
ear file in C:\OraBPELPM_1\integration\orabpel\system\appserver\oc4j\j2ee\home\applications
Please help meHello Santosh,
Are you importing the used java classes using <bpelx:exec import="classname"/>
Regards,
Melvin -
Plz help , getting error in my java code
Can any one tell the reason for this error:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
is there any size limit for java classes that I am using in my code?
My code Looks like:
FileChannel in = null, out = null;
try {
in = new FileInputStream(sourceLocation).getChannel();
System.out.println(in.size() +"RptPageBreak rtn: b 4 read file into buffer, source=" + sourceLocation);
// read the file into buffer
// System.out.println("-1 " +in.size() );
MappedByteBuffer buf = in.map(FileChannel.MapMode.READ_ONLY, 0, in.size());
//System.out.println("RptPageBreak rtn: AFTER read file into buffer" );
System.out.println("1: "+ buf.capacity()+" " +in.size() );
// CharBuffer cb;
try {
cb = Charset.forName ("UTF-8").decode (buf);
} catch (Exception ex) {
System.out.println("2:"+ ex.getMessage());
ex.printStackTrace();
System.out.println("2");
String lines[] = Pattern.compile ("\n").split (cb, 0);
//System.out.println("RptPageBreak rtn: lines.len=" + lines.length);
Writer writer = new FileWriter (targetLocation);
System.out.println("3");
for (int i = 0, n = lines.length; i < n; i++) {
// also compare if starts with a CRLF
if ( ( lines.startsWith("\r\n" + rpt_headg_id) == true ) ||
( lines[i].startsWith("\f" + rpt_headg_id) == true ) ||
( lines[i].startsWith(rpt_headg_id) == true ) )
//if ( lines[i].contains(rpt_headg_id) == true )
//System.out.println("RptPageBreak rtn: found headg in if loop " + rpt_headg_id );
writer.write ("1");
else {
writer.write (" "); // detail lines shift over 1 by addg a space
writer.write (lines[i]);
writer.write ('\n');
//System.out.println("RptPageBreak rtn: lines[i]=" + i + ' ' + lines[i]);
writer.close ();
}catch(Exception e)
System.out.println("RptPageBreak rtn: Catch Exception: " + e.getMessage() );
status=false;
e.printStackTrace();
finally {
try {
if (in != null) in.close();
if (out != null) out.close();
status=true;
catch(Exception e)
System.out.println("RptPageBreak rtn: Finally-Catch Exception: " + e.getMessage() );
status=false;
e.printStackTrace();It has nothing to do with classes. It is that you are reading to much info into memory at one time. If you are only going to cycle through the input line for line, anyway, then why don't you simply read the file (or whatever) a line at a time and process it as you read it, rather than loading the entire thing at once?
-
Error when executing Java code, java.lang.NoClassFoundError:
Hi, I am new learner in Java Programming and I am using J2SDK and notepad to write a code. I don't have problem in compiling using javac filename, however I received an error when executing using java filename.
The error message I got is Exception in thread "main" java.lang.NoClassDefFoundError: Hello/jawa.
I have verified this simple code - Hello has no issue but somehow it does not run. I even try to compile and execute in other computer also the similiar error returned.
My Client Platform is Windows XP Professional.
I would appreciate any expert can help to suggest me the knowledge/solution to fix this kind of error. Thanks
JackieIt looks like you entered the command "java Hello.java" or "java Hello/java" (I assumed 'jawa' was a typo.)
You should have entered "java Hello" if your class name is Hello. I am guessing that Hello.java is probably the source code file name. The argument to the java command is the fully qualified class name. "java Hello.java" tells the java command to look for a class named java that is in the Hello package. -
Hi
I have requirement of converting word document to PDF/A. Iam using the APIs provided by Livecycle ES. I tried to implement the requirement by creating a java program with the jar files provided. But iam getting the following error. Can anyone plz help me?
ALC-PDG-1000-000: com.adobe.livecycle.generatepdf.client.ConversionException: ALC-PDG-001-000-Conversion failed because of an exception.
Causing exception message : Remote EJBObject lookup failed for 'ejb/Invocation'; nested exception is:
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
Caused by: java.rmi.RemoteException: Remote EJBObject lookup failed for 'ejb/Invocation'; nested exception is:
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.initialise(EjbMessageDispatcher. java:90)
at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.doSend(EjbMessageDispatcher.java :119)
at com.adobe.idp.dsc.provider.impl.base.AbstractMessageDispatcher.send(AbstractMessageDispat cher.java:57)
at com.adobe.idp.dsc.clientsdk.ServiceClient.invoke(ServiceClient.java:208)
at com.adobe.livecycle.generatepdf.client.GeneratePdfServiceClient.createPDF(GeneratePdfServ iceClient.java:172)
at Converttopdfa.main(Converttopdfa.java:44)
Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.adobe.idp.dsc.provider.impl.ejb.EjbMessageDispatcher.initialise(EjbMessageDispatcher. java:84)
... 5 more
Error OCCURRED: ALC-PDG-001-000-Conversion failed because of an exception.
Causing exception message : Remote EJBObject lookup failed for 'ejb/Invocation'; nested exception is:
javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
at com.adobe.livecycle.generatepdf.client.GeneratePdfServiceClient.createPDF(GeneratePdfServ iceClient.java:194)
at Converttopdfa.main(Converttopdfa.java:44)XML reading program<br /><br />package com.parser;<br />import static org.w3c.dom.Node.ATTRIBUTE_NODE;<br />import static org.w3c.dom.Node.CDATA_SECTION_NODE;<br />import static org.w3c.dom.Node.COMMENT_NODE;<br />import static org.w3c.dom.Node.DOCUMENT_TYPE_NODE;<br />import static org.w3c.dom.Node.ELEMENT_NODE;<br />import static org.w3c.dom.Node.ENTITY_NODE;<br />import static org.w3c.dom.Node.ENTITY_REFERENCE_NODE;<br />import static org.w3c.dom.Node.NOTATION_NODE;<br />import static org.w3c.dom.Node.PROCESSING_INSTRUCTION_NODE;<br />import static org.w3c.dom.Node.TEXT_NODE;<br /><br />import java.io.IOException;<br />import java.io.StringReader;<br />import java.util.ArrayList;<br />import java.util.HashMap;<br /><br />import javax.xml.parsers.DocumentBuilder;<br />import javax.xml.parsers.DocumentBuilderFactory;<br />import javax.xml.parsers.ParserConfigurationException;<br /><br />import org.w3c.dom.Document;<br />import org.w3c.dom.DocumentType;<br />import org.w3c.dom.Node;<br />import org.w3c.dom.NodeList;<br />import org.w3c.dom.Text;<br />import org.xml.sax.InputSource;<br />import org.xml.sax.SAXException;<br /><br />public class MainClass {<br /> <br /> HashMap map = new HashMap();<br /> ArrayList a = new ArrayList(10);<br /> public static void main(String args[]) {<br /> DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();<br /> builderFactory.setNamespaceAware(true); // Set namespace aware<br /> builderFactory.setValidating(true); // and validating parser feaures<br /> builderFactory.setIgnoringElementContentWhitespace(true); <br /> <br /> DocumentBuilder builder = null;<br /> try {<br /> builder = builderFactory.newDocumentBuilder(); // Create the parser<br /> } catch(ParserConfigurationException e) {<br /> e.printStackTrace();<br /> }<br /> Document xmlDoc = null;<br /><br /> try {<br /> xmlDoc = builder.parse(new InputSource(new StringReader(xmlString1)));<br /><br /> } catch(SAXException e) {<br /> e.printStackTrace();<br /><br /> } catch(IOException e) {<br /> e.printStackTrace();<br /> }<br /> DocumentType doctype = xmlDoc.getDoctype(); <br /> if(doctype == null) { <br /> System.out.println("DOCTYPE is null");<br /> } else { <br /> System.out.println("DOCTYPE node:\n" + doctype.getInternalSubset());<br /> }<br /><br /> System.out.println("\nDocument body contents are:");MainClass m = new MainClass();<br /> m.listNodes(xmlDoc.getDocumentElement(),""); // Root element & children<br /> <br /> m.abc();<br /> }<br /> public void abc(){<br /> System.out.println("++++"+a.size());<br /> <br /> for(int i=0; i<a.size();i+=2){<br /> map.put(a.get(i), a.get(i+1));<br /> <br /> <br /> //map.put(i, i+1);<br /> <br /> //map.put(a.get(i), a.get(i+1));<br /> } <br /> <br /> System.out.println("Map"+map.toString());<br /> <br /> <br /> }<br /> <br /> private void listNodes(Node node, String indent) {<br /> try{<br /> <br /> String nodeName = node.getNodeName();<br /> //System.out.println(indent+" Node: " + nodeName);<br /> // if(nodeName == "id")<br /> short type = node.getNodeType();<br /> <br /> //System.out.println(indent+" Node Type: " + nodeType(type));<br /> if(type == TEXT_NODE){<br /> <br /> <br />// System.out.println(indent+" Node is: "+(node).getParentNode().getNodeName());<br /> if((node).getParentNode().getNodeName()== "id"){<br /> //System.out.println(indent+" Node is: "+(node).getParentNode().getNodeName());<br /> System.out.println(indent+" key is: "+((Text)node).getWholeText());<br /> a.add(((Text)node).getWholeText());<br /> }<br /> if((node).getParentNode().getNodeName()== "val"){<br /> //System.out.println(indent+" Node is: "+(node).getParentNode().getNodeName());<br /> System.out.println(indent+" value is: "+((Text)node).getWholeText());<br /> a.add(((Text)node).getWholeText());<br /> }<br /> <br /> <br /> }<br /> <br /> NodeList list = node.getChildNodes(); <br /> if(list.getLength() > 0) { <br /> // System.out.println(indent+" Child Nodes of "+nodeName+" are:");<br /> for(int i = 0 ; i<list.getLength() ; i++) {<br /> listNodes(list.item(i),indent+" "); <br /> }<br /> <br /> <br /> } <br /> } catch(Exception e){<br /> e.printStackTrace();<br /> }<br /> }<br /><br /> static String nodeType(short type) {<br /> switch(type) {<br /> case ELEMENT_NODE: return "Element";<br /> case DOCUMENT_TYPE_NODE: return "Document type";<br /> case ENTITY_NODE: return "Entity";<br /> case ENTITY_REFERENCE_NODE: return "Entity reference";<br /> case NOTATION_NODE: return "Notation";<br /> case TEXT_NODE: return "Text";<br /> case COMMENT_NODE: return "Comment";<br /> case CDATA_SECTION_NODE: return "CDATA Section";<br /> case ATTRIBUTE_NODE: return "Attribute";<br /> case PROCESSING_INSTRUCTION_NODE: return "Attribute";<br /> }<br /> return "Unidentified";<br /> }<br /><br /> static String xmlString ="<?xml version=\"1.0\"?>" +<br /> " <!DOCTYPE address" +<br /> " [" +<br /> " <!ELEMENT address (buildingnumber, street, city, state, zip)>" +<br /> <br /> " <!ELEMENT buildingnumber (#PCDATA)>" +<br /> " <!ELEMENT street (#PCDATA)>" +<br /> " <!ELEMENT city (#PCDATA)>" +<br /> " <!ELEMENT state (#PCDATA)>" +<br /> " <!ELEMENT zip (#PCDATA)>" +<br /> " ]>" +<br /> "" +<br /> " <address>" +<br /> " <buildingnumber> 29 </buildingnumber>" +<br /> " <street> South Street</street>" +<br /> " <city>Vancouver</city>" +<br /> "" +<br /> " <state>BC</state>" +<br /> " <zip>V6V 4U7</zip>" +<br /> " </address>";<br /> <br /> static String xmlString1 ="<?xml version=\"1.0\"?>" +<br /> " <!DOCTYPE retrCtx" +<br /> " [" +<br /> <br /> <br /> " <!ELEMENT retrCtx (id, val)>" +<br /> <br /> " <!ELEMENT id (#PCDATA)>" +<br /> " <!ELEMENT val (#PCDATA)>" +<br /> " ]>" +<br /> "" +<br /> "<retrCtx ver = '1'>" +<br /> " <item_map type='std'>" +<br /> " <item>" +<br /> " <id>rtrId</id>" +<br /> " <val>00993236327</val>" +<br /> " </item>" +<br /> " <item>" +<br /> " <id>rtrId2</id>" +<br /> " <val>009932363278</val>" +<br /> " </item>" +<br /> " </item_map> " +<br /> " <item_map type='std'>" +<br /> " <item>" +<br /> " <id>rtrId3</id>" +<br /> " <val>00993236329</val>" +<br /> " </item>" +<br /> " <item>" +<br /> " <id>rtrId4</id>" +<br /> " <val>009932363210</val>" +<br /> " </item>" +<br /> " </item_map> " +<br /> " </retrCtx>";<br />}
-
Java code to connect to unix box(putty)
i'm having a great problem regarding accessing the putty box from java code.
I need to read some log files from unix through java code.In my client program when i'm giving hostname and port=22...ssh terminal is getting detected,but i'm confused how to open that unix box by giving the username and password.and how am i goin to embed unix command in it.The entire job i've to do through java code.
please help!!..Thanks
Message was edited by:
liz310
Message was edited by:
liz310thanks a lot guys for ur time...but i tried in every way..i'm getting hell lot of errors..please help..its really urgent
/*this is my code:*/
import com.jcraft.jsch.*;
import com.jcraft.jsch.Channel;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;
import com.jcraft.jsch.UserInfo;
import java.io.*;
public class shell_test {
public static void main(String args[])
String user="user15";
String host="punlin040";
String cmd="ls -l";
JSch jsch = new JSch();
try{
Session session=jsch.getSession(user,host,22);
session.setPassword("user15");
//UserInfo usrInfo=new MyUserInfo();
//session.setUserInfo(usrInfo);
session.connect();
Channel channel=session.openChannel("exec");
((ChannelExec) channel).setCommand(cmd);
channel.setXForwarding(true);
channel.connect();
//code
channel.setInputStream(System.in);
// channel.setOutputStream(System.out);
//((ChannelExec) channel).setErrStream(System.err);
InputStream in = channel.getInputStream();
channel.connect();
byte[] tmp = new byte[1024];
while (true)
while (in.available() > 0)
int i = in.read(tmp, 0, 1024);
if (i < 0)
break;
System.out.print(new String(tmp, 0, i));
if (channel.isClosed())
in.close();
// System.out.println("JSCH: exit-status: " +
//channel.getExitStatus());
break;
try
Thread.sleep(1000);
catch (Exception ee)
channel.disconnect();
session.disconnect();
//code
//ch.setInputStream(System.in);
//ch.setOutputStream(System.out);
}catch(Exception e)
{e.printStackTrace(); }
/*public static class MyUserInfo implements UserInfo {
public String getPassword()
{ return "password"; }
public String getPassphrase()
{ return ""; }
public boolean promptPassword(String arg0)
{ return true; }
public boolean promptPassphrase(String arg0)
{ return true; }
public boolean promptYesNo(String arg0)
{ return true; }
public void showMessage(String arg0)
but i'm getting following errors:
com.jcraft.jsch.JSchException: java.lang.ClassNotFoundException: com.jcraft.jsch
.jce.Random
at com.jcraft.jsch.Session.connect(Session.java:160)
at com.jcraft.jsch.Session.connect(Session.java:145)
at shell_test.main(shell_test.java:25)
Caused by: java.lang.ClassNotFoundException: com.jcraft.jsch.jce.Random
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at com.jcraft.jsch.Session.connect(Session.java:156)
... 2 more -
I want to pass a map using Xpress to java code and it seems to be getting error. The java code is suppose to make use of the input hash map, process it, create another hash map and return it back to the calling code. I am having trouble in passing the map created using xpress to the java code (i.e. no problem if i tried to do a similar process by inputing a string and getting a string back)
Sample Xpress code:
===============
<block>
<set name='myInput'>
<map>
<s>First Key</s>
<s>Key 1 Value</s>
<s>Second Key</s>
<s>Key 2 Value</s>
</map>
</set>
<set name='return'>
<invoke name='myMethodName' class='com.Test.ClassName'>
<ref>myInput</ref>
</invoke>
</set>
<ref>return</ref> ==> should get back HashMap created using java code
</block>
Sample Java code
=============
public HashMap myMethodName(HashMap hMapInput) {
HashMap hm = new HashMap();
hm = .....do something with input hMapInput
.....create a new map
return hm;
}your code looks ok, By the way what error did you get?
Edited by: gdrien on Nov 8, 2007 4:29 PM -
Best place in VOimpl java code to call a stored proc to populate results
Hello all,
Using JDev 11g, ADF BC and Trinidad.
I am building an application that is primarily used for searching large amounts of data. We already have stored procedures on the database that perform the searches and dump the results into a holding table (together with a "search id"). I have easilly built a prototype of this application: my view object is simply "select a, b, c from results where search_id = :bv" - I have a service method in the AM that runs the stored procedure, obtains the search ID, binds it to the :bv in the VO and executes the VO's query - it's all working really nicely. Range paging is effective, the VO itself performs well, and I am able to control how long the stored proc runs via setting a timeout value.
Now, I'd like to generalize this. My thinking is this:
1). I'll add a custom property to my VO that is the SQL statement needed to call the stored procedure.
2). I'll add some bind variables to the VO to represent all the query parameters that can be passed to the stored proc. I'll also use custom properties to indicate these are "fake" bvs, and not in the SQL query itself.
3). The VO's SQL will remain simply "select a, b, c from results where search_id = :bv"
4). I will (have already tested) override bindParametersForCollection so that the "fake" bind variables aren't bound into the SQL.
Now, the question: I want to override some method in the VO's java code to call the stored procedure. The stored proc needs to be called before the actual query for the VO is run, and also before the method getQueryHitCount is called (so that the count is correct). What is the method that would be the "best" place to do this? My current thinking is that I would put the call in an over-ridden executeQueryForCollection call. As far as my analysis has gone, it seems to be always called before getQueryHitCount, but I have no way of knowing if this is completely safe.
Any thoughts from the BC experts out there?
Best regards,
JohnJohn,
from your description I understand that you essentially program the VO yourself. So I suggest that you read chapter 35.9 of the 'Fusion Developer’s Guide for Oracle Application Development Framework' (I guess you know where to find it). Since you still call the actual SQL not all of the chapter apply, but you get the idea how it works.
And yes you analyzed the behavior correct. executeQueryForCollection() is allways called bevore getQueryHitCount().
Timo -
Sample java code to obtain data from ALUI directory
Hi
I need to go to the ALUI LDAP ( directory ) services to get user profile information.
The documentation did not help me to figure out the way to obtain data from it.
so , it would be a great help if some one could share the sample java code api to obtain data from ALUI directory.i'm guessing you are asking to get the groups for a particular user. someone in the other thread posted the actual SQL, that may be easier. ( you are on 10gR3 right, because ALUI directory didn't exist before 6.5)
I dont have a sample done yet, but the internet is filled with samples of java and ldap...
http://www.coderanch.com/t/133108/Security/LDAP-sample-program -
I bought an album that also came with music videos. All the songs downloaded properly, but none of the videos. Next to them it said Stopped-Error 3150, I tried to restart the downloads and now most just say Stopped, some say Stopped-Error 8003, which means Network issues, but after checking, I found there are no issues with my network. Help?
I am having this same problem with my brand new Mac Pro. It seems to be tied to the computer awaking from sleep (no I am not leaving the iPod connected while sleep... I am referring to waking the computer from sleep and then connecting iPod as opposed to restarting the computer and then connecting the iPod). In other words, if you are getting this error message, try ejecting the iPod, restart your computer, then connect the iPod and see if the error message goes away. For me it does, but I only get one shot at it, if I eject the iPod and then reconnect it, the error message returns. This happens on both iPods I have. I have rebooted (hold menu-select) and gone to disc mode (hold select-play) and the error message remains. The only way it goes away is to reboot the computer, then I get one shot at hooking up an iPod.
I NEVER had nor get this error message when I connect to the Windows PC that I started with. Perhaps the iPod does not like moving from PC to Mac? -
XML Parser Error in bpel java exec code
hi,
When BPEL PM is loading processes from the deploy directory, the following exception is thrown. Any thoughts on why this XML error is being thrown ? Also, this problem is not consistently reproducible.
Thanks,
Ravikiran
bpel<Line 232, Column 72>: XML-24523: (Error) Invalid value 'NotifyFoo' for attribute: 'name'.
[Potential fix]: Fix the invalid XML.
at com.collaxa.cube.lang.compiler.CubeProcessor.validateServerSide(CubeProcessor.java:1156)
at com.collaxa.cube.lang.compiler.CubeProcessor.transformServerSide(CubeProcessor.java:627)
at com.collaxa.cube.lang.compiler.CubeParserHelper.compileServerSide(CubeParserHelper.java:132)
at com.collaxa.cube.engine.deployment.CubeProcessFactory.generateProcessClass(CubeProcessFactory.java:239)
39,0-1 10%One more piece of information that may be relevant. There are 4 BPEL processes that are deployed (copied into deploy directory) that all have "NotifyFoo" java exec element. Is it that somehow some parser is seeing this "name" attribute "NotifyFoo" refered to in two processes as being used twice in the same process? Perhaps this is because the element is a Java code ?
Thanks,
Ravikiran
Maybe you are looking for
-
We have multiple computers, laptops, iphones and ipad in our home. We have kept one account for iTunes in order to monitor what my family downloads for parental monitoring. How can I get approval or allow for more devices to be 'authorized' to purcha
-
Why does it take so long to dismiss reminders?
I just can't understand, for the life of me, why, when I need to dismiss reminders, they take so long to go away? Can someone please tell me why this is? It's like the app has to stop and think about each and every dismissal before it moves it to co
-
Is there a way to prevent a form user from paging up and down or scrolling through a form?
I'm using Livecycle Designer 8.0. I'm working on a registration form (it's set up like a survey). As users respond to questions, they will be sent to the appropriate next page in the form. In doing so, they will bypass certain pages. However, if
-
Hi. I have created selection screens (SE51) and custom transactions in system DEV and all is working fine. Now when i transport this to QA system The transport is showing that it is successfull(GREEN in STMS). BUT when i see the selection screen it h
-
OUTER/INNER JOINS e.g
Hi Gurus! Can anyone explain with a really simple example(using say employee- department) tables, what is OUTER join, INNER join, Left RIGHT JOINs?? Thanks, sapa