Primary cannot be null Exception with deepMergeClone
Hi.
I get a Validator exception when trying to update an object graph with a call to uow.deepMergeClone(obj)
Scenario :
Object A get's fetched in a uow and then the transaction is closed.
Object A get's altered in the application. ( This alteration consists of removing a part of the object graph and replacing it by a new part. )
A new uow is created in which we re-read Object A to have in the cache and then we do a deepMergeClone on it.
I think that because we removed a part of the object graph and replaced it, the new objects don't have a primary key yet and toplink trys to check if he has to preform an update or insert by using the primary key but I don't have a clue how to change this behaviour.
Also please include the full exception and stack trace.
Similar Messages
-
Cannot start up except with internal disc
I've been having a few irritating problems with my start-up items - various crashes, some not opening, etc., so I went in to the library to delete the prefs. There were 2 prefs that will not delete nor move to the trash -- checking Info they say I have indeterminate permission. Disc Utility says HD is OK, but I wanted to be sure and tried using DU on the Snow Leopard Install disc. It ill not boot up. Next I tried Prosoft's Drive Genius; it won't boot either. I have tried using Command-C, Option and Syspref Start up disc; it always goes to the grey screen then hangs. Help please?
SassYou cannot move pref files straight to trash. Drag to desktop first, then you can delete.
If you can't start from the install disk, first make sure it's the correct one. If it's a disk for a system update, then find the original startup disk that came with the computer and try that one. -
Primary key is null in CMP ejbLoad()
Using WebLogic 7.0 with Oracle 9i Lite.
We're logging the values of the CMP fields in ejbLoad(). All of the
CMP values look fine, except for the primary key value; it's always
null. This means that Foo.getKey() (the CMP field that returns the
primary key value) always returns null.
Foo.getPrimaryKey() works as expected.
This appears to be causing problems with CMR fields. The Collection
we get from a "many" CMR field is populated with the correct number of
elements, but if we try to remove one of them we're getting a "primary
key cannot be null" exception from the container.
Any insights?
Richard A. Steele
PaychexHere's some more information:
We're able to successfully create entity beans; for example, we have beans OrganizationEJB
and BusinessSiteEJB. There's a one-to-many relationship from OrganizationEJB to
BusinessSiteEJB.
Because of database integrity constraints, when we create a BusinessSite, we have
to provide the Organization as a parameter to create(). This works fine--after calling
create(), I see the new BusinessSite in the database.
We can also do a findByPrimaryKey() on BusinessSite and retrieve the business site.
However, if I do a getBusinessSites() on Organization, I get back a Collection, but:
1. Sometimes it has just a single entry, even if we know there are multiple business
sites for this organization. Sometimes, it has the right number of entries, but
every one of them is identical.
2. The primary key of the entries in the Collection are all null. In other words,
if I do a getPrimaryKey() on the BusinessSite local interfaces in the collection,
I get back null.
3. If I try to delete any of the Business Sites in the collection, the container
throws an exception that the primary key can't be null.
Richard A. Steele
Paychex -
Cannot create a Platform Context object. Exception was "Value cannot be null.
Hi there.
Im trying to integrate a desktop application with Project server 2013 online
(SharePoint ) using SOAP requests.
But doesnt matter what I try, i Always get this exception "Cannot create a Platform Context object. Exception was "Value cannot be null."
Anybody has a hint ?
ThanksHi Maycon,
In my opinion, this thread is related to SharePoint 2013-Development and Programming forum. So please post thread on that forum for more effective response. Thank you for understanding. Please refer to the following link.
http://social.technet.microsoft.com/Forums/sharepoint/en-US/home?forum=sharepointdevelopment.
Regards,
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
JDBC MS Access--- cannot extract entry with null value with data type Meta
I'm trying to extract a data entry with null value by using JDBC. The database is MS Access.
The question is how to extract null entry with data type memo? The following code works when the label has data type Text, but it throws sqlException when the data type is memo.
Any advice will be appreciated! thanks!
Following are the table description and JDBC code:
test table has the following attributes:
Field name Data Type
name Text
label Memo
table contents:
name label
me null
you gates
Code:
String query = "SELECT name, label FROM test where name like 'me' ";
ResultSet rs = stmt.executeQuery(query);
while (rs.next())
String name = rs.getString("name");
rs.getString("val");
String label = rs.getString("label");
System.out.println("\t"+name+"\t"+label);
catch (SQLException ex)
System.out.println(ex.getSQLState());
System.out.println(ex.getErrorCode());
System.out.println("in sqlexception");
output:
C:\Temp\SEFormExtractor>java DBTest
yet SELECT name, label FROM test
null
0
in sqlexceptionThe question is how to extract null entry with data type memo?Okay, what you need to do is this:
if (rs.getString("val") == null)
// do something
}This way, when it's a null value, you can check it first, and then handle it how you want, rather than getting an exception. -
Difference between PRIMARY KEY and UNIQUE KEY with NOT NULL
What is the difference between PRIMARY KEY and UNIQUE KEY with NOT NULL constraint?
Message was edited by:
Nilesh HoleAnswer for the master!!!
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:8743855576462
Thanks,
Karthick -
Null pointer Exception with removeRowWithKey operation
Hii experts,,,
I am using JDevelepor 11.1.2.1.0 Version
I Am new in ADF ,
In My sample application i select row in iterator by findIterator() method
then get the specified row by getCurrentRow();
then i get the rowKey By row.getKey() method..
I put rowKey as parameter to removeRowWithKey operation
I have get null pointer Exception with removeRowWithKey operation
java.lang.NullPointerException
at oracle.jbo.server.ViewRowSetImpl.prepKeyForFind(ViewRowSetImpl.java:5352)
at oracle.jbo.server.ViewRowSetImpl.findByKey(ViewRowSetImpl.java:5394)
at oracle.jbo.server.ViewRowSetImpl.findByKey(ViewRowSetImpl.java:5296)
at oracle.jbo.server.ViewRowSetImpl.findByKey(ViewRowSetImpl.java:5290)
at oracle.jbo.server.ViewObjectImpl.findByKey(ViewObjectImpl.java:11536)
at oracle.adf.model.binding.DCIteratorBinding.removeRowWithKey(DCIteratorBinding.java:3748)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1598)
how can solve this???thanks Timo
through this URL i get possible deletion methods...
pls give more Information about the concept of removeRowWithKey, setCurrentRowWithKey, setCurrentRowWithKeyValue operation.... Just For Knowledge....
Edited by: NZL on Mar 2, 2012 9:37 AM
Edited by: NZL on Mar 2, 2012 9:42 AM -
Exception: Error decoding message (Key cannot be null)
Hi guys,
Coherence 3.3.1/389
.Net API 3.3.1.2
I've wrote small invocation task, which collects the info about cluster members, stores it to HashMap and return it as result. This is the code:
NamedCache cache = CacheFactory.getCache(sCacheName);
CacheService service = cache.getCacheService();
Cluster cluster = service.getCluster();
HashMap res = new HashMap();
Set members = cluster.getMemberSet();
Iterator iter = members.iterator();
while(iter.hasNext())
Member member = (Member)iter.next();
res.put((Object)member.getProcessName(), new Integer(member.getPort()));
As you can see if member.getProcessName() returns null, then null is placed to HashMap.
When the result was returned to the client, I've got this exception:
2007-10-04 09:55:45.849 <Error> (thread=Tangosol.Net.Messaging.Impl.ConnectionManager+ConnectionManagerDaemon): Error decoding message
System.ArgumentNullException: Key cannot be null.
Parameter name: key
at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
at System.Collections.Hashtable.set_Item(Object key, Object value)
at Tangosol.IO.Pof.PofStreamReader.ReadAsObject(Int32 typeId) in c:\dev\release.net\coherence-net-v3.3\src\Coherence\IO\Pof\PofStreamReader.cs:line 3446
at Tangosol.IO.Pof.PofStreamReader.ReadObject(Int32 index) in c:\dev\release.net\coherence-net-v3.3\src\Coherence\IO\Pof\PofStreamReader.cs:line 2284
at Tangosol.Net.Messaging.Impl.Response.ReadExternal(IPofReader reader) in c:\dev\release.net\coherence-net-v3.3\src\Coherence\Net\Messaging\Impl\Response.cs:line 117
at Tangosol.Net.Messaging.Impl.Codec.Decode(IChannel channel, DataReader reader) in c:\dev\release.net\coherence-net-v3.3\src\Coherence\Net\Messaging\Impl\Codec.cs:line 118
at Tangosol.Net.Messaging.Impl.Connection.DecodeMessage(DataReader reader) in c:\dev\release.net\coherence-net-v3.3\src\Coherence\Net\Messaging\Impl\Connection.cs:line 874
I understood why it was happened, but I did not understood why it was masked and my client application was frozen until request time accured (180s).
Why did you mask it?
Regards,
Dmitry.Hi
Thanks for answered.
I tried to import just 6 lines but the same error.
Did you know, what could be?
I am pasting the log.
TOTAL STEPS 2
1. Convert Data: completed in 1 sec.
2. Load and Process: Failed in 1 sec.
3. Import: completed in 1 sec.
[Selection]
FILE=\GrupoPit\FRATECO\DataManager\DataFiles
41010100001.csv
TRANSFORMATION=\GrupoPit\FRATECO\DataManager\TransformationFiles
Frateco.xls
CLEARDATA= Yes
RUNLOGIC= Yes
CHECKLCK= No
[Messages]
Convert Data
Success
Record Count : 6
Accept Count : 6
Reject Count : 0
Skip Count : 0
Key cannot be null.
Parameter name: key -
Hi
I have almost migrated an application from jboss to CE 7.1 sp3 maxdb 32 bit
however I am getting the following error on c:out tag of standard jslt.
Runtime error in processing of the JSP file [C:\usr\sap\CE1\J00\j2ee\cluster\apps\<....>\servlet_jsp\<application_context_name>\root\jsp\view\<jsp_name>.jsp].
Line:----
The error is: com.sap.engine.services.servlets_jsp.jspparser_api.exception.JspParseException: Cannot parse custom tag with short name [out].02004C4F4F50001F0000002D000012B000B0688132009833
Line:----
Do anybody have some idea why is it happening.
My guess would be because of jslt version mismatch. but its working fine in jboss. I am not sure what version cE 7.1 support may be 1.2. any idea how to chek the supported version in the server.
The jsp code is something like
Line:----
<code>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="c_rt" uri="http://java.sun.com/jstl/core_rt" %>
<c:url var="thumbnailStream" value="/do/<action_tag>">
<c_rt:param name="stream_id" value="<%= <variable1> %>"/>
<c:param name="stream_id_type" value="<variable2>"/>
<c:param name="content_kind" value="<variable3>"/>
</c:url>
<img border="0" src="<c:out value="$"/>">
</code>
Line:----
from the SAP help text its said that jslt is being overrided by server to use from global library rather than local webapplication library. Couls woud explain where is this global library located in the server directory.
Thx.
AshutoshHi are you able to solve this issue.I am getting similar kind of issue.
Logs for the same are ::
Caused by: com.sap.engine.services.servlets_jsp.jspparser_api.exception.JspParseException: Cannot parse custom tag with short name out.
at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.syntax.xmlsyntax.CustomJspTag.action(CustomJspTag.java:183)
at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.syntax.ElementCollection.action(ElementCollection.java:59)
at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.syntax.JspIncludeDirective.action(JspIncludeDirective.java:51)
at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.syntax.ElementCollection.action(ElementCollection.java:59)
at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.syntax.JspElement.customTagAction(JspElement.java:994)
at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.syntax.JspElement.action(JspElement.java:228)
at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.syntax.ElementCollection.action(ElementCollection.java:59)
at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.syntax.ElementCollection.action(ElementCollection.java:69)
at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.GenerateJavaFile.generateJavaFile(GenerateJavaFile.java:72)
at com.sap.engine.services.servlets_jsp.server.jsp.JSPProcessor.parse(JSPProcessor.java:270)
at com.sap.engine.services.servlets_jsp.server.jsp.JSPProcessor.generateJavaFile(JSPProcessor.java:194)
at com.sap.engine.services.servlets_jsp.server.jsp.JSPProcessor.parse(JSPProcessor.java:126)
at com.sap.engine.services.servlets_jsp.jspparser_api.JSPChecker.getClassName(JSPChecker.java:319)
at com.sap.engine.services.servlets_jsp.jspparser_api.JSPChecker.compileAndGetClassName(JSPChecker.java:248)
at com.sap.engine.services.servlets_jsp.jspparser_api.JSPChecker.getClassNameForProduction(JSPChecker.java:178)
at com.sap.engine.services.servlets_jsp.jspparser_api.JSPChecker.processJSPRequest(JSPChecker.java:109)
at com.sap.engine.services.servlets_jsp.jspparser_api.JspParser.generateJspClass(JspParser.java:154)
at com.sap.engine.services.servlets_jsp.server.servlet.JSPServlet.service(JSPServlet.java:193)
... 47 more
Caused by: com.sap.engine.services.servlets_jsp.jspparser_api.exception.JspParseException: Attribute value of <c:out> can accept only static values.
at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.taglib.TagBeginGenerator.calculateAttributeValue(TagBeginGenerator.java:476)
at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.taglib.TagBeginGenerator.generateSetters(TagBeginGenerator.java:394)
at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.taglib.TagBeginGenerator.generateServiceMethodStatements(TagBeginGenerator.java:562)
at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.taglib.TagBeginGenerator.generate(TagBeginGenerator.java:678)
at com.sap.engine.services.servlets_jsp.jspparser_api.jspparser.syntax.xmlsyntax.CustomJspTag.action(CustomJspTag.java:181)
... 64 more -
SQL Exception with the message "executeQuery, Exception = null"
Hi ,
Iam getting an SQL Exception with the message "executeQuery, Exception = null". Other thing is, the SQLException.getErrorCode gives me 0. Below is the stack trace. Could you please help me, why Iam getting this message:
com.ups.ops.dm.dao.DAOSevereDataBaseException: Return Code from Database :0
at com.ups.ops.dm.dao.DAOAction.run(Unknown Source)
at com.ups.ops.dm.dao.DAOAgent.doWork(Unknown Source)
at com.ups.ops.dm.dao.service.DAOActionServiceModule.service(Unknown Source)
at com.ups.ops.dm.command.CommandManager.doCommand(Unknown Source)
at com.ups.ops.dm.dao.DataAcessObjectManager.execute(Unknown Source)
at com.ups.ops.dm.edc.db.EDCDataAccessObjectManager.lookups(Unknown Source)
at com.ups.ops.dm.edc.business.EDCVoidBusinessLogic.checkPackageScan(Unknown Source)
at com.ups.ops.dm.edc.service.VoidShipmentServiceModule.service(Unknown Source)
at com.ups.ops.dm.command.CommandManager.doCommand(Unknown Source)
at com.ups.ops.dm.edc.service.OPLDRequestDispatcherServiceModule.dispatchCommandMessage(Unknown Source)
at com.ups.ops.dm.edc.service.OPLDRequestDispatcherServiceModule.service(Unknown Source)
at com.ups.ops.dm.command.CommandManager.doCommand(Unknown Source)
at com.ups.ops.dm.edc.control.EDCReceiver.onReceive(Unknown Source)
at com.ups.ops.dm.edc.receiver.OPLDReceiverMDB.onMessage(Unknown Source)
at sun.reflect.GeneratedMethodAccessor97.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocati
on.java:187)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:
154)
at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.ja
va:89)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:
176)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInt
erceptor.java:126)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterc
eptor.java:114)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:
176)
at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
at $Proxy67.onMessage(Unknown Source)
at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:466)
at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:371)
at weblogic.ejb.container.internal.NewJMSMessagePoller.processOneMessage(NewJMSMessagePoller.java:245)
at weblogic.ejb.container.internal.NewJMSMessagePoller.run(NewJMSMessagePoller.java:121)
at weblogic.ejb.container.internal.NewJMSMessagePoller.timerExpired(NewJMSMessagePoller.java:204)
at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
com.ups.ops.dm.dao.DAOSevereDataBaseException: Return Code from Database :0
at com.ups.ops.dm.dao.DAOAction.run(Unknown Source)
at com.ups.ops.dm.dao.DAOAgent.doWork(Unknown Source)
at com.ups.ops.dm.dao.service.DAOActionServiceModule.service(Unknown Source)
at com.ups.ops.dm.command.CommandManager.doCommand(Unknown Source)
at com.ups.ops.dm.dao.DataAcessObjectManager.execute(Unknown Source)
at com.ups.ops.dm.edc.db.EDCDataAccessObjectManager.lookups(Unknown Source)
at com.ups.ops.dm.edc.business.EDCVoidBusinessLogic.checkPackageScan(Unknown Source)
at com.ups.ops.dm.edc.service.VoidShipmentServiceModule.service(Unknown Source)
at com.ups.ops.dm.command.CommandManager.doCommand(Unknown Source)
at com.ups.ops.dm.edc.service.OPLDRequestDispatcherServiceModule.dispatchCommandMessage(Unknown Source)
at com.ups.ops.dm.edc.service.OPLDRequestDispatcherServiceModule.service(Unknown Source)
at com.ups.ops.dm.command.CommandManager.doCommand(Unknown Source)
at com.ups.ops.dm.edc.control.EDCReceiver.onReceive(Unknown Source)
at com.ups.ops.dm.edc.receiver.OPLDReceiverMDB.onMessage(Unknown Source)
at sun.reflect.GeneratedMethodAccessor97.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:281)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocati
on.java:187)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:
154)
at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.ja
va:89)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:
176)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:
176)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInt
erceptor.java:126)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterc
eptor.java:114)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:
176)
at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:210)
at $Proxy67.onMessage(Unknown Source)
at weblogic.ejb.container.internal.MDListener.execute(MDListener.java:466)
at weblogic.ejb.container.internal.MDListener.transactionalOnMessage(MDListener.java:371)
at weblogic.ejb.container.internal.NewJMSMessagePoller.processOneMessage(NewJMSMessagePoller.java:245)
at weblogic.ejb.container.internal.NewJMSMessagePoller.run(NewJMSMessagePoller.java:121)
at weblogic.ejb.container.internal.NewJMSMessagePoller.timerExpired(NewJMSMessagePoller.java:204)
at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:516)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)Could you please help me, why Iam getting this message:You have bug in your software
-
After changing LookAndFeel: Exception: Colors cannot be null
Hi All!
I've just created a frame and an internal frame. But after I close the internal frame and change the look and feel (for example from windows to windows classic) and reuse of the internal frame I've get the following exception:
Exception in thread "AWT-EventQue-0" java.lang.NullPointerException: Colors cannot be null.
Here's my codes:
package myprojects.probe_1;
import javax.swing.SwingUtilities;
public class Probe_1
private static JProbeMainFrame frmMain;
public static void main( String[] args )
javax.swing.SwingUtilities.invokeLater(
new Runnable()
public void run()
frmMain = new JProbeMainFrame();
frmMain.setVisible( true );
package myprojects.probe_1;
import java.awt.*;
import java.awt.event.*;
import javax.swing.JFrame;
import javax.swing.JMenuBar;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import javax.swing.JRadioButtonMenuItem;
import javax.swing.ButtonGroup;
import javax.swing.KeyStroke;
import javax.swing.JInternalFrame;
import javax.swing.JDesktopPane;
import javax.swing.UIManager;
import javax.swing.SwingUtilities;
public class JProbeMainFrame extends JFrame
private JDesktopPane dskDesktop;
private JCountriesEditor frmCountriesEditor;
public JProbeMainFrame()
super( "JProbeMainFrame" );
int inset = 50;
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
setBounds( inset, inset, screenSize.width - inset * 2, screenSize.height - inset * 2 );
dskDesktop = new JDesktopPane();
setContentPane( dskDesktop );
setJMenuBar( createMainMenuBar() );
this.addWindowListener(
new WindowAdapter()
public void windowClosing( WindowEvent evt )
JProbeMainFrame.this.closeWindow();
setLookAndFeelTo( UIManager.getSystemLookAndFeelClassName() );
// Main menu.
protected JMenu createFileMenu()
JMenu mnuMenu;
JMenuItem mniMenuItem;
mnuMenu = new JMenu( "File" );
mnuMenu.setMnemonic( KeyEvent.VK_F );
mnuMenu.getAccessibleContext().setAccessibleDescription( "Standard file menu." );
// Items.
mniMenuItem = new JMenuItem( "Exit", KeyEvent.VK_X );
mniMenuItem.setAccelerator(
KeyStroke.getKeyStroke( KeyEvent.VK_X, ActionEvent.ALT_MASK ) );
mniMenuItem.getAccessibleContext().setAccessibleDescription(
"Terminates the application." );
mniMenuItem.addActionListener(
new ActionListener()
public void actionPerformed( ActionEvent evt )
JProbeMainFrame.this.closeWindow();
mnuMenu.add( mniMenuItem );
return mnuMenu;
protected JMenu createSettingsMenu()
JMenu mnuMenu;
JMenu smnSubMenu;
JMenuItem mniMenuItem;
ButtonGroup rbgRadioButtonGroup;
JRadioButtonMenuItem rmiRadioMenuItem;
mnuMenu = new JMenu( "Settings" );
mnuMenu.setMnemonic( KeyEvent.VK_S );
mnuMenu.getAccessibleContext().setAccessibleDescription( "Set up how to work the application." );
// Items.
mniMenuItem = new JMenuItem( "Countries", KeyEvent.VK_C );
mniMenuItem.setAccelerator(
KeyStroke.getKeyStroke( KeyEvent.VK_C, ActionEvent.ALT_MASK ) );
mniMenuItem.getAccessibleContext().setAccessibleDescription(
"Maintenance the available countries." );
mniMenuItem.addActionListener(
new ActionListener()
public void actionPerformed( ActionEvent evt )
if ( frmCountriesEditor != null && frmCountriesEditor.isClosed() )
// Resue of the internal frame!!!
dskDesktop.add( frmCountriesEditor );
frmCountriesEditor.setVisible( true );
else if ( frmCountriesEditor == null )
frmCountriesEditor = new JCountriesEditor();
dskDesktop.add( frmCountriesEditor );
frmCountriesEditor.setVisible( true );
if ( frmCountriesEditor.isIcon() )
try
frmCountriesEditor.setIcon( false );
catch ( Exception exc ) { }
try
frmCountriesEditor.setSelected( true );
catch ( Exception exc ) { }
mnuMenu.add( mniMenuItem );
mnuMenu.addSeparator();
smnSubMenu = new JMenu( "Look and Feel" );
smnSubMenu.setMnemonic( KeyEvent.VK_S );
smnSubMenu.getAccessibleContext().setAccessibleDescription( "Set the Look and Feel to desired one." );
rbgRadioButtonGroup = new ButtonGroup();
UIManager.LookAndFeelInfo[] lafiLookAndFeelInfo = UIManager.getInstalledLookAndFeels();
String strLookAndFeelName;
ActionListener alActionListener = new alLookAndFeelActionListener();
for ( int idxIndex = 0; idxIndex < lafiLookAndFeelInfo.length; idxIndex++ )
strLookAndFeelName = lafiLookAndFeelInfo[ idxIndex ].getName();
rmiRadioMenuItem = new JRadioButtonMenuItem( strLookAndFeelName );
if (UIManager.getSystemLookAndFeelClassName() == lafiLookAndFeelInfo[ idxIndex ].getClassName() )
rmiRadioMenuItem.setSelected( true );
rmiRadioMenuItem.getAccessibleContext().setAccessibleDescription(
"Set the look and feel like " + strLookAndFeelName + "." );
rmiRadioMenuItem.setActionCommand( lafiLookAndFeelInfo[ idxIndex ].getClassName() );
rmiRadioMenuItem.addActionListener( alActionListener );
rbgRadioButtonGroup.add( rmiRadioMenuItem );
smnSubMenu.add( rmiRadioMenuItem );
mnuMenu.add( smnSubMenu );
return mnuMenu;
protected JMenuBar createMainMenuBar()
JMenuBar mbrMainMenuBar = new JMenuBar(); // Create menu bar.
mbrMainMenuBar.add( createFileMenu() );
mbrMainMenuBar.add( createSettingsMenu() );
return mbrMainMenuBar;
private class alLookAndFeelActionListener implements ActionListener
public void actionPerformed( ActionEvent evt )
setLookAndFeelTo( evt.getActionCommand() );
protected void setLookAndFeelTo( String strLookAndFeel )
try
UIManager.setLookAndFeel( strLookAndFeel );
SwingUtilities.updateComponentTreeUI( this );
catch ( Exception exc ) { }
protected void closeWindow()
System.exit( 0 );
package myprojects.probe_1;
import java.awt.event.*;
import java.awt.*;
import javax.swing.JInternalFrame;
public class JCountriesEditor extends JInternalFrame
public JCountriesEditor()
super( "JCountriesEditor", true, true, false, true );
setSize( 200, 400 );
setLocation( 100, 100 );
}What should I take to avoid the exception or this is a bug in the JSE 1.6.0-beta2-x86 library. Before I forget, running on WinXP SP2 Hun.
Thanks!
Best Regards:
GeorgeeFor a short bit of informatin: I also tried setting up the Calendar's configured Incoming E-Mail Address in AD as a contact - no difference.
-
RUNTIME EXCEPTION-Cannot cast null to boolean'.
Hi Friends,
I have the below mapping.The if condition is satisfied,even though 'then' value is going to the target field.
When i try to check the queue of the 'IF' function it is throwing error RUNTIME EXCEPTION-Cannot cast null to boolean
>splitbyvalue(eachvalue)----> then
->splitbyvalue(eachvalue)>if---->target field
->mapwithdefault->else
Please help !!!
Regards,
Suresh.Hi,
Thanks for the input!!
In the below mapping suppose both 'equals' are satisfied then constant value '123' will go to target field otherwise 'else' value will go.
constant(123)----
>concat>splitbyvalue(eachvalue)----
> then
E1K1456(source segment)-->\
equals/
>and--
---equals-\
concat>splitbyvalue(eachvalue)>if------>target field
E1K1456(source segment)----
>\
source field ->mapwithdefault->else
Regards,
Suresh. -
Impdp errors with ORA-01400: cannot insert NULL into
Hi Experts,
I have very intresting situation when I use impdp to import table back to DB.
Environment:
Database Server: 10.2.0.4 Enterprise
OS: RHEL 5.5 64-bit
We have a table and it's size is 350+ GB and so to reclaim space I want to perform expdp/impdp operation. When I following below steps:
1) expdp table
2) drop table
3) impdp full table
It works like a charm and I am able to reclaim 83% space and table size shows about 20GB.
But when I follow below method:
1) expdp table
2) truncate table (To save some time not to import indexes, stats, constraints , etc)
3) impdp table
I get following error:
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "SYS"."SYS_IMPORT_TABLE_01" successfully loaded/unloaded
Starting "SYS"."SYS_IMPORT_TABLE_01": sys/******** tables=<schema>.<table_name> directory=test_dir dumpfile=<table_name>_%u.dmp logfile=impdp_<table_name>.log parallel=16 CONTENT=DATA_ONLY
Processing object type TABLE_EXPORT/TABLE/TABLE_DATA
ORA-31693: Table data object "<schema"."table_name" failed to load/unload and is being skipped due to error:
ORA-01400: cannot insert NULL into ("schema"."table_name"."ID")
Job "SYS"."SYS_IMPORT_TABLE_01" completed with 1 error(s) at 16:12:28
Please advise how to proceed further, it seems like I am hitting some sort of Bug but metalink does not show any.
Regards,
MS
Edited by: user10651321 on Nov 9, 2012 4:38 PMexpdp and impdp operations should not be executed as SYS - try SYSTEM account instead. See first Note section here - http://docs.oracle.com/cd/B19306_01/server.102/b14215/dp_import.htm#sthref243
Pl post the complete expdp and impdp commands used, along with a description of the table for which you encounter this error.
HTH
Srini -
Trouble with CardLayout and actionPerformed; null exception thrown
Hello. I'm writing my first GUI, and I am using the CardLayout class to do so. I have two panels, and a button on each that "should" navigate to the other. However, when the button is pushed on the first card, I get this exception:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at emerensi_BMI.actionPerformed(emerensi_BMI.java:149)
There are many lines after that, but I figured I would start with the first??
Here is the code associated with that line:
public void actionPerformed(ActionEvent e){
if (e.getSource() == btnReCalculate){
((CardLayout)cardPanel.getLayout()).show(cardPanel, "one");
} else if (e.getSource() == btnCalculate){
((CardLayout)cardPanel.getLayout()).show(cardPanel, "two");The last line is the actual line referenced. I am wondering if the "two" is what is null? Here is the code that it's associated with:
String one = new String();
String two = new String();
JPanel cardPanel = new JPanel();
cardPanel.setLayout(new CardLayout());
cardPanel.add(one, Page1);
cardPanel.add(two, Page2);
contentPane.add(cardPanel, BorderLayout.CENTER);If I understand it correctly, the string in the (string, container) is supposed to reference its container, right?
I'm not sure if this will make a difference, but also when the "calculate" button is pressed, I have it so that there will be calculations done with text that is entered on the first page, and the second page will display these calculations. Here is the code for that:
} else if (e.getSource() == btnCalculate){
((CardLayout)cardPanel.getLayout()).show(cardPanel, "two");
String feet = txtFeet.getText();
String inches = txtInches.getText();
String pounds = txtPounds.getText();
float f = Float.valueOf(feet);
float i = Float.valueOf(inches);
float p = Float.valueOf(pounds);
float height = (f * 12 + i);
float math = (p * 703) / (height * height);
String BMI = String.valueOf(math);
lblBMI.setText(BMI);
if (math <= 18.5){
lblHealthEval.setText("Underweight");
} else if (math <= 24.9){
lblHealthEval.setText("Normal");
} else if (math <= 29.9){
lblHealthEval.setText("Overweight");
} else if (30 <= math){
lblHealthEval.setText("Obese");
} // end else ifI have labels defined for the second panel that should get the set strings. But since the null exception is thrown right before it regarding the card layout stuff, this probably isn't an issue (yet).
Sorry if this is verbose; just wanted to be thorough. Thanks for any and all help...Well... I took out as much code as I could. Here's my simplified program:
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
@SuppressWarnings("serial")
public class emerensi_BMI extends JFrame implements ActionListener{
JLabel lblHeading1;
JLabel lblHeading2;
JButton btnCalculate;
JButton btnReCalculate;
JPanel Page1;
JPanel Page2;
String one;
String two;
JPanel cardPanel;
public static void main(String args[]){
new emerensi_BMI();
public emerensi_BMI(){
super("Body Mass Index Calculator");
setupGUI();
registerListeners();
} // end constructor
public void setupGUI(){
Container contentPane = getContentPane();
JPanel pnlHeading1 = new JPanel();
lblHeading1 = new JLabel("Page 1");
pnlHeading1.setLayout(new FlowLayout());
pnlHeading1.add(lblHeading1);
// north panel for page1
JPanel pnlCalculate = new JPanel();
btnCalculate = new JButton("Calculate");
pnlCalculate.setLayout(new FlowLayout());
pnlCalculate.add(btnCalculate);
// south panel for page1
JPanel Page1 = new JPanel();
Page1.setLayout(new BorderLayout());
Page1.add(pnlHeading1, BorderLayout.NORTH);
Page1.add(pnlCalculate, BorderLayout.SOUTH);
// page1 panel
JPanel pnlHeading2 = new JPanel();
lblHeading2 = new JLabel("Page 2");
pnlHeading2.setLayout(new FlowLayout());
pnlHeading2.add(lblHeading2);
// north panel for page2
JPanel pnlReCalculate = new JPanel();
btnReCalculate = new JButton("<-- Recalculate with different data");
pnlReCalculate.setLayout(new FlowLayout());
pnlReCalculate.add(btnReCalculate);
// south panel for page2
JPanel Page2 = new JPanel();
Page2.setLayout(new BorderLayout());
Page2.add(pnlHeading2, BorderLayout.NORTH);
Page2.add(pnlReCalculate, BorderLayout.SOUTH);
// page2 panel
String one = new String();
String two = new String();
JPanel cardPanel = new JPanel();
cardPanel.setLayout(new CardLayout());
cardPanel.add(Page1, one);
cardPanel.add(Page2, two);
contentPane.add(cardPanel, BorderLayout.CENTER);
// card panel with page1 and page2
this.setSize(500, 350);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
public void itemStateChanged(ItemEvent evt) {
CardLayout cl = (CardLayout)(cardPanel.getLayout());
cl.show(cardPanel, (String)evt.getItem());
public void registerListeners() {
btnCalculate.addActionListener(this);
btnReCalculate.addActionListener(this);
// registered actions
public void actionPerformed(ActionEvent e){
if (e.getSource() == btnReCalculate){
((CardLayout)cardPanel.getLayout()).show(Page1, one);
} else if (e.getSource() == btnCalculate){
((CardLayout)cardPanel.getLayout()).show(Page2, two);
} // end else if else if
// handling action events
public void textValueChanged(TextEvent e) {
// TODO Auto-generated method stub
}// end main -
HT1430 cannot hear through phone except with speaker on- how do I fix this?
cannot hear through phone except with speaker on- how do I fix this? I am handling all calls now through speaker
Go to settings/general/ accessibility/incoming calls and make sure it is set to default
Maybe you are looking for
-
Standard Widget Toolkit ( output on table/Text is different from console )
First of all, i would like to apologize if the question regarding SWT isn't suppose to ask in this place. I'm building my program using eclipse, swt is chose to be my GUI. Problem : String x = "A Tray of Ice Cubes" + "\n" + "WW and an ice cube "; thi
-
Can I call an onclick function to a menu item?
I have a feedback form that I need to get launched when the "Feedback" button in the submenu is clicked. This form is launched when i use the "onclick" function on a link like this: <a href="#" onclick="FBY.showForm('2338');return false;">Feedback</a
-
Show different characters in the shell
when a program wait that the user press the enter key from the shell, because of it uses the instruction System.in.read(). I want to know if exist a manner to display different characters, like ' * ' for example in a password request, Please Help me.
-
HT2486 address book 4.1.2 is not launching with snow leopard 10.6.8
address book 4.1.2 is not launching with snow leopard 10.6.8
-
Change umask for nologin user?
Hi, this is more of a general unix question i guess, but perhaps someone can help me... i have a webserver running, and a PHP script that writes files on the disk. these files are owned by user 'www', and i've set up a new group 'webadmins' which con