Exception: java.lang.InstantiationException.....
Hi there,
I have recently been playing around with converting an application to an applet. Everything seems great at my end, I have tried ir in 'Internet Explorer 6' & 'Netscape 6.2', they both show the applet, however 'Opera 5' does not. The annoying problem is that nobody else can see the applet in thier browser's. Because I can't experience what they are seeing it is proving really dificult to troubleshoot this error. The only indication I have to the route of this problem is the message:
Exception: java.lang.InstantiationException.....
I have even remove this class file from my own P.C. just to make sure that some how I am not viewing the local class on my computer instead of what I have uploaded. It had no effect on my results as I suspected. Could it be I need to use a H.T.M.L. convertor?
I am a bit stumped. Does anyone know what trhis error message generally means.
If you want the code I can e-mail, but in the mean time if anyone is familiar with this problem, HELP!!!
the previous post pretty much explained what the Exception means exactly. To be more specific however, your compiler would not let you instantiate an interface or abstract class so either a) you are doing this incorrectly via reflection or b) there is some class conflict with client system. Is your applet enclosed in an applet tag that directs the browser to use the sun plugin? I would recomend that you have clients use the sun plugin- it will probably solve this problem (assumming it is not bad code) and you should run into less conflicts between different browser types.
Similar Messages
-
Unreported Exception java.lang.InstantiationException
Dear Friends,
I am developing javabean connectivty for inserting records to mysql database from jsp. when i try to compile java bean program. It gives an error like unreported Exception java.lang.InstantiationException: Must be caught or declared to be thrown*. This is my mode. Please anyone help to solve this error. if you find any error in my code, please suggest me. Thanks in advance.
package com.webdeveloper.servlets;
import java.sql.*;
import java.io.*;
public class InsertBean {
private String dbURL = "jdbc:mysql://localhost:3306/test";
private Connection dbCon;
private Statement st;
String dbuser = "root";
String dbpass = "admin";
String Name = null;
String Address = null;
String Zip = null;
public InsertBean() {
super();
public String getName() {
return this.Name;
public String getAddress() {
return this.Address;
public String getZip() {
return this.Zip;
public void setName(String pname) {
this.Name = pname;
public void setAddress(String paddress) {
this.Address = paddress;
public void setZip(String pzip) {
this.Zip = pzip;
public void doInsert() throws ClassNotFoundException, SQLException {
Class.forName("com.mysql.jdbc.Driver").newInstance();//it gives error in this line
dbCon = DriverManager.getConnection(dbURL,dbuser,dbpass);
Statement s = dbCon.createStatement();
String sql = "Insert into Person values ('" + this.Name;
sql = sql + "', '" + this.Address + "', " + this.Zip;
sql = sql + ")";
int insertResult = s.executeUpdate(sql);
dbCon.close();
}Dear BalusC,
Thanks for your suggestion. I used try catch block also. But it still gives same error. I have modified my following code. Is there any thing wrong in my code? Please give me your suggestion. Thankyou.
// Java Document
package com.webdeveloper.servlets;
import java.sql.*;
import java.io.*;
public class InsertBean {
private String dbURL = "jdbc:mysql://localhost:3306/test";
private Connection dbCon;
private Statement st;
String dbuser = "root";
String dbpass = "admin";
String Name = null;
String Address = null;
String Zip = null;
public InsertBean() {
super();
public String getName() {
return this.Name;
public String getAddress() {
return this.Address;
public String getZip() {
return this.Zip;
public void setName(String pname) {
this.Name = pname;
public void setAddress(String paddress) {
this.Address = paddress;
public void setZip(String pzip) {
this.Zip = pzip;
public void doInsert() throws ClassNotFoundException, SQLException {
try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
dbCon = DriverManager.getConnection(dbURL,dbuser,dbpass);
Statement s = dbCon.createStatement();
String sql = "Insert into Person values ('" + this.Name;
sql = sql + "', '" + this.Address + "', " + this.Zip;
sql = sql + ")";
int insertResult = s.executeUpdate(sql);
catch(Exception e){
System.out.println("error occured :" + e);
dbCon.close();
} -
Java.lang.InstantiationException on user defined class
Hi all,
I'm getting the following exception.
Portable(java.io.IOException): An exception occurred instantiating a PortableObject user type from a POF stream: type-id=2001, class-name=com.inmdb.CacheRowDataExtractor, exception=
java.lang.InstantiationException: com.inmdb.CacheRowDataExtractor
at com.tangosol.io.pof.PortableObjectSerializer.deserialize(PortableObjectSerializer.java:121)
at com.tangosol.io.pof.PofBufferReader.readAsObject(PofBufferReader.java:3293)
at com.tangosol.io.pof.PofBufferReader.readObject(PofBufferReader.java:2600)
at com.tangosol.util.filter.ExtractorFilter.readExternal(ExtractorFilter.java:165)
at com.tangosol.util.filter.ComparisonFilter.readExternal(ComparisonFilter.java:227)
at com.tangosol.util.filter.LikeFilter.readExternal(LikeFilter.java:367)
at com.tangosol.io.pof.PortableObjectSerializer.initialize(PortableObjectSerializer.java:153)
at com.tangosol.io.pof.PortableObjectSerializer.deserialize(PortableObjectSerializer.java:128)
at com.tangosol.io.pof.PofBufferReader.readAsObject(PofBufferReader.java:3293)
at com.tangosol.io.pof.PofBufferReader.readAsObjectArray(PofBufferReader.java:3337)
at com.tangosol.io.pof.PofBufferReader.readObjectArray(PofBufferReader.java:2169)
at com.tangosol.util.filter.ArrayFilter.readExternal(ArrayFilter.java:235)
at com.tangosol.io.pof.PortableObjectSerializer.initialize(PortableObjectSerializer.java:153)
at com.tangosol.io.pof.PortableObjectSerializer.deserialize(PortableObjectSerializer.java:128)
at com.tangosol.io.pof.PofBufferReader.readAsObject(PofBufferReader.java:3293)
at com.tangosol.io.pof.PofBufferReader.readObject(PofBufferReader.java:2600)
at com.tangosol.io.pof.ConfigurablePofContext.deserialize(ConfigurablePofContext.java:348)
at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.readObject(Service.CDB:4)
at com.tangosol.coherence.component.net.Message.readObject(Message.CDB:1)
at com.tangosol.coherence.component.net.message.requestMessage.distributedCacheRequest.partialRequest.FilterRequest.read(FilterRequest.CDB:8)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$QueryRequest.read(DistributedCache.CDB:1)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:123)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache.onNotify(DistributedCache.CDB:3)
at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
at java.lang.Thread.run(Thread.java:595)
at <process boundary>
at com.tangosol.io.pof.ThrowablePofSerializer.deserialize(ThrowablePofSerializer.java:57)
at com.tangosol.io.pof.PofBufferReader.readAsObject(PofBufferReader.java:3293)
at com.tangosol.io.pof.PofBufferReader.readObject(PofBufferReader.java:2600)
at com.tangosol.io.pof.PortableException.readExternal(PortableException.java:150)
at com.tangosol.io.pof.ThrowablePofSerializer.deserialize(ThrowablePofSerializer.java:58)
at com.tangosol.io.pof.PofBufferReader.readAsObject(PofBufferReader.java:3293)
at com.tangosol.io.pof.PofBufferReader.readObject(PofBufferReader.java:2600)
at com.tangosol.io.pof.ConfigurablePofContext.deserialize(ConfigurablePofContext.java:348)
at com.tangosol.coherence.component.util.daemon.queueProcessor.Service.readObject(Service.CDB:4)
at com.tangosol.coherence.component.net.Message.readObject(Message.CDB:1)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache$QueryResponse.read(DistributedCache.CDB:33)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.Grid.onNotify(Grid.CDB:123)
at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.DistributedCache.onNotify(DistributedCache.CDB:3)
at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:42)
at java.lang.Thread.run(Thread.java:595)
class looks like:-
public class CacheRowDataExtractor extends AbstractExtractor implements
PortableObject, Serializable {
// code
What could be the problem?
Thanks in advance,
RonyHi Rony,
Yes it is mandatory. The default POF serializer just calls newInstance() on the Class to create an instance and it has no way of knowing how to call parameterised constructors. If you must have parameterised constructors then you would need to use external serializers rather than implement PortableObject. The docs are here: http://docs.oracle.com/cd/E24290_01/coh.371/e22837/api_pof.htm#BABEJCFF
Does your Dev environment only have a single Coherence process, if so then nothing will be getting serialised so you will not see this sort of error. This is a common dev mistake and if possible you should always write Dev tests to use multiple nodes and also write unit tests to test POF serialisation.
Writing a unit test is pretty easy...
ConfigurablePofContext ctx = new ConfigurablePofContext("... name of your pof config file ...");
CacheRowDataExtractor value = new CacheRowDataExtractor......
Binary binary = ExternalizableHelper.toBinary(value, ctx);
CacheRowDataExtractor result = (CacheRowDataExtractor) ExternalizableHelper.fromBinary(binary, ctx);
... now assert result is equal to original value ...JK -
Java.lang.InstantiationException: Error communicating with server:
Hello everybody, I am an easy Helloworld application, the deploy is fine, but when I execute the client it appears the next error:
java.lang.InstantiationException: Error communicating with server: Lookup error:
java.net.ConnectException: Connection refused: connect; nested exception is:
java.net.ConnectException: Connection refused: connect; nested exception
is:
javax.naming.NamingException: Lookup error: java.net.ConnectException: C
onnection refused: connect; nested exception is:
java.net.ConnectException: Connection refused: connect
at com.evermind.server.ApplicationClientContext.createContext(Applicatio
nClientContext.java:300)
at com.evermind.server.ApplicationClientInitialContextFactory.getInitial
Context(ApplicationClientInitialContextFactory.java:190)
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 hello.HelloClient.main(HelloClient.java:33)
NamingException: Error reading application-client descriptor: Error communicatin
g with server: Lookup error: java.net.ConnectException: Connection refused: conn
ect; nested exception is:
java.net.ConnectException: Connection refused: connect; nested exception
is:
javax.naming.NamingException: Lookup error: java.net.ConnectException: C
onnection refused: connect; nested exception is:
java.net.ConnectException: Connection refused: connect
This is my application client:
// HelloClient.java
package hello;
import javax.ejb.*;
import javax.naming.*;
import javax.rmi.PortableRemoteObject;
import java.io.*;
import java.util.*;
import java.rmi.RemoteException;
* A simple client for accessing an EJB.
public class HelloClient
public static void main(String[] args)
System.out.println("client started...");
try {
// Initial context properties are set in the jndi.properties file
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.ApplicationClientInitialContextFactory");
env.put(Context.PROVIDER_URL, "ormi://ecd11107.eadscasa.casa.corp:23791/helloworld");
env.put(Context.SECURITY_PRINCIPAL, "admin");
env.put(Context.SECURITY_CREDENTIALS, "123");
Context context = new InitialContext(env);
// This for use with com.evermind.server.rmi.RMIInitialContextFactory
//Object homeObject = context.lookup("HelloBean");
// This is for use with com.evermind.server.ApplicationClientInitialContextFactory
Object homeObject = context.lookup("java:comp/env/Helloworld");
// Narrow the reference to HelloHome.
HelloHome home =
(HelloHome) PortableRemoteObject.narrow(homeObject, HelloHome.class);
System.out.println("hello home");
// Create remote object and narrow the reference to Hello.
Hello remote =
(Hello) PortableRemoteObject.narrow(home.create(), Hello.class);
System.out.println(remote.sayHello("James Earl"));
} catch(NamingException e) {
System.err.println("NamingException: " + e.getMessage());
} catch(RemoteException e) {
System.err.println("RemoteException: " + e.getMessage());
} catch(CreateException e) {
System.err.println("FinderException: " + e.getMessage());
Can somebody helps me ???Thank you, but don�t work well yet. I checked the files orion-application.xml & principals.xml in the directory C:\servOracle\oracle\j2ee\home\application-deployments\helloworld but the result is the same, when I run the client the next error appears:
NamingException: Lookup error: javax.naming.NoPermissionException: Not allowed to look up HelloBean, check the namespace-access tag setting in orion-application.xml for details; nested exception is:
javax.naming.NoPermissionException: Not allowed to look up HelloBean, check the namespace-access tag setting in orion-application.xml for details
This is my orion-application.xml
<?xml version="1.0"?>
<!DOCTYPE orion-application PUBLIC "-//ORACLE//DTD OC4J Application runtime 9.04//EN" "http://xmlns.oracle.com/ias/dtds/orion-application-9_04.dtd">
<orion-application deployment-version="9.0.4.0.0" default-data-source="jdbc/OracleDS" treat-zero-as-null="true">
<ejb-module remote="false" path="helloworld-ejb.jar" />
<web-module id="helloworld-web" path="helloworld-web.war" />
<client-module path="helloworld-client" deployment-time="fce4439997" auto-start="false" />
<persistence path="persistence" />
<principals path="principals.xml" />
<jazn provider="XML" location="jazn-data.xml" />
<log>
<file path="application.log" />
</log>
<namespace-access>
<read-access>
<namespace-resource root="">
<security-role-mapping name="<jndi-user-role>">
<group name="users" />
</security-role-mapping>
</namespace-resource>
</read-access>
<write-access>
<namespace-resource root="">
<security-role-mapping name="<jndi-user-role>">
<group name="users" />
</security-role-mapping>
</namespace-resource>
</write-access>
</namespace-access>
</orion-application>
And this is my principals.xml
<?xml version="1.0"?>
<!DOCTYPE principals PUBLIC "//ORACLE//DTD OC4J Principals 9.04//EN" "http://xmlns.oracle.com/ias/dtds/principals-9_04.dtd">
<principals>
<groups>
<group name="users">
<description>users</description>
<permission name="rmi:login" />
</group>
<group name="guests">
<description>guests</description>
</group>
<group name="administrators">
<description>administrators</description>
<permission name="administration" />
</group>
</groups>
<user username="admin" password="ADMIN">
<description>The default administrator</description>
<group-membership group="administrators" />
<group-membership group="guests" />
<group-membership group="users" />
</user>
<user username="SCOTT" password="TIGER">
<description>no description</description>
<group-membership group="users" />
<group-membership group="administrators" />
</user>
</principals>
Thanks in advance, please help me.... -
Java.lang.InstantiationException
My class throws a java.lang.InstantiationException and I can't see why. my class extends an abstract class but should not be abstract itself.
My Class_
package com.propylon.core.tests;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
* The activator class controls the plug-in life cycle
public class Activator extends Plugin {
// The plug-in ID
public static final String PLUGIN_ID = "com.propylon.core.tests";
// The shared instance
private static Activator plugin;
* The constructor
public Activator() {
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
* Returns the shared instance
* @return the shared instance
public static Activator getDefault() {
return plugin;
Console Window_
java-test:
[echo] Running com.propylon.core.tests.testcase.AllTests. Result file: C:/eclipse3.3/results/com.propylon.core.tests.testcase.AllTests.xml.
[java] org.osgi.framework.BundleException: The activator org.eclipse.core.runtime.Plugin for bundle com.propylon.core.Test is invalid
[java] at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:141)
[java] at org.eclipse.osgi.framework.internal.core.BundleContextImpl.start(BundleContextImpl.java:970)
[java] at org.eclipse.osgi.framework.internal.core.BundleHost.startWorker(BundleHost.java:346)
[java] at org.eclipse.osgi.framework.internal.core.AbstractBundle.start(AbstractBundle.java:260)
[java] at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:400)
[java] at org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:111)
[java] at org.eclipse.osgi.baseadaptor.loader.ClasspathManager.findLocalClass(ClasspathManager.java:417)
[java] at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.findLocalClass(DefaultClassLoader.java:189)
[java] at org.eclipse.osgi.framework.internal.core.BundleLoader.findLocalClass(BundleLoader.java:340)
[java] at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:408)
[java] at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:369)
[java] at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:357)
[java] at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:83)
[java] at java.lang.ClassLoader.loadClass(Unknown Source)
[java] at org.eclipse.osgi.framework.internal.core.BundleLoader.loadClass(BundleLoader.java:289)
[java] at org.eclipse.osgi.framework.internal.core.BundleHost.loadClass(BundleHost.java:227)
[java] at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadClass(AbstractBundle.java:1269)
[java] at org.eclipse.test.EclipseTestRunner.loadSuiteClass(EclipseTestRunner.java:302)
[java] at org.eclipse.test.EclipseTestRunner.getTest(EclipseTestRunner.java:233)
[java] at org.eclipse.test.EclipseTestRunner.<init>(EclipseTestRunner.java:216)
[java] at org.eclipse.test.EclipseTestRunner.run(EclipseTestRunner.java:200)
[java] at org.eclipse.test.CoreTestApplication.runTests(CoreTestApplication.java:35)
[java] at org.eclipse.test.CoreTestApplication.run(CoreTestApplication.java:31)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[java] at java.lang.reflect.Method.invoke(Unknown Source)
[java] at org.eclipse.equinox.internal.app.EclipseAppContainer.callMethod(EclipseAppContainer.java:533)
[java] at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:155)
[java] at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
[java] at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
[java] at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
[java] at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
[java] at java.lang.reflect.Method.invoke(Unknown Source)
[java] at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:504)
[java] at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
[java] at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
[java] at org.eclipse.equinox.launcher.Main.main(Main.java:1144)
[java] at org.eclipse.core.launcher.Main.main(Main.java:30)
[java] Caused by: java.lang.InstantiationException
[java] at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(Unknown Source)
[java] at java.lang.reflect.Constructor.newInstance(Unknown Source)
[java] at java.lang.Class.newInstance0(Unknown Source)
[java] at java.lang.Class.newInstance(Unknown Source)
[java] at org.eclipse.osgi.framework.internal.core.AbstractBundle.loadBundleActivator(AbstractBundle.java:136)
[java] ... 41 more
[java] Java Result: 2
Is there anything obviously flawed with this class or am I going mad.
thank you for your time
sliderI can't see anywhere in your code that tries to create an Activator object... i.e. there is nowhere that tries to use the new Activator() constructor, so I would suggest that the problem is not with your code.
This is the description of Instantiation Exception from the API:
Thrown when an application tries to create an instance of a class using the newInstance method in class Class, but the specified class object cannot be instantiated because it is an interface or is an abstract class.
So, I would imagine, somewhere the Class.newInstance() method is being invoked on Plugin (the abstract class) rather than Activator (the non-abstract one) -
Java.lang.InstantiationException / XMLEncoder error what's that?
Hello there!
After I received so much help from Joachim yesterday, I think I have to bother you again with a problem:
I wrote this application for testing purposes. This app only counts an interger up and down from 0 to 10 and displays the value in a JTextBox as Strings like int = 3 means: "three". These Strings are all in an array. Additionally, I have implemented a localisation (german and english language). I read these properties from a .properties File and change the label of the buttons and the language of the value-strings. Also I serialize my app using the Beans-persistence.
So far so good but I get an error in the following situation:
When I change the language using a JMenuBar-entry and then close the app-window (now the app status is written to a xml-file (persistence)) I get:
java.lang.InstantiationException: javax.swing.PopupFactory$HeavyWeightPopup$1
Continuing ...
java.lang.Exception: XMLEncoder: discarding statement XMLTest.addWindowListener(PopupFactory$HeavyWeightPopup$1);
Continuing ...The status is saved to the file and the reconstruction from the file works fine. But this error annoys me and I have to get rid of it. More information: when I run the app and foolin' around with the buttons BUT DON'T CHANGE the language, the error doesn't appear.
The app is working fine, but what does this error mean? I'm pretty new to Java and google doesn't help me...
Here is my code: http://pastebin.com/m6b58751c
Thanks for having a look...
Thomas
Edited by: king-al on Feb 10, 2009 11:57 AMejp wrote:
The error occurred because the XMLEncoder couldn't instantiate another XMLTest object. That would be because it didn't have a no-args constructor, which it must have to qualify as a Java Bean, which it must do to be XMLEncodable (or else have a PersistenceDelegate that can instantiate it). When you changed it to have-a JFrame instead of be-a JFrame you probably changed the constructor too.Okay BUT: I have a PersistenceDelegate because I have a args-constructor:
public class XMLTestPersistenceDelegate extends DefaultPersistenceDelegate{
@Override
protected Expression instantiate(Object oldInstance,Encoder out){ // fure den übergabewert am kontruktor
XMLTest t=(XMLTest)oldInstance;
return new Expression(oldInstance,XMLTest.class,"new",new Object[]{t.width});
@Override
protected void initialize(Class<?> type, Object oldInstance, Object newInstance, Encoder out){
super.initialize(type, oldInstance, newInstance, out);
XMLTest t=(XMLTest)oldInstance;
out.writeStatement(new Statement(
oldInstance,"endisFunction", new Object[]{}));
for(int i=0;i<t.value;i++) // so oft plusFunction aufrufen, wie value groß ist
out.writeStatement(new Statement(
oldInstance,"plusFunction",new Object[]{}));
if(!t.enabled)
out.writeStatement(new Statement(
oldInstance,"endisFunction", new Object[]{}));
}The width value is the int-value of the width of my JTextField. The Statements are for some other properties of my object.
Right now, I still don't understand why it doesn't work when my Class XMLTest ist extended from JFrame.
And when I changed it to have-a JFrame I only changed some properties in my constructor of the JFrame i.e.: this.setVisible(true) to f.setVisible(true)... but nothing more.
Edited by: king-al on Feb 11, 2009 3:44 AM -
JDeveloper 11.1.1.2
EJB dataContols
We have minor modification to the UI Shell but basically the the TabSelectionActionListener inner class, the tabSelectionListener private final attribute, and the refreshTabContent() method are still the same. Our application is working well except that we are encountering the above subject error once we launch a specific taskflow. This taskflow has two views (each views contains adf read-only tables drag and drop from an EJB DataControl) and with the following navigation rules:
currency_list ---drilldown--> conversion_rate_by_currency_list
currency_list <--back-------- conversion_rate_by_currency_list
<control-flow-rule id="__18">
<from-activity-id id="__19">currency_list</from-activity-id>
<control-flow-case id="__21">
<from-outcome id="__22">drilldown</from-outcome>
<to-activity-id id="__20">conversion_rate_by_currency_list</to-activity-id>
</control-flow-case>
</control-flow-rule>
<control-flow-rule id="__23">
<from-activity-id id="__24">conversion_rate_by_currency_list</from-activity-id>
<control-flow-case id="__26">
<from-outcome id="__27">back</from-outcome>
<to-activity-id id="__25">currency_list</to-activity-id>
</control-flow-case>
</control-flow-rule>If we will not invoke "drilldown" navigation in this taskflow, then we will not encounter the above error. We can open as many tabs and transfer from one to the other. But if we invoke "drilldown" in this task flow, we can transfer to another tab for once and after that, if we click another tab, we encounter the following error:
java.lang.InstantiationException: com.alnaghi.nis.view.dynamicShell.NISTabContext$TabSelectionActionListener
at java.lang.Class.newInstance0(Class.java:340)
at java.lang.Class.newInstance(Class.java:308)
at org.apache.myfaces.trinidad.bean.util.StateUtils$Saver.restoreState(StateUtils.java:533)
at org.apache.myfaces.trinidad.bean.util.StateUtils.restoreStateHolder(StateUtils.java:411)
at org.apache.myfaces.trinidad.bean.util.StateUtils.restoreList(StateUtils.java:466)
at org.apache.myfaces.trinidad.bean.PropertyKey.restoreValue(PropertyKey.java:246)
at org.apache.myfaces.trinidad.bean.util.StateUtils.restoreState(StateUtils.java:357)
at org.apache.myfaces.trinidad.bean.util.FlaggedPropertyMap.restoreState(FlaggedPropertyMap.java:194)
at org.apache.myfaces.trinidad.bean.FacesBeanImpl.restoreState(FacesBeanImpl.java:359)
at org.apache.myfaces.trinidad.component.UIXComponentBase.restoreState(UIXComponentBase.java:930)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:910)
at org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:96)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:904)
at org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:96)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:904)
at org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:144)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:904)
at org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:144)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:904)
at org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:144)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:904)
at org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:144)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:904)
at org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:144)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:904)
at org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:144)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:904)
at org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:144)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:904)
at org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:144)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:904)
at org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:96)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:904)
at org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:96)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:904)
at org.apache.myfaces.trinidad.component.TreeState.restoreState(TreeState.java:96)
at org.apache.myfaces.trinidad.component.UIXComponentBase.processRestoreState(UIXComponentBase.java:904)
at javax.faces.component.UIComponentBase.processRestoreState(UIComponentBase.java:1182)
at org.apache.myfaces.trinidadinternal.application.StateManagerImpl.restoreView(StateManagerImpl.java:651)
at com.sun.faces.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:316)
at javax.faces.application.ViewHandlerWrapper.restoreView(ViewHandlerWrapper.java:204)
at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.restoreView(ViewHandlerImpl.java:279)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._restoreView(LifecycleImpl.java:532)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:280)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:177)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:191)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:420)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:247)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:157)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:94)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:138)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:70)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:159)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.wls.DMSServletFilter.doFilter(DMSServletFilter.java:326)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3592)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2202)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2108)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1432)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
<StateUtils$Saver><restoreState> Can anyone give any clue?
pinoThe fix is available internally and undergoing tests. The plan now is to release via the JDev "Check for Updates" option under the Help menu. This should be more convenient with broader availability. It will also mean that it has undergone formal QA testing. This will take a bit longer but in the end, but a better quality outcome. I have also replied to Oracle UI Shell Functional Pattern.
-
I'm using a User defined function "getFGN" to call a Java Class developed in NWDS. the source in NWDS has no errors when it is build. But when i Run the code i get error below.
Buy using the Debugging facility in NWDS i can see that the problem is this code linie:
<i>SldApplicationServiceInterface srvContext = (SldApplicationServiceInterface) jndiContext.lookup(SldApplicationServiceInterface.KEY);</i>
<u><b>NWDS Log</b></u>
07:50:12 Start of test
Exception:[java.lang.NoClassDefFoundError: com/sap/sldserv/SldApplicationServiceInterface] in class com.sap.xi.tf._SAP_APPL_Invoice_to_CustomerInvoice_ method getFGN$[invoicenumber, CUSTOMER, com.sap.aii.mappingtool.tf3.rt.Context@daa46b]
com.sap.aii.utilxi.misc.api.BaseRuntimeException: Exception:[java.lang.NoClassDefFoundError: com/sap/sldserv/SldApplicationServiceInterface] in class com.sap.xi.tf._SAP_APPL_Invoice_to_CustomerInvoice_ method getFGN$[invoicenumber, CUSTOMER, com.sap.aii.mappingtool.tf3.rt.Context@daa46b]
at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.getValue(FunctionWrapper.java:56)
at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:186)
at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:204)
at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:204)
at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:204)
at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:204)
at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:204)
at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:204)
at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:298)
at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:63)
at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:77)
at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431)
at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169)
at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52)
at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:259)
at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:304)
at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:193)
at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:122)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Root Cause:
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.getValue(FunctionWrapper.java:47)
at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:186)
at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:204)
at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:204)
at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:204)
at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:204)
at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:204)
at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:204)
at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:298)
at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:63)
at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:77)
at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431)
at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169)
at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52)
at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:259)
at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:304)
at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:193)
at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:122)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: java.lang.NoClassDefFoundError: com/sap/sldserv/SldApplicationServiceInterface
at com.danfoss.xi.mapping.util.GenerateFileNumber.getFileGeneratedNumber(GenerateFileNumber.java:53)
at com.sap.xi.tf._SAP_APPL_Invoice_to_CustomerInvoice_.getFGN$(_SAP_APPL_Invoice_to_CustomerInvoice_.java:2556)
... 29 more
RuntimeException in Message-Mapping transformation: Exception:[java.lang.NoClassDefFoundError: com/sap/sldserv/SldApplicationServiceInterface] in class com.sap.xi.tf._SAP_APPL_Invoice_to_CustomerInvoice_ method getFGN$[invoicenumber, CUSTOMER, com.sap.aii.mappingtool.tf3.rt.Context@daa46b]Hi,
Looks like your CLASSPATH is not set properly...Just try to Put the Jar inside "<DOMAIN_HOME>\lib" directory...in that case u need not to alter anything in the Classpath variable...it will be appended at the end of Classpath at the run time, Using Extended Directory ClassLoader.
by default Classpath settings doesnt take effect if we specify it in the startScript of Servers but we start them using NodeManagers...So if you are using Nodemanagers to start your Servers... then you can follow the below link to set the Classpath & Memory Arguments http://weblogic-wonders.com/weblogic/2010/03/26/nodemanager-based-managedservers-setting-mem_args/
Thanks
Jay SenSharma
http://weblogic-wonders.com/weblogic (WebLogic Wonders Are Here) -
Hi All,
I am getting below exception when I am trying to establish HTTPS connection using
Exception: java.lang.ClassCastException: HTTPClient.HttpURLConnection
sometime my code works and some time it gives me this exception
below is the exception which i traced in a log file
2008/09/11 01:07:57->1_1210001776_0:1_1210001776_0URL CONNECTION CALLED https://netfundstest.com/fsu/router
2008/09/11 01:07:57->1_1210001776_0:1_1210001776_0URL CONNECTION Created HTTPClient.HttpURLConnection[https://netfundstest.com/fsu/router]
2008/09/11 01:07:57->1_1210001776_0:entered into else Block
2008/09/11 01:07:57->1_1210001776_0:1_1210001776_0Error URLC Not a instance of HTTPS Connection: HTTPClient.HttpURLConnection[https://netfundstest.com/fsu/router]
2008/09/11 01:07:57->1_1210001776_0:Exception: java.lang.ClassCastException: HTTPClient.HttpURLConnection
In the success case when my HTTPS connection gets established I am getting following in the log file.
2008/08/24 11:51:28->1_1210001776_0:1_1210001776_0URL CONNECTION CALLED https://netfunds.com/fsu/router
2008/08/24 11:51:28->1_1210001776_0:1_1210001776_0URL CONNECTION Created com.sun.net.ssl.internal.www.protocol.https.DelegateHttpsURLConnection:https://netfunds.com/fsu/router
Here is the code which I am using
I am importing following packages in my code
import java.security.*;
import java.security.cert.*;
//import javax.net.ssl.*;
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.HandshakeCompletedListener;
import javax.net.ssl.HandshakeCompletedEvent;
import javax.net.ssl.SSLSession;
import java.net.*;
import java.util.*;
import java.io.*;
//import javax.security.cert.*;
import com.sun.net.ssl.*;
//import org.apache.xalan.*;
//import org.apache.xerces.*;
import org.apache.xerces.dom.*;
import org.apache.xml.serialize.*;
import javax.xml.parsers.*;
import org.w3c.dom.*;
import oracle.xml.classgen.*;
try
System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.internal.www.protocol");
System.setProperty("https.proxyHost",geProxy);
System.setProperty("https.proxyPort",geProxyPort);
Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
int n=0;
while(n<3)
debugMsg(instCount+"URL CONNECTION CALLED " + fsuFrontEndURL);
url = new URL(fsuFrontEndURL);
/* Changed to include Tunnel code */
urlc = url.openConnection();
debugMsg(instCount+"URL CONNECTION Created " + urlc);
if (urlc instanceof com.sun.net.ssl.HttpsURLConnection)
debugMsg("entered into If Block");
debugMsg("Value of n:" + n);
((com.sun.net.ssl.HttpsURLConnection) urlc).setSSLSocketFactory(new SSLTunnelSocketFactory(geProxy, geProxyPort));
((com.sun.net.ssl.HttpsURLConnection) urlc).setRequestMethod("POST");
debugMsg("after If Block");
break;
else {
try{
debugMsg("entered into else Block");
((javax.net.ssl.HttpsURLConnection) urlc).setSSLSocketFactory(new SSLTunnelSocketFactory(geProxy, geProxyPort));
((javax.net.ssl.HttpsURLConnection) urlc).setRequestMethod("POST");
debugMsg("after else Block");
break;
catch(Exception e) {
debugMsg(instCount+"Error URLC Not a instance of HTTPS Connection: " + urlc);
debugMsg("Exception: " + e);
I am using JDK 1.5 and Apache/1.3.19
Can anyone help me out ....?for URL'S Starting with HTTPS only.....Sometimes it works and sometimes it gives me the classcast exception
As soon as I bounces my Apache application server...then it starts working...I dont know why its happening like that..
Is there any issue with the Ports I am trying to connect or some Apache configuration files settings are getting changed ? -
Uncaught exception java.lang.ArrayIndexOutOfBoundsException in J2ME
hi all,
i found a strange error (uncaught exception java.lang.ArrayIndexOutOfBoundsException) every time when i tried to developed a MIDlet and servlet to retrieve data from database. can anyone tell me why this error occur? this is example of MIDlet code:
public void checkResult() {
HttpConnection conn = null;
InputStream is = null;
OutputStream os = null;
byte[] receivedData = null;
String userid = "123";
try {
String url = getAppProperty("Result.URL");
conn = (HttpConnection)Connector.open(url);
byte postData [] = ("userid=" + userid).getBytes();
conn.setRequestMethod(HttpConnection.POST);
conn.setRequestProperty("User-Agent", "Profile/MIDP-1.0 Configuration/CLDC-1.0");
conn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
conn.setRequestProperty ( "Content-Length", Integer.toString (postData.length));
conn.setRequestProperty("Connection", "close" );
conn.setRequestProperty("Content-length",Integer.toString(postData.length));
os = conn.openOutputStream();
os.write(postData);
os.close();
is = conn.openInputStream();
String contentType = conn.getType();
int len = (int)conn.getLength();
if (len > 0)
receivedData = new byte[len];
int nb = is.read(receivedData);
else
receivedData = new byte[1024];
int ch;
len = 0;
while ((ch = is.read()) != -1)
receivedData[len++] = (byte)ch;
response.setText(new String(receivedData,0,len));
display.setCurrent(outputForm);
catch (IOException e) {
System.out.println(e.getMessage());
e.printStackTrace();
finally {
try {
if (is != null) {
is.close();
if (os != null) {
os.close();
if (conn != null) {
conn.close();
catch (IOException e) {
from aliceThat would be a point where I miss bounds checking on your part:
receivedData = new byte[1024];
int ch;
len = 0;
while ((ch = is.read()) != -1)
receivedData[len++] = (byte)ch; // what happens if more than 1024 characters come along??
}Otherwise the exact line of error, the stack trace or some context would be helpful. -
Hi All,
I am using dynamic configuration to put a string to the message header. i have created a tilde delimited string with the length more than 200(length=928). During mapping i am using dynamic configuration to put this in SOAP header. But everytime i execute scenario i get an error:
"com.sap.aii.mappingtool.tf7.MessageMappingException: Runtime exception when processing target-field mapping; root message: Exception:[java.lang.IllegalArgumentException: Value is too long (928/200): "
Is there a limit to the length of the string that can be placed in the dynamic configuration ?
Please help.
Regards,
Meenakshi Pradhanmeenakshipradhan wrote:>
> "com.sap.aii.mappingtool.tf7.MessageMappingException: Runtime exception when processing target-field mapping; root message: Exception:[java.lang.IllegalArgumentException: Value is too long (928/200): "
>
I think the above error does say about that..!! Try putting data like 201 chars and the 200 chars, then see what happens.
VJ -
Hi Friends,
I am facing a issue in mapping. My scenario is IDOC to JDBC.
I have done mapping in the give below way.
If segment1 and segment2 both exists and attyp(field of segment1) is equal to '00' or '01' then segment1 replicate into table.
I am facing a error while testing the mapping is:
RuntimeException in Message-Mapping transformation: Exception:[java.lang.IllegalArgumentException: Cannot cast 02 to boolean] in class com.sap.aii.mappingtool.flib3.Bool method or[02, 01, com.sap.aii.mappingtool.tf3.rt.Context@459926e5]
Kindly suggest me on this.
Regards,
Narendra GoyalMy Mapping in such a way:
01 attyp
\ \ segment1
or - equals \
/ \ then
02 and - if -> Table
segment1 - exists \ / else
and /
segmen2 - exists / some more condition -
Java.lang.InstantiationException when using Action class with constructor
Hi everyone,
I'm using the insertNewNode() method from this class in another action class, which works fine. But when this action itself is called, I get an infinite java.lang.InstantiationException (until the stack is overflowed). I'm initiating the fields required in every method in a constructor. If there is no constructor, this action works fine again. What's wrong?
public class GliederungNewAction implements Action {
private final String DEFAULT_DESCRIPTION = "Neuer Punkt";
private OracleConnection connection;
private String username;
private String catalogue;
private String attribute;
private String parent_attr;
private int parent_sequenceNr;
private int requiredSequenceNumber;
public GliederungNewAction(OracleConnection connection, String username, String catalogue) {
this.connection = connection;
this.username = username;
this.catalogue = catalogue;
public String perform(ActionMapping mapping, HttpServletRequest request,
HttpServletResponse response) {
HttpSession session = request.getSession();
// fetch the necessary parameters from the JSP site
// the parent attribute is the selected attribute!
parent_attr = request.getParameter("attr");
catalogue = request.getParameter("catalogue");
parent_sequenceNr = Integer.parseInt(request.getParameter("sort_sequence"));
username = session.getAttribute("username").toString().toUpperCase();
// connect to database
db.SessionConnection sessConn = (db.SessionConnection) session.getAttribute("connection");
if (sessConn != null) {
try {
sessConn.setAutoCommit(false);
connection = (OracleConnection)sessConn.getConnection();
// insert the new node into DB
insertNewNode(DEFAULT_DESCRIPTION, parent_attr, parent_sequenceNr);
connection.commit();
// set attributes for JSP post-action operations
request.setAttribute("attr", attribute);
request.setAttribute("parent_attr", parent_attr);
} catch(SQLException ex) {
if ( ex.getErrorCode() == 20001 ) {
return "error_edit.do";
} else { // for all other error codes, rollback and return general error page
try {
connection.rollback();
ex.printStackTrace();
return "error_general.do";
} catch (SQLException e) {
System.err.println("Rollback failed!");
e.printStackTrace();
return "error_general.do";
} // end of catch
} // end of else
} // end of catch
return mapping.getForward();
// sample method
* Creates, fills and executes a prepared statement to insert a new entry into the specified table, representing
* a new node in the catalogue.
* @param parent_attr TODO
* @param parent_sequenceNr TODO
* @throws SQLException
public void insertNewNode(String description, String parent_attr, int parent_sequenceNr) throws SQLException {
requiredSequenceNumber = getRequiredSequenceNumber(parent_attr, parent_sequenceNr);
int freeSequenceNumber = getFreeSequenceNumber(requiredSequenceNumber);
int lastPosition = getLastNodePosition( getLastChildAttribute(parent_attr) );
attribute = createNewNodeAttribute(parent_attr, lastPosition);
String callAddNode = "{ call package.addNode(:1, :2, :3, :4, :5, :6, :7) }";
CallableStatement cst;
cst = connection.prepareCall(callAddNode);
cst.setString(1, username );
cst.setString(2, catalogue);
cst.setString(3, attribute);
cst.setString(4, parent_attr);
cst.setString(5, description);
cst.setInt(6, requiredSequenceNumber);
cst.setInt(7, freeSequenceNumber);
cst.execute();
cst.close();
java.lang.InstantiationException: action.GliederungNewAction
at java.lang.Class.newInstance0(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at action.ActionMapping.perform(ActionMapping.java:54)
at ControllerServlet.doResponse(ControllerServlet.java:92)
at ControllerServlet.doPost(ControllerServlet.java:50)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:679)
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:431)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:355)
at ControllerServlet.doResponse(ControllerServlet.java:103)
at ControllerServlet.doPost(ControllerServlet.java:50)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
.......You're welcome.
Still, I would report this as a bug at the Struts mailinglist/issuetracker. This silly behaviour shouldn't happen. Once an InstantiationException, okay, but in an infinite loop?!? That's definately a bug. Also the detail message may be more informative, e.g. "No default constructor found" or so. -
8350i uncaught exception java.lang.NullPointerException after hard reset
basic info:
8350i
v4.6.1.204 (Platform 3.0.0.73)
Desktop Manager 4.7
everything is good except that i've been using two batteries, one in the phone and one in a charger. when the phone's battery is almost drained i swap it with the charged one which of course causes a hard reset.
this procedure was working well for at least a week or two until last month when i swapped batteries - after the hard reset i got
uncaught exception: java.lang.NullPointerException
i could make calls but all other software seemed corrupted... virtually nothing else worked... icons missing etc.
tried all sorts of solutions but the only thing that fixed it was a full on device software erase/reload, then a data restore from previous backup. at the time i figured it was just a random thing and was glad to learn how to do a complete software reload.
then yesterday it happened again (again, immediately at the end of the security check after hard reset). now i'm afraid to swap batteries because it would appear that every time i hard reset there is a 10% (my guess) chance of software corruption and a complete reload takes a significant amount of time.
has anybody else noticed this? does anybody have a solution?
can i swap batteries without a hard reset; i.e. swap while plugged into power? i haven't tried this yet for fear of causing my BB harm.
any help is appreciated,
john d.
Solved!
Go to Solution.Hello, John.
Make selective backup as it is described here:
http://supportforums.blackberry.com/rim/board/message?board.id=8100&view=by_date_ascending&message.i...
Backup only information that you need.
There is described the purpose of every database you can observe when you're doing the selective backup:
http://www.blackberry.com/btsc/KB03974
When you have done selective backup do the following.
On your device go to: Options - Security Options - General Settings
Open menu and select "Wipe handheld" -
Hi, I have several times tried to install ABAP Trial, but failed.
So I need your help.
As soon as I set up XP, I download and install the newest Java, then started installation of ABAP Trial.
But at the end I just get an error message as belows.
I hope you will guide me correct direction.
Thanks for reading & Have a good day!
(Jul 11, 2008 7:38:06 AM), Install, com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles, err, An error occurred and product installation failed. Look at the log file C:\SAP\NSP\log.txt for details.
(Jul 11, 2008 7:38:06 AM), Install, com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles, err, ProductException: (error code = 200; message="Java error"; exception = [java.lang.Exception])
STACK_TRACE: 15
ProductException: (error code = 200; message="Java error"; exception = [java.lang.Exception])
at com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles.execute(StepWrapperInstallFiles.java:254)
at com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles.executeAllSteps(StepWrapperInstallFiles.java:224)
at com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles.executeAllInstallationSteps(StepWrapperInstallFiles.java:177)
at com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles.install(StepWrapperInstallFiles.java:268)
at com.installshield.product.service.product.PureJavaProductServiceImpl.installProductAction(Unknown Source)
at com.installshield.product.service.product.PureJavaProductServiceImpl$InstallProduct.getResultForProductAction(Unknown Source)
at com.installshield.product.service.product.InstallableObjectVisitor.visitComponent(Unknown Source)
at com.installshield.product.service.product.InstallableObjectVisitor.visitInstallableComponents(Unknown Source)
at com.installshield.product.service.product.InstallableObjectVisitor.visitProductBeans(Unknown Source)
at com.installshield.product.service.product.PureJavaProductServiceImpl$InstallProduct.install(Unknown Source)
at com.installshield.product.service.product.PureJavaProductServiceImpl$Installer.execute(Unknown Source)
at com.installshield.wizard.service.AsynchronousOperation.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
(Jul 11, 2008 7:43:08 AM), Install, com.installshield.product.service.product.PureJavaProductServiceImpl$InstallProduct, err, An error occurred and product uninstallation failed. Look at the log file C:\SAP\NSP\log.txt for details.
(Jul 11, 2008 7:43:08 AM), Install, com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles, err, ProductException: (error code = 200; message="Java error"; exception = [java.lang.Exception])
STACK_TRACE: 15
ProductException: (error code = 200; message="Java error"; exception = [java.lang.Exception])
at com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles.execute(StepWrapperInstallFiles.java:254)
at com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles.executeAllSteps(StepWrapperInstallFiles.java:224)
at com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles.executeAllUninstallationSteps(StepWrapperInstallFiles.java:192)
at com.sap.installshield.sdcstepswrapper.StepWrapperInstallFiles.uninstall(StepWrapperInstallFiles.java:313)
at com.installshield.product.service.product.PureJavaProductServiceImpl.uninstallProductAction(Unknown Source)
at com.installshield.product.service.product.PureJavaProductServiceImpl$InstallProduct.processActionsFailed(Unknown Source)
at com.installshield.product.service.product.InstallableObjectVisitor.visitComponent(Unknown Source)
at com.installshield.product.service.product.InstallableObjectVisitor.visitInstallableComponents(Unknown Source)
at com.installshield.product.service.product.InstallableObjectVisitor.visitProductBeans(Unknown Source)
at com.installshield.product.service.product.PureJavaProductServiceImpl$InstallProduct.install(Unknown Source)
at com.installshield.product.service.product.PureJavaProductServiceImpl$Installer.execute(Unknown Source)
at com.installshield.wizard.service.AsynchronousOperation.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)Hi YUN SEOK,
I got the same error than you when I tried to install SAP NetWeaver ABAP Trial Version.
Could you help me in giving exactly the link you wrote.
https://www.sdn.sap.com/irj
Where is located exactly the answer ?
I looked at this link but I did not find the answer.
So could you give me exactly the location in this link ?
Thanks in advance.
STD,
Maybe you are looking for
-
ITunes 8.1.1 Creating a Song in MP3
Hello, I recalled that in versions before 8.1, that I would be able to right-click on a song in iTunes and click "Create MP3 Version". In this version, it only shows "Create AAC version". The songs I download in AAC anyway, so I don't want to create
-
How do i make a new file created appear in the Application Navigator?
I am doing an extension to JDeveloper..How do i make the new file that the user has created to appear in the Application Navigator? What methods can i use? These are my codes...but it does not work still... File file = new File(dir ,fileName); file.c
-
WHEN I AM DOING INVOICE. I AM GETTING ERROR THAT NO ACCOUTING DOCUMENT GENARATED. PLEASE SOLVE THIS PROBLEM.
-
Sharing information between Hyperion Business Rules
I am trying to share information between two Hyperion Business rules in EAS console. Suppose for example , I calculated a value and stored in local variable in one Business Rule. I would like to have this information in another business rule. Any ide
-
I've lost my sounds on iPad for a week What's wrong?
NO Sound at all on iPad for over a week now. I am so frustrated I have no idea what to do? PLease Help me???