Object into OutputStreams..
Hello guyz,
I want to put an object into an Output Stream(Just raw Output Stream).
Is this possible??If so how can i do that...??
Please help me I wud be grateful
Regds,
Gokul
public void putIn (OutputStream out, Serializable object) {
new ObjectOutputStream (out).writeObject (object);
}
Similar Messages
-
Read contents of file into outputstream
Can anyone suggest that what are the best methods to read contents of a file (better cater to both conditions: big file size and small file size) into outputstream and send through socket...
Thanks.Thanks for the answer. But I would like to ask the following question:
I have a VB application which generates a file. I have a Java application which read the contents of the file.
is it possible that VB side calls the read() (file) and send() (through socket to destination) methods in Java application once the file is generated? Actually my objective is VB is responsible for generating a file for Java application to read data from and then send the data (not file) to destination....If it is impossible to achieve, any alternative to achieve this?
Thanks
Edited by: whkhoo on Jun 15, 2008 8:45 PM -
How to convert a Graphics object into a JPG image?
I have this simple question about how to make a Graphics object into a JPG file...
I just need the names of the classes or the packages ... I'll figure out the rest of the details...
Thanks...Anyway this might come in handy
JPEGUtils.java
============
* Created on Jun 22, 2005 by @author Tom Jacobs
package tjacobs.jpeg;
import java.awt.Image;
import java.awt.image.BufferedImage;
import java.awt.image.RenderedImage;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import javax.imageio.ImageIO;
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGEncodeParam;
import com.sun.image.codec.jpeg.JPEGImageDecoder;
import com.sun.image.codec.jpeg.JPEGImageEncoder;
* Utilities for saving JPEGs and GIFs
public class JPEGUtils {
private JPEGUtils() {
super();
public static void saveJPEG(BufferedImage thumbImage, File file, double compression) throws IOException {
BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(file));
saveJPEG(thumbImage, out, compression);
out.flush();
out.close();
public static void saveJPEG(BufferedImage thumbImage, OutputStream out, double compression) throws IOException {
JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
JPEGEncodeParam param = encoder.getDefaultJPEGEncodeParam(thumbImage);
compression = Math.max(0, Math.min(compression, 100));
param.setQuality((float)compression / 100.0f, false);
encoder.setJPEGEncodeParam(param);
encoder.encode(thumbImage);
public static BufferedImage getJPEG(InputStream in) throws IOException {
try {
JPEGImageDecoder decode = JPEGCodec.createJPEGDecoder(in);
BufferedImage im = decode.decodeAsBufferedImage();
return im;
} finally {
in.close();
public static BufferedImage getJPEG(File f) throws IOException {
InputStream in = new BufferedInputStream(new FileInputStream(f));
return getJPEG(in);
public static void saveGif(RenderedImage image, File f) throws IOException {
saveGif(image, new FileOutputStream(f));
public static void saveGif(RenderedImage image, OutputStream out) throws IOException {
// Last time I checked, the J2SE 1.4.2 shipped with readers for gif, jpeg and png, but writers only for jpeg and png. If you haven't downloaded the whole JAI, and you want a writer for gif (as well as readers and writers for several other formats) download:
// http://java.sun.com/products/java-media/jai/downloads/download-iio.html
ImageIO.write(image, "gif", out);
public static void main(String[] args) {
// TODO Auto-generated method stub
} -
Dear Experts,
What is the best way to write java objects into file
1. Using Object Output Stream
or
2.Using ByteArray OutputStream
with Thanks
PanneerDear Experts,
What is the best way to write java objects into file
1. Using Object Output Stream
or
2.Using ByteArray OutputStream
with Thanks
PanneerWhat do you mean or? Because I would assume the contents of the byte array stream is coming from an ObjectOutputStream.
Or do you mean to use some sort of buffering... -
How can I insert values from table object into a regular table
I have a table named "ITEM", an object "T_ITEM_OBJ", a table object "ITEM_TBL" and a stored procedure as below.
CREATE TABLE ITEM
ITEMID VARCHAR2(10) NOT NULL,
PRODUCTID VARCHAR2(10) NOT NULL,
LISTPRICE NUMBER(10,2),
UNITCOST NUMBER(10,2),
SUPPLIER INTEGER,
STATUS VARCHAR2(2),
ATTR1 VARCHAR2(80),
ATTR2 VARCHAR2(80),
ATTR3 VARCHAR2(80),
ATTR4 VARCHAR2(80),
ATTR5 VARCHAR2(80)
TYPE T_ITEM_OBJ AS OBJECT
ITEMID VARCHAR2(10),
PRODUCTID VARCHAR2(10),
LISTPRICE NUMBER(10,2),
UNITCOST NUMBER(10,2),
SUPPLIER INTEGER,
STATUS VARCHAR2(2),
ATTR1 VARCHAR2(80),
ATTR2 VARCHAR2(80),
ATTR3 VARCHAR2(80),
ATTR4 VARCHAR2(80),
ATTR5 VARCHAR2(80)
TYPE ITEM_TBL AS TABLE OF T_ITEM_OBJ;
PROCEDURE InsertItemByObj(p_item_tbl IN ITEM_TBL, p_Count OUT PLS_INTEGER);
When I pass values from my java code through JDBC to this store procedure, how can I insert values from the "p_item_tbl" table object into ITEM table?
In the stored procedure, I wrote the code as below but it doesn't work at all even I can see values if I use something like p_item_tbl(1).itemid. How can I fix the problem?
INSERT INTO ITEM
ITEMID,
PRODUCTID,
LISTPRICE,
UNITCOST,
STATUS,
SUPPLIER,
ATTR1
) SELECT ITEMID, PRODUCTID, LISTPRICE,
UNITCOST, STATUS, SUPPLIER, ATTR1
FROM TABLE( CAST(p_item_tbl AS ITEM_TBL) ) it
WHERE it.ITEMID != NULL;
COMMIT;
Also, how can I count the number of objects in the table object p_item_tbl? and how can I use whole-loop or for-loop to retrieve values from the table object?
Thanks.Sigh. I answered this in your other How can I convert table object into table record format?.
Please do not open multiple threads. It just confuses people and makes the trreads hard to follow. Also, please remember we are not Oracle employees, we are all volunteers here. We answer questions if we can, when we can. There is no SLA so please be patient.
Thank you for your future co-operation.
Cheers, APC -
Error in IB (When trying to import objects into ESR from SLD or from server
Hi Experts,
We are facing an error with the Integration builder recently. When we open Enterprise Services Repository of PI 7.1, we are able to see the GUI with objects perfectly. When we try to import an object into the repository from the server ( In ESR, choose Tools -> Import Design objects -> From Server), we are thrown with an exception...
Error when exectuting search (QUERY_ERROR)
& java.lang.NullPointerException
The server throws the above two exceptions. I have pasted the logs of the error when trying to import an object from the server and also from the sld, below.
Have any of you experieced the issue? Request you to please check this out and suggest what the problem could be. Thanks in advance.
Regards,
Basker
Log of the error received when trying to import an object from the server...
====================================================================
= Root Exception ===================================================
====================================================================
Thrown:
com.sap.aii.utilxi.swing.framework.ExecuteException: Error when executing search
at com.sap.aii.ib.gui.shelp.QueryPanel.executeQuery(QueryPanel.java:582)
at com.sap.aii.ib.gui.shelp.QueryPanel.startQuery(QueryPanel.java:595)
at com.sap.aii.ib.gui.shelp.QueryPanel$1.run(QueryPanel.java:218)
at com.sap.aii.utilxi.misc.thread.ThreadPool$ThreadPoolThread.run(ThreadPool.java:392)
Caused by: java.lang.NullPointerException: null
at com.sap.aii.utilxi.core.collections.ArrayUtil.appendArrays(ArrayUtil.java:331)
at com.sap.aii.ib.gui.xiitem.services.XiItemServiceProvider.queryXiItems(XiItemServiceProvider.java:273)
at com.sap.aii.ib.gui.xiitem.services.XiItemServiceProvider.queryXiItems(XiItemServiceProvider.java:241)
at com.sap.aii.ib.gui.shelp.StandardQueryAccessor.executeQuery(StandardQueryAccessor.java:68)
at com.sap.aii.ib.gui.shelp.QueryPanel.executeQuery(QueryPanel.java:567)
... 3 more
====================================================================
== Content from the LogHandler =====================================
====================================================================
#12 13:44:56 AWT-EventQueue-2 ERROR com.sap.aii.utilxi.swing.toolkit.ExceptionDialog: Throwable
Thrown:
com.sap.aii.utilxi.swing.framework.ExecuteException: Error when executing search
at com.sap.aii.ib.gui.shelp.QueryPanel.executeQuery(QueryPanel.java:582)
at com.sap.aii.ib.gui.shelp.QueryPanel.startQuery(QueryPanel.java:595)
at com.sap.aii.ib.gui.shelp.QueryPanel$1.run(QueryPanel.java:218)
at com.sap.aii.utilxi.misc.thread.ThreadPool$ThreadPoolThread.run(ThreadPool.java:392)
Caused by: java.lang.NullPointerException: null
at com.sap.aii.utilxi.core.collections.ArrayUtil.appendArrays(ArrayUtil.java:331)
at com.sap.aii.ib.gui.xiitem.services.XiItemServiceProvider.queryXiItems(XiItemServiceProvider.java:273)
at com.sap.aii.ib.gui.xiitem.services.XiItemServiceProvider.queryXiItems(XiItemServiceProvider.java:241)
at com.sap.aii.ib.gui.shelp.StandardQueryAccessor.executeQuery(StandardQueryAccessor.java:68)
at com.sap.aii.ib.gui.shelp.QueryPanel.executeQuery(QueryPanel.java:567)
... 3 more
#11 13:44:55 Pool-Thread-0 FINE AutoLog.created.java.lang.NullPointerException: java.lang.NullPointerException
at com.sap.aii.utilxi.core.collections.ArrayUtil.appendArrays(ArrayUtil.java:331)
at com.sap.aii.ib.gui.xiitem.services.XiItemServiceProvider.queryXiItems(XiItemServiceProvider.java:273)
at com.sap.aii.ib.gui.xiitem.services.XiItemServiceProvider.queryXiItems(XiItemServiceProvider.java:241)
at com.sap.aii.ib.gui.shelp.StandardQueryAccessor.executeQuery(StandardQueryAccessor.java:68)
at com.sap.aii.ib.gui.shelp.QueryPanel.executeQuery(QueryPanel.java:567)
at com.sap.aii.ib.gui.shelp.QueryPanel.startQuery(QueryPanel.java:595)
at com.sap.aii.ib.gui.shelp.QueryPanel$1.run(QueryPanel.java:218)
at com.sap.aii.utilxi.misc.thread.ThreadPool$ThreadPoolThread.run(ThreadPool.java:392)
#10 13:44:55 Pool-Thread-0 DEBUG AutoLog.created.java.lang.NullPointerException: null
#9 13:44:55 Pool-Thread-0 FINE AutoLog.created.com.sap.aii.utilxi.swing.framework.ExecuteException: com.sap.aii.utilxi.swing.framework.ExecuteException: Error when executing search
at com.sap.aii.ib.gui.shelp.QueryPanel.executeQuery(QueryPanel.java:582)
at com.sap.aii.ib.gui.shelp.QueryPanel.startQuery(QueryPanel.java:595)
at com.sap.aii.ib.gui.shelp.QueryPanel$1.run(QueryPanel.java:218)
at com.sap.aii.utilxi.misc.thread.ThreadPool$ThreadPoolThread.run(ThreadPool.java:392)
Caused by: java.lang.NullPointerException
at com.sap.aii.utilxi.core.collections.ArrayUtil.appendArrays(ArrayUtil.java:331)
at com.sap.aii.ib.gui.xiitem.services.XiItemServiceProvider.queryXiItems(XiItemServiceProvider.java:273)
at com.sap.aii.ib.gui.xiitem.services.XiItemServiceProvider.queryXiItems(XiItemServiceProvider.java:241)
at com.sap.aii.ib.gui.shelp.StandardQueryAccessor.executeQuery(StandardQueryAccessor.java:68)
at com.sap.aii.ib.gui.shelp.QueryPanel.executeQuery(QueryPanel.java:567)
... 3 more
#8 13:44:55 Pool-Thread-0 DEBUG AutoLog.created.com.sap.aii.utilxi.swing.framework.ExecuteException: Error when executing search
#7 13:43:52 AWT-EventQueue-2 FINE AutoLog.created.com.sap.engine.services.security.exceptions.BaseLoginException: com.sap.engine.services.security.exceptions.BaseLoginException: Authentication did not succeed.
at com.sap.engine.services.security.server.jaas.BasicPasswordLoginModule.login(BasicPasswordLoginModule.java:149)
at com.sap.engine.services.security.login.LoginModuleLoggingWrapperImpl.login(LoginModuleLoggingWrapperImpl.java:220)
at com.sap.engine.services.security.login.ModulesProcessAction.run(ModulesProcessAction.java:70)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.services.security.login.FastLoginContext.login(FastLoginContext.java:218)
at com.sap.engine.services.security.remoteimpl.login.RemoteLoginContextHelperImpl.login(RemoteLoginContextHelperImpl.java:78)
at com.sap.engine.services.security.remoteimpl.login.RemoteLoginContextHelperImplp4_Skel.dispatch(RemoteLoginContextHelperImplp4_Skel.java:64)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:351)
at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:70)
at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:62)
at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:37)
at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:872)
at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:53)
at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:58)
at com.sap.engine.core.thread.execution.Executable.run(Executable.java:108)
at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:304)
predecessor system
com.sap.engine.services.security.exceptions.BaseLoginException: Authentication did not succeed.
at com.sap.engine.services.security.server.jaas.BasicPasswordLoginModule.login(BasicPasswordLoginModule.java:149)
at com.sap.engine.services.security.login.LoginModuleLoggingWrapperImpl.login(LoginModuleLoggingWrapperImpl.java:220)
at com.sap.engine.services.security.login.ModulesProcessAction.run(ModulesProcessAction.java:70)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.services.security.login.FastLoginContext.login(FastLoginContext.java:218)
at com.sap.engine.services.security.remoteimpl.login.RemoteLoginContextHelperImpl.login(RemoteLoginContextHelperImpl.java:78)
at com.sap.engine.services.security.remoteimpl.login.RemoteLoginContextHelperImplp4_Skel.dispatch(RemoteLoginContextHelperImplp4_Skel.java:64)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:351)
at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:70)
at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:62)
at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:37)
at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:872)
at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:53)
at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:58)
at com.sap.engine.core.thread.execution.Executable.run(Executable.java:108)
at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:304)
#6 13:43:52 AWT-EventQueue-2 DEBUG AutoLog.created.com.sap.engine.services.security.exceptions.BaseLoginException: Authentication did not succeed.
#5 13:43:52 AWT-EventQueue-2 FINE AutoLog.created.com.sap.engine.services.security.exceptions.BaseLoginException: com.sap.engine.services.security.exceptions.BaseLoginException: Cannot authenticate the user.
at com.sap.engine.services.security.login.ModulesProcessAction.run(ModulesProcessAction.java:175)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.services.security.login.FastLoginContext.login(FastLoginContext.java:218)
at com.sap.engine.services.security.remoteimpl.login.RemoteLoginContextHelperImpl.login(RemoteLoginContextHelperImpl.java:78)
at com.sap.engine.services.security.remoteimpl.login.RemoteLoginContextHelperImplp4_Skel.dispatch(RemoteLoginContextHelperImplp4_Skel.java:64)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:351)
at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:70)
at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:62)
at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:37)
at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:872)
at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:53)
at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:58)
at com.sap.engine.core.thread.execution.Executable.run(Executable.java:108)
at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:304)
Caused by: com.sap.engine.services.security.exceptions.BaseLoginException: Authentication did not succeed.
at com.sap.engine.services.security.server.jaas.BasicPasswordLoginModule.login(BasicPasswordLoginModule.java:149)
at com.sap.engine.services.security.login.LoginModuleLoggingWrapperImpl.login(LoginModuleLoggingWrapperImpl.java:220)
at com.sap.engine.services.security.login.ModulesProcessAction.run(ModulesProcessAction.java:70)
... 13 more
predecessor system
com.sap.engine.services.security.exceptions.BaseLoginException: Cannot authenticate the user.
at com.sap.engine.services.security.login.ModulesProcessAction.run(ModulesProcessAction.java:175)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.services.security.login.FastLoginContext.login(FastLoginContext.java:218)
at com.sap.engine.services.security.remoteimpl.login.RemoteLoginContextHelperImpl.login(RemoteLoginContextHelperImpl.java:78)
at com.sap.engine.services.security.remoteimpl.login.RemoteLoginContextHelperImplp4_Skel.dispatch(RemoteLoginContextHelperImplp4_Skel.java:64)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:351)
at com.sap.engine.services.rmi_p4.server.ServerDispatchImpl.run(ServerDispatchImpl.java:70)
at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:62)
at com.sap.engine.services.rmi_p4.P4Message.execute(P4Message.java:37)
at com.sap.engine.services.cross.fca.FCAConnectorImpl.executeRequest(FCAConnectorImpl.java:872)
at com.sap.engine.services.rmi_p4.P4Message.process(P4Message.java:53)
at com.sap.engine.services.cross.fca.MessageReader.run(MessageReader.java:58)
at com.sap.engine.core.thread.execution.Executable.run(Executable.java:108)
at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:304)
Caused by: com.sap.engine.services.security.exceptions.BaseLoginException: Authentication did not succeed.
at com.sap.engine.services.security.server.jaas.BasicPasswordLoginModule.login(BasicPasswordLoginModule.java:149)
at com.sap.engine.services.security.login.LoginModuleLoggingWrapperImpl.login(LoginModuleLoggingWrapperImpl.java:220)
at com.sap.engine.services.security.login.ModulesProcessAction.run(ModulesProcessAction.java:70)
... 13 moreHi Rajeev,
Thanks for your inputs. I myself am a basis guy. I ve already checked all the authorizations given to the user - PISUPER, and have found it to be fine. Can't understand why this security issue crops up still. anyways, i m getting this error when trying to import an object from the server. If i try to create a new object and during the process, try to import the SCV from SLD, i m facing with an error again, of a different sort. The log says...
====================================================================
= Root Exception ===================================================
====================================================================
Thrown:
com.sap.aii.utilxi.misc.api.BaseRuntimeException: Internal error during bean lookup for bean SldAccessServiceBean
at com.sap.aii.ib.clsif.gen.BeanAccessHandler.handleRuntimeExInBusinessMethod(BeanAccessHandler.java:113)
at com.sap.aii.ib.client.sldAccess.impl.SldAccessServiceDelegate.getSwcvLinks(SldAccessServiceDelegate.java:55)
at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel.getSwcvLinksAdapter(WorkspaceCreatePanel.java:520)
at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel.access$000(WorkspaceCreatePanel.java:75)
at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel$4.getResult(WorkspaceCreatePanel.java:449)
at com.sap.aii.utilxi.swing.toolkit.InterruptableProgressDialog$1.construct(InterruptableProgressDialog.java:190)
at com.sap.aii.utilxi.swing.toolkit.SwingWorker$2.run(SwingWorker.java:126)
at java.lang.Thread.run(Unknown Source)
Caused by: com.sap.aii.utilxi.misc.api.BaseRuntimeException: Internal error during bean lookup for bean SldAccessServiceBean
at com.sap.aii.ib.clsif.login.LoginServiceImpl.getHomeInterface(LoginServiceImpl.java:460)
at com.sap.aii.ib.clsif.login.LoginServiceImpl.getBusinessInterface(LoginServiceImpl.java:425)
at com.sap.aii.ib.clsif.gen.BeanAccessHandler.getBean(BeanAccessHandler.java:60)
at com.sap.aii.ib.client.sldAccess.impl.SldAccessServiceDelegate.getBean(SldAccessServiceDelegate.java:79)
at com.sap.aii.ib.client.sldAccess.impl.SldAccessServiceDelegate.getSwcvLinks(SldAccessServiceDelegate.java:49)
... 6 more
Caused by: com.sap.aii.ib.core.ejbutil.HomeFactoryException: Exception during lookup operation of object with name sap.com/com.sap.xi.repository/SldAccessServiceBean, cannot resolve object reference.
at com.sap.aii.ib.clsif.login.EJBHomeFactory.lookUpHome(EJBHomeFactory.java:381)
at com.sap.aii.ib.clsif.login.LoginServiceImpl.getHomeInterface(LoginServiceImpl.java:456)
... 10 more
Caused by: com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception during lookup operation of object with name sap.com/com.sap.xi.repository/SldAccessServiceBean, cannot resolve object reference.
at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:528)
at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:637)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.sap.aii.ib.clsif.login.EJBHomeFactory.lookUpHome(EJBHomeFactory.java:353)
... 11 more
Caused by: javax.naming.NamingException: Error occurs while the EJB Object Factory trying to resolve JNDI reference Reference Class Name:
Type: clientAppName
Content: sap.com/com.sap.xi.repository
Type: interfaceType
Content: remote
Type: home
Content: com.sap.aii.ib.sbeans.sldAccess.SldAccessServiceHome
Type: ejb-link
Content: SldAccessServiceBean
Type: remote
Content: com.sap.aii.ib.sbeans.sldAccess.SldAccessServiceRemote
com.sap.engine.services.jndi.persistent.exceptions.NamingException: Exception while trying to get InitialContext.
at com.sap.engine.services.jndi.InitialContextFactoryImpl.getInitialContext(InitialContextFactoryImpl.java:488)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:73)
at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:58)
at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:521)
at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:637)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.sap.aii.ib.clsif.login.EJBHomeFactory.lookUpHome(EJBHomeFactory.java:353)
at com.sap.aii.ib.clsif.login.LoginServiceImpl.getHomeInterface(LoginServiceImpl.java:456)
at com.sap.aii.ib.clsif.login.LoginServiceImpl.getBusinessInterface(LoginServiceImpl.java:425)
at com.sap.aii.ib.clsif.gen.BeanAccessHandler.getBean(BeanAccessHandler.java:60)
at com.sap.aii.ib.client.sldAccess.impl.SldAccessServiceDelegate.getBean(SldAccessServiceDelegate.java:79)
at com.sap.aii.ib.client.sldAccess.impl.SldAccessServiceDelegate.getSwcvLinks(SldAccessServiceDelegate.java:49)
at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel.getSwcvLinksAdapter(WorkspaceCreatePanel.java:520)
at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel.access$000(WorkspaceCreatePanel.java:75)
at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel$4.getResult(WorkspaceCreatePanel.java:449)
at com.sap.aii.utilxi.swing.toolkit.InterruptableProgressDialog$1.construct(InterruptableProgressDialog.java:190)
at com.sap.aii.utilxi.swing.toolkit.SwingWorker$2.run(SwingWorker.java:126)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: Can't get Socket. Reason:Connection timed out: connect
at com.sap.engine.interfaces.cross.io.transport.PortManager.getRealSocket(PortManager.java:284)
at com.sap.engine.interfaces.cross.LoadBalancerImpl.getAllAccessPoints(LoadBalancerImpl.java:97)
at com.sap.engine.interfaces.cross.CrossObjectBroker.getDestination(CrossObjectBroker.java:142)
at com.sap.engine.services.jndi.InitialContextFactoryImpl.getInitialContext(InitialContextFactoryImpl.java:347)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:73)
at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:58)
at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:521)
at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:637)
at javax.naming.InitialContext.lookup(Unknown Source)
at com.sap.aii.ib.clsif.login.EJBHomeFactory.lookUpHome(EJBHomeFactory.java:353)
at com.sap.aii.ib.clsif.login.LoginServiceImpl.getHomeInterface(LoginServiceImpl.java:456)
at com.sap.aii.ib.clsif.login.LoginServiceImpl.getBusinessInterface(LoginServiceImpl.java:425)
at com.sap.aii.ib.clsif.gen.BeanAccessHandler.getBean(BeanAccessHandler.java:60)
at com.sap.aii.ib.client.sldAccess.impl.SldAccessServiceDelegate.getBean(SldAccessServiceDelegate.java:79)
at com.sap.aii.ib.client.sldAccess.impl.SldAccessServiceDelegate.getSwcvLinks(SldAccessServiceDelegate.java:49)
at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel.getSwcvLinksAdapter(WorkspaceCreatePanel.java:520)
at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel.access$000(WorkspaceCreatePanel.java:75)
at com.sap.aii.ibrep.gui.workspace.WorkspaceCreatePanel$4.getResult(WorkspaceCreatePanel.java:449)
at com.sap.aii.utilxi.swing.toolkit.InterruptableProgressDialog$1.construct(InterruptableProgressDialog.java:190)
at com.sap.aii.utilxi.swing.toolkit.SwingWorker$2.run(SwingWorker.java:126)
at java.lang.Thread.run(Unknown Source)
at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:140)
at com.sap.engine.services.ejb3.runtime.impl.EJBObjectFactory.getObjectInstance(EJBObjectFactory.java:58)
at javax.naming.spi.NamingManager.getObjectInstance(Unknown Source)
at com.sap.engine.services.jndi.implclient.ClientContext.lookup(ClientContext.java:521)
... 14 more
Any clues what might be the issue?
thanks in advance,
Regards,
Basker -
How can I convert table object into table record format?
I need to write a store procedure to convert table object into table record. The stored procedure will have a table object IN and then pass the data into another stored procedure with a table record IN. Data passed in may contain more than one record in the table object. Is there any example I can take a look? Thanks.
I'm afraid it's a bit labourious but here's an example.
I think it's a good idea to work with SQL objects rather than PL/SQL nested tables.
SQL> CREATE OR REPLACE TYPE emp_t AS OBJECT
2 (eno NUMBER(4)
3 , ename VARCHAR2(10)
4 , job VARCHAR2(9)
5 , mgr NUMBER(4)
6 , hiredate DATE
7 , sal NUMBER(7,2)
8 , comm NUMBER(7,2)
9 , deptno NUMBER(2));
10 /
Type created.
SQL> CREATE OR REPLACE TYPE staff_nt AS TABLE OF emp_t
2 /
Type created.
SQL> Now we've got some Types let's use them. I've only implemented this as one public procedure but you can see the principles in action.
SQL> CREATE OR REPLACE PACKAGE emp_utils AS
2 TYPE EmpCurTyp IS REF CURSOR RETURN emp%ROWTYPE;
3 PROCEDURE pop_emp (p_emps in staff_nt);
4 END emp_utils;
5 /
Package created.
SQL> CREATE OR REPLACE PACKAGE BODY emp_utils AS
2 FUNCTION emp_obj_to_rows (p_emps IN staff_nt) RETURN EmpCurTyp IS
3 rc EmpCurTyp;
4 BEGIN
5 OPEN rc FOR SELECT * FROM TABLE( CAST ( p_emps AS staff_nt ));
6 RETURN rc;
7 END emp_obj_to_rows;
8 PROCEDURE pop_emp (p_emps in staff_nt) is
9 e_rec emp%ROWTYPE;
10 l_emps EmpCurTyp;
11 BEGIN
12 l_emps := emp_obj_to_rows(p_emps);
13 FETCH l_emps INTO e_rec;
14 LOOP
15 EXIT WHEN l_emps%NOTFOUND;
16 INSERT INTO emp VALUES e_rec;
17 FETCH l_emps INTO e_rec;
18 END LOOP;
19 CLOSE l_emps;
20 END pop_emp;
21 END;
22 /
Package body created.
SQL>Looks good. Let's see it in action...
SQL> DECLARE
2 newbies staff_nt := staff_nt();
3 BEGIN
4 newbies.extend(2);
5 newbies(1) := emp_t(7777, 'APC', 'CODER', 7902, sysdate, 1700, null, 40);
6 newbies(2) := emp_t(7778, 'J RANDOM', 'HACKER', 7902, sysdate, 1800, null, 40);
7 emp_utils.pop_emp(newbies);
8 END;
9 /
PL/SQL procedure successfully completed.
SQL> SELECT * FROM emp WHERE deptno = 40
2 /
EMPNO ENAME JOB MGR HIREDATE SAL COMM
DEPTNO
7777 APC CODER 7902 17-NOV-05 1700
40
7778 J RANDOM HACKER 7902 17-NOV-05 1800
40
SQL> Cheers, APC -
How To Insert A object into Conext
Hi Techies,
I have 8 tables in my designer
and I have two contexts at designer level
And how to insert a object into a context that is not referencing any table.
For Example I have an object like "rownum" (Which should must be added at Universe level only not at report level). Here this object is not referencing any table and I want this to be used in a query where the remaining objects are coming from the context..
Thanks in Advance..Double-click the Objects and click the TABLES button and select the table you want to associate the object to for the context to work properly (see below).
Regards,
Ajay -
How to cast an Object into a specific type (Integer/String) at runtime
Problem:
How to cast an Object into a specific type (Integer/String) at runtime, where type is not known at compile time.
Example:
public class TestCode {
public static Object func1()
Integer i = new Integer(10); //or String str = new String("abc");
Object temp= i; //or Object temp= str;
return temp;
public static void func2(Integer param1)
//Performing some stuff
public static void main(String args[])
Object obj = func1();
//cast obj into Integer at run time
func2(Integer);
Description:
In example, func1() will be called first which will return an object. Returned object refer to an Integer object or an String object. Now at run time, I want to cast this object to the class its referring to (Integer or String).
For e.g., if returned object is referring to Integer then cast that object into Integer and call func2() by passing Integer object.GDS123 wrote:
Problem:
How to cast an Object into a specific type (Integer/String) at runtime, where type is not known at compile time.
There is only one way to have an object of an unknown type at compile time. That is to create the object's class at runtime using a classloader. Typically a URLClassloader.
Look into
Class.ForName(String) -
Error while Importing SYSTEM objects into 9.2.0.6
HI,
I got the following error while importing data into 9.2.0.6 DB .
It is related to a SYSTEM object.
. importing SYSTEM's objects into SYSTEM
IMP-00017: following statement failed with ORACLE error 2270:
"ALTER TABLE "DEF$_CALLDEST" ADD CONSTRAINT "DEF$_CALL_DESTINATION" FOREIGN "
"KEY ("DBLINK") REFERENCES "DEF$_DESTINATION" ("DBLINK") ENABLE NOVALIDATE"
IMP-00003: ORACLE error 2270 encountered
ORA-02270: no matching unique or primary key for this column-list
Constarint exists on Composite Primary Key on the parent table.
Can anybody help me out on this.
Regards,
Sumit Singh ChadhaHi,
don't mentioning why are You importing SYSTEM objects, the error that You have, just looking the message, is due to an export done without the clause CONSISTENT=Y (so all relations parent/child preserved) having the replication (the table in error is one of the replication dictionary table) active (not quisced)
Repeat the export operation using CONSISTENT=Y an stop replication activity.
Hope this helps
Max -
Error : while converting a WD ABAP object into SAP Transaction
Hi,
I am trying to converting a WD ABAP object into SAP Transaction but i am getting the following error while executing the transaction :
Network Access Message: The page cannot be displayed
Technical Information (for Support personnel)
Error Code: 502 Proxy Error. The specified Secure Sockets Layer (SSL) port is not allowed. ISA Server is not configured to allow SSL requests from this port. Most Web browsers use port 443 for SSL requests. (12204)
IP Address: 10.114.6.144
Date: 4/7/2011 10:41:
Please help.> ISA Server is not configured to allow SSL requests from this port. Most Web browsers use port 443 for SSL requests. (12204)
This seems to be your specific network configuration. It seems that your corporate network is blocking HTTPS requests which don't use port 443. Your ABAP system is configured to use a port other than 443. Either talk to your basis admins about changing your ABAP system configuration to use port 443 or talk to your network administrators to allow whichever port the ABAP system is running on. -
I need to add the values stored in the session object into the html textbox
Dear Sir,
i have been trying to create an edit employee details page
What i have done till now is as follow:
1. Got employee id from HTML page.
2. Compared it with the id stored in the database.
3. If the id is correct then pulled the record of the corresponding employee and stored it in the session object.
4. Dispatched the session values to another servlet EditEmpDetails2.java
what i need to do now
5. Now i need to set the session values in the text field of the html form
6. I also need to be able to edit those vales and store the edited values in the database.
Please help me as i have tried doing it for 1 week without any clues
i have tried to create a html page which is something like this:
<html>
<head>
<title>Edit Employee Details Page</title>
<body BGCOLOR="red" text="black">
<h1 ><font color="black">Edit Employee Details Page</font></h1>
<form action = "EditEmpDetails" method="Get">
<table width="50% align="center"
<tr><td>Employee ID: </td>
<td><INPUT TYPE="TEXT" name="employeeid"<br></td></tr>
<tr><td><center><input type="submit" value="submit"></center></td></tr>
<tr><td><center><input type="reset" value="reset" ></center></td></tr>
</table>
</form>
</body>
</html>
design of my servlet EditEmpDetails.java
public void EditEmpDetails1 extends HttpServlet
public void doGet(HttpServletRequest request, HttpServletResponse response)throws ServletException, IOException
PrintWriter out = response.getWriter();
response.setContentType("text/html");
HttpSession session = request.getSession();
String employeeid;
String X = request.getParameter("employeeid");
System.out.println("Employee iD:" + X);
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:odbc:murphy");
String query = "Select * from users where employeeid=?";
PreparedStatement stat = con.prepareStatement(query);
System.out.println(stat);
stat.setString(1,X);
ResultSet rs = stat.executeQuery();
while(rs.next())
String Z = rs.getString(password);
if(Z.equals(X))
String A = rs.getString(1);
session.setAttribute("employeeid", A);
String B = rs.getString(2);
session.setAttribute("firstname", B);
String C = rs.getString(3);
session.setAttribute("lastname", C);
String D = rs.getString(4);
session.setAttribute("gender", D);
String E = rs.getString(5);
session.setAttribute("dateofbirth", E);
String F = rs.getString(6);
session.setAttribute("address", F);
String G = rs.getString(7);
session.setAttribute("postalcode", G);
String H = rs.getString(8);
session.setAttribute("phone", H);
String I = rs.getString(9);
session.setAttribute("mobile", I);
String J = rs.getString(10);
String url = "/EditEmpDetao;s.java";
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(url)
dispatcher.forward(request,response);
catch (Exception e)
system.out.println(e)
I do not know how to put the values stored in the session object into the html text box3. If the id is correct then pulled the record of the corresponding employee and stored it in the session object.do you really need to store this in session object?
5. Now i need to set the session values in the text field of the html form which form? in a new html/jsp page? i suggest go for a JSP
In your JSP page use JSP expression tags to put the session attributes.
it's something like : <input type='text' name='employeeid' value='<%= session.getAttribute("employeeid") %>' >and you need to generateanother servlet for saving the details/modifications to the database.
I think i m clear enough.
if you need more clarifications. just try it and then post your problem.
Diablo -
Import of SAP Objects into Integration Repository in XI 3.0
Hi all,
I am not able to import SAP objects into the Integration Repository in XI 3.0. This option is under any Software Component Version. I have selected the radio button "Import of RFC and IDoc interfaces from SAP systems permitted", in the Software Component Version settings. After the connection data is specified for the SAP system nothing appears under the IDoc, Whereas the import of RFCs is successfull.
We also have another installation of SAP XI 3.0, here this option is working properly. Can anyone tell me what is the problem, is is there something else to be configured inorder to do this.
Best regards,
NorwayHi Stephan
Thank you for your answer. We have followed your instructions but did only get half a success. Here is what we have done:
1) Created "External Definitions" for all related xsd-files with the same name as the xsd-filename and in our own namespace. Our namespace is different from those specified in the xsd-files. We have not change the namespaces in the xsd-files.
2) Maintained the "source"-field with the name for the xsd-file and not the url as specified in our answer. When we used the filename only we got a value the field "name" in the "External References".
3) We made a message mapping and imported the "top-level-xsd-element" from the "External Definition". This resulted in only the top level element and nothing else. What we expected was the possibility to drill down through the complete structure.
What did we doe wrong? Perhaps I could talk you into spending 10 min. and try it your self? This url leads to a zip file with all the related xsd files: http://rep.oio.dk/ubl/xml/schemas/0p71/documentation/resources.html
Do you know if it will be possible to make references across namespaces in a later version of XI?
Regards
Christian -
How to pass a locale object into another function?
Greetings,
i like to pass a locale object into another function. These are my code below
import java.util.*;
public class Locales{
public static void main(String[] args){
Locale locale= new Locale("EN", "US");
convert(locale);
public void convert(Locale convert)
String language = convert.getDisplayLanguage();
System.out.println(language);
}I got this error:
Locales.java:6: non-static method convert(java.util.Locale) cannot be referenced from a static content
convert(locale);
^How do i correct it?
ThanksDid you bother to do a search?
Did you bother to read any of the material that the search would have linked you to?
If you had then you would be able to understand where you are going wrong and how to fix it yourself. Instead of being spoonfed by us. -
Reading Lots of Objects into Memory
I need to read thousands of fairly large objects from an object database to the point that the JMV memory runs out.
A solution is to: read, use and discard as opposed to loading all the objects into memory at once -pretty simple but I want to do it right. I have a general idea on how to implement the approach but I need your help in locating some reading materials, code snipplets and/or best practices.
Thanks!If you're using thousands of objects you might look into the Flyweight Pattern (depending on what these objects are and what state they have). You might also look into increasing the amount of memory available to the JVM via that -Xms switch.
Aside from that, if you reuse the same reference name (variable name)(s) you'll allow the Garbage Collector to recover that memory.
Good Luck
Lee
Maybe you are looking for
-
Client scope in blaze ??
Hi all, we're integrating blazeds in a portlet environment for use with vine toolkit ( vinetoolkit.org ) grid framework. We have some issues on that - especially with scoping. We know that there are request, session and application scopes. We're wond
-
Passing list of values to a function
As what type list of values multiple selections, e.g. resulting in (1,2,3), are represented in function parameters? for example i have lov that results in (1,2,3) and dataset query is select myfunction(:mylov) from dual. Variable of what type I must
-
SQL Server driver - is there anyone that works?!
Hi, I found that there are no any driver for SQL Server 2000 that simply works. Microsoft JDBC 2000: buggy, has strange memory leaks when and inexpectly can block on any sql operation when using a connection for a long time. Microsot JDBC 2005: has n
-
Adobe reader 7.0.8 not working
I am having trouble getting the Adobe reader to open pdf files on web sites. I have installed the version particular to my Mac and placed it in the applications section. I am still a neophyte when it comes to my Mac and am wondering if I have loaded
-
Hi all, Small Query: How to see TR no of SAP script? Regards Saurabh