Which exception is thrown in overidding method
Hi ,
I have a doubt in doubt in overriding method. What type of exception is thrown in overidding method.
Hi all,
I have a doubt.. I read some where that an overriding
method can throw a different exception from the
orignal one. Does that exception has a restriction
that ..it shouldn't be more Generic than that of the
original?
Yes, this is what the jls in section 8.4.4 has to say about throws and overriding
A method that overrides or hides another method (�8.4.6), including methods that implement abstract methods defined in interfaces,
may not be declared to throw more checked exceptions than the overridden or hidden method.
More precisely, suppose that B is a class or interface, and A is a superclass or
superinterface of B, and a method declaration n in B overrides or hides a
method declaration m in A. If n has a throws clause that mentions any checked
exception types, then m must have a throws clause, and for every checked
exception type listed in the throws clause of n, that same exception class or one
of its superclasses must occur in the throws clause of m; otherwise, a compile-time error occursLets take an example
public class A
public void meth() throws IOException
//some code that throws IOException
class B extends A
//this is ok bcos FNFException inherits from IOException
public void meth() throws FileNotFoundException
//code that throws FNFException
/* THIS WILL FAIL TO COMPILE
public void meth() throws Exception
//code that throws FNFException
I think the access modifier in the over riden method
can't be more restrictive than the original one.. For
example..The overriden method can change the access
modifier from default to protected..But not vice
versa..correct.
Cheers,
ram.
Similar Messages
-
Which exception is thrown?
Which exception is thrown when a native method breaks?
For example: when a native method cannot access some device.
Is it RunTimeException, or just plain Exception, or perhaps something else?
Thanks.The native - C - code is yours. If it encounters an
error, it is up to you to decide how to deal with it.No. Im using someone elses native methods.
Chances are, if you are trying to write a wrapper
around someone elses code...Exactly! :)
... you will find the code
throws C++ exceptions. You have to catch them and
deal with them.I know that. That is why I posted a question here. Question is: What is that exception?
One likely way to "deal with them" is to define for
yourself the exceptions you would like to see in
java, and have the native methods construct and throw
those java exceptions. The JNI interface includes
ways of throwing exceptions while in native code.I don't know that. If you could provide some example it would be most appreciated.
Thanks. -
Hi,
In JDI is there a way to get the list of exceptions that can be thrown by a method? I want to find out when a method exits but MethodExitEvent is not generated when a method quits by throwing an exception, so in addition to MethodExitRequest I am also inserting breakpoints in exceptions that can be thrown by the method. But while there is a java.lang.reflect.Method.getExceptionTypes(), I wasn't able to find a corresponding call in com.sun.jdi.Method. Is there some way of achieving the same thing?
Thanks, AlvinHi,
In JDI is there a way to get the list of exceptions that can be thrown by a method? I want to find out when a method exits but MethodExitEvent is not generated when a method quits by throwing an exception, so in addition to MethodExitRequest I am also inserting breakpoints in exceptions that can be thrown by the method. But while there is a java.lang.reflect.Method.getExceptionTypes(), I wasn't able to find a corresponding call in com.sun.jdi.Method. Is there some way of achieving the same thing?
Thanks, Alvin -
Which exception to be thrown when integrity check fails
hey guys just a scenario for ya.
During the developmen of an API for Global Platform,if an integrity check failure occurs reading a value should an exception be thrown, if not then wat procedure should be followed.
put some light on thisdude,the scenario is as mentioned...
an applet calls an api which inturn returns a value.This value is a critical value of th card.So in the memory this value will be stored along with its compliment.
In the api,first of all it has to be checked whether the value and it compliment when 'AND ed' gives zero,this is to ensure that memory is corrupted.So if this check fails in the API what shoukd be done.
Should and exception be thrown or an error status word be return to the terminl -
Hi All,
I have created a custom web part in VS 2008 for Share point server 2010 with DevExpress v12.2.17, and deployed as Sandboxed solution. when i add that web parts in web part zone i am getting the error as "Web Part Error:
Unhandled exception was thrown by the sandboxed code wrapper's Execute method in the partial trust app domain: An unexpected error has occurred. ".
If there is any way to get detailed error either log file or event viewer.
Kindly advice to find the cause of the problem.
Thanks,
Selvakumar.SHello,
Are you impersonating your code? Have you tried to debug your code by attaching SPUCHostService.exe? if not please do so.
You also need to check ULS log for more information about this error. Here is one ref link if this could help
http://sohilmakwana.wordpress.com/2013/11/29/sandbox-error-unhandled-exception-was-thrown-by-the-sandboxed-code-wrappers-execute-method-in-the-partial-trust-app-domain/
Hemendra:Yesterday is just a memory,Tomorrow we may never see
Please remember to mark the replies as answers if they help and unmark them if they provide no help -
Detecting when exception was thrown using custom class loader
Hello all,
I would like to implement the solution described here - http://stackoverflow.com/questions/75218/how-can-i-detect-when-an-exceptions-been-thrown-globally-in-java - that uses custom class loader in order to detect when an Exeption thrown somewhere in the JVM hosting my app, please note that exceptions might be thrown from 3rd party jars the app is using. So, thanks to help I got from another post, I've managed to code the custom class loader. My question is how can the class loader wrap the original exception, as the methods in ClassLoader deals with classes, not instances. So where should I set the original exception?
Thanks!
Edited by: user9355666 on Sep 28, 2010 10:48 PMuser9355666 wrote:
I think I'm missing something fundumental, forgive me for being slow...
This is what I did so far. For the exception wrapper I made a simple class extens Exception that recieve Exception in its ctor and store it. I also subclassed ClassLoader and override its loadClass(). I've registered it as the system classloader. My thinking was to check in that point that if the requested class is instance of Exception and if yes, returning my wrapper class wrapping this exception. But, since loadClass() return class, how can I set in the wrapper the original exception?
In addition, let's say 2 different places in the code throws NPE, to my understanding the classloader will load NPE only once, so how throwing the NPE in the second time can be detected?you are missing a key point. you should creating a custom implementation of the NPE class which hooks into your detection code in its constructor. from that point forward, anytime any NPE (which is your custom class) is constructed, you can detect it. -
Exception from OIM 11g login method
Hello All,
I installed OIM 11g on RHEL5 on WebLogic 10.3.3. I have written a sample client application which connects to OIM server to evaluate its various functionality.
<snippet>
System.setProperty("java.security.auth.login.config", "ABSOLUTE_PATH/authwl.conf");
System.setProperty("OIM.AppServerType","weblogic");
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL, "t3://HOST_NAME:7001");
OIMClient oimClient = new OIMClient(env);
try {
oimClient.login("xelsysadm", PASSWORD.toCharArray());
System.out.println("Got OIM Connection");
} catch (LoginException e) {
System.out.println("Got OIM Connection:"+e.getMessage());
</snippet>
In the above code snipped, the following exception is thrown by "oimClient.login("xelsysadm", PASSWORD.toCharArray());" line:
<EXCEPTION>
oracle.iam.platform.utils.NoSuchServiceException: java.lang.reflect.InvocationTargetException
at oracle.iam.platform.OIMClient.getServiceDelegate(OIMClient.java:197)
at oracle.iam.platform.OIMClient.getService(OIMClient.java:174)
at oracle.iam.platform.OIMClient.loginSessionCreated(OIMClient.java:209)
at oracle.iam.platform.OIMClient.login(OIMClient.java:136)
at oracle.iam.platform.OIMClient.login(OIMClient.java:129)
at GetOIMServerConnection.main(GetOIMServerConnection.java:24)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at oracle.iam.platform.OIMClient.getServiceDelegate(OIMClient.java:193)
... 5 more
Caused by: oracle.iam.platform.utils.NoSuchServiceException: javax.naming.NameNotFoundException: While trying to lookup 'ejb.stateless.ClientLoginSessionService#oracle.iam.platformservice.api.ClientLoginSessionServiceRemote' didn't find subcontext 'stateless'. Resolved 'ejb' [Root exception is javax.naming.NameNotFoundException: While trying to lookup 'ejb.stateless.ClientLoginSessionService#oracle.iam.platformservice.api.ClientLoginSessionServiceRemote' didn't find subcontext 'stateless'. Resolved 'ejb']; remaining name 'stateless/ClientLoginSessionService#oracle/iam/platformservice/api/ClientLoginSessionServiceRemote'
at oracle.iam.platformservice.api.ClientLoginSessionServiceDelegate.<init>(Unknown Source)
... 10 more
Caused by: javax.naming.NameNotFoundException: While trying to lookup 'ejb.stateless.ClientLoginSessionService#oracle.iam.platformservice.api.ClientLoginSessionServiceRemote' didn't find subcontext 'stateless'. Resolved 'ejb' [Root exception is javax.naming.NameNotFoundException: While trying to lookup 'ejb.stateless.ClientLoginSessionService#oracle.iam.platformservice.api.ClientLoginSessionServiceRemote' didn't find subcontext 'stateless'. Resolved 'ejb']; remaining name 'stateless/ClientLoginSessionService#oracle/iam/platformservice/api/ClientLoginSessionServiceRemote'
at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:234)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:348)
at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:259)
at weblogic.jndi.internal.ServerNamingNode_1033_WLStub.lookup(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:405)
at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:393)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.springframework.jndi.JndiTemplate$1.doInContext(JndiTemplate.java:132)
at org.springframework.jndi.JndiTemplate.execute(JndiTemplate.java:88)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:130)
at org.springframework.jndi.JndiTemplate.lookup(JndiTemplate.java:155)
... 11 more
Caused by: javax.naming.NameNotFoundException: While trying to lookup 'ejb.stateless.ClientLoginSessionService#oracle.iam.platformservice.api.ClientLoginSessionServiceRemote' didn't find subcontext 'stateless'. Resolved 'ejb'
at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.java:247)
at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.java:182)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:206)
at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:214)
at weblogic.jndi.internal.RootNamingNode_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
</EXCEPTION>
Any idea what's going wrong here?
Thanks in Advance,
ShyamThis issue is resolved by making following change in the client code:
replace
env.put(Context.PROVIDER_URL, "t3://HOST_NAME:7001");
by
env.put(Context.PROVIDER_URL, "t3://HOST_NAME:OIMServer_BOOTSTRAP_PORT/oim"); -
EJB5018: An exception was thrown during an ejb invocation on [ResultFacade]
I have a problem to access from application client to methods of session beans
the problem haw to call this method "getcodesresultcampbean("ARTV")"
EJB5018: An exception was thrown during an ejb invocation on [ResultFacade]
javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean: java.lang.NoClassDefFoundError: org/postgresql/jdbc3/Jdbc3PreparedStatement
at com.sun.ejb.containers.BaseContainer.checkExceptionClientTx(BaseContainer.java:3591)
at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3436)
at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:192)
at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:71)
at $Proxy306.findByRefCampagne(Unknown Source)
at com.bellconsulting.praxys.stats.service.StatCampagneBean.getcodesresultcampbean(StatCampagneBean.java:77)
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:589)
at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1050)
at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:165)
at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2766)
at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3847)
at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:190)
at com.sun.ejb.containers.EJBObjectInvocationHandlerDelegate.invoke(EJBObjectInvocationHandlerDelegate.java:67)
at $Proxy305.getcodesresultcampbean(Unknown Source)
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:589)
at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:121)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:650)
at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:193)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1705)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1565)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:947)
at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:178)
at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:717)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:473)
at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1270)
at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:479)
Caused by: java.lang.NoClassDefFoundError: org/postgresql/jdbc3/Jdbc3PreparedStatement
at org.postgresql.jdbc3.Jdbc3Connection.prepareStatement(Jdbc3Connection.java:37)
at org.postgresql.jdbc3.AbstractJdbc3Connection.prepareStatement(AbstractJdbc3Connection.java:266)
at org.postgresql.jdbc2.AbstractJdbc2Connection.prepareStatement(AbstractJdbc2Connection.java:151)
at com.sun.gjc.spi.ConnectionHolder.prepareStatement(ConnectionHolder.java:413)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:497)
at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:415)
at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:139)
at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1538)
at org.hibernate.loader.Loader.doQuery(Loader.java:661)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2211)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095)
at org.hibernate.loader.Loader.list(Loader.java:2090)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:388)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:64)
at com.bellconsulting.praxys.stats.facades.ResultFacade.findByRefCampagne(ResultFacade.java:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
**************************code source************** ResultFacade******
package com.bellconsulting.praxys.stats.facades;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import com.bellconsulting.praxys.stats.entities.Result;
* @author idriss
@Stateless
public class ResultFacade implements ResultFacadeLocal {
@PersistenceContext
private EntityManager em;
/** Creates a new instance of ResultFacade */
public ResultFacade() {
public void create(Result result) {
em.persist(result);
public void edit(Result result) {
em.merge(result);
public void destroy(Result result) {
em.merge(result);
em.remove(result);
public Result find(Object pk) {
return (Result) em.find(Result.class, pk);
public List findAll() {
return em.createQuery("select object(o) from Result as o").getResultList();
public List findByRefCampagne (String campaignCode) {
return em.createNamedQuery("Result.findByRefcampagne").setParameter("refcampagne", campaignCode).getResultList();
*****************StatCampagneBean********
package com.bellconsulting.praxys.stats.service;
import com.bellconsulting.praxys.stats.facades.ResultFacadeLocal;
import java.sql.Date;
import javax.ejb.EJB;
import javax.ejb.Stateful;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import com.bellconsulting.praxys.stats.entities.Campaign;
import com.bellconsulting.praxys.stats.entities.Result;
import com.bellconsulting.praxys.stats.facades.CampaignFacadeLocal;
import java.util.Iterator;
import java.util.List;
* @author idriss
@Stateful
public class StatCampagneBean implements StatCampagneRemote {
@EJB
private CampaignFacadeLocal campaignFacade;
private @EJB ResultFacadeLocal resultFacade;
private String _campagnecode;
/** Creates a new instance of StatCampagneBean */
public StatCampagneBean() {
public StatCampagneBean(String campagnecode)
this._campagnecode= campagnecode;
@PersistenceContext
private EntityManager _manager;
public int getnbreOKbean(String codecampagne) {
//TODO implement getnbreOK
Campaign camp= _manager.find(Campaign.class,codecampagne);
return camp.getNbRepPositive();
public void statCodesResultats(String nomcamp, String codecamp, Date datedebut, Date datefin) {
//TODO implement statCodesResultats
public String[ ] getcodesresultcampbean(String codecamp) {
//TODO implement getcodesresultcampbean
// _manager.getTransaction().begin();
/* EntityManagerFactory emf = Persistence.createEntityManagerFactory("Result");
EntityManager em = emf.createEntityManager();
String querystring = "select object(r) from Result r"+" where r.refcampagne = ?1";
Query query =em.createQuery(querystring).setParameter(1,codecamp);
*for (Result r : coderesultList)
coderesult[j++]= r.getResultPK().getCode().toString();
// List<Result> coderesultList = query.getResultList();
List<Result> coderesultList = resultFacade.findByRefCampagne(codecamp);
Iterator<Result> itr = coderesultList.iterator();
String[]codesresult =null;
int j= 0;
while (itr.hasNext()){
codesresult[j++] =itr.next().getResultPK().getCode().toString();
// _manager.getTransaction().commit();
return codesresult;
*********************Application client *************
package application.praxys;
import com.bellconsulting.praxys.stats.service.StatCampagneRemote;
import javax.swing.JOptionPane;
import stats.praxys.*;
* @author idriss
public class Main {
/** Creates a new instance of Main */
public Main() {
* @param args the command line arguments
public static void main(String[] args) {
// TODO code application logic here
// InitialContext ctx;
String[] nbreok =null ;
int c =0;
/* try {
ctx = new InitialContext();
StatCampagneRemote simpleSession = (StatCampagneRemote) ctx.lookup(StatCampagneRemote.class.getName());
nbreok = simpleSession.getnbreOK("ARTV");
System.out.println("voici un resultaaaaaaaaaaaaaaaaaaaaa"+" "+nbreok);
} catch (NamingException ex)
TeleVenteServiceLocator tvLocator = new TeleVenteServiceLocator();
StatCampagneRemote statCampagneBean = (StatCampagneRemote)tvLocator.getCampaignService();
JOptionPane.showMessageDialog(null, "dfsdfsdfsfsq");
nbreok=statCampagneBean.getcodesresultcampbean("ARTV");
//nbreok =statCampagneBean.getnbreOKbean("ARTV");
System.out.println("voici un resultaaaaaaaaaaaaaaaaaaaaa "+ nbreok[1]);
JOptionPane.showMessageDialog(null, "dfsdfsdfsfsq"+nbreok[2]);
***************Result entity bean*********
package com.bellconsulting.praxys.stats.entities;
import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
* Entity class Result
* @author idriss
@Entity
@Table(name = "result")
@NamedQueries( {
@NamedQuery(name = "Result.findByCode", query = "SELECT r FROM Result r WHERE r.resultPK.code = :code"),
@NamedQuery(name = "Result.findByLibelle", query = "SELECT r FROM Result r WHERE r.libelle = :libelle"),
@NamedQuery(name = "Result.findByPriorite", query = "SELECT r FROM Result r WHERE r.priorite = :priorite"),
@NamedQuery(name = "Result.findByPrix", query = "SELECT r FROM Result r WHERE r.prix = :prix"),
@NamedQuery(name = "Result.findByResType", query = "SELECT r FROM Result r WHERE r.resType = :resType"),
@NamedQuery(name = "Result.findByRefcampagne", query = "SELECT r FROM Result r WHERE r.resultPK.refcampagne = :refcampagne"),
@NamedQuery(name = "Result.findByRetValue", query = "SELECT r FROM Result r WHERE r.retValue = :retValue"),
@NamedQuery(name = "Result.findByRetUnit", query = "SELECT r FROM Result r WHERE r.retUnit = :retUnit")
public class Result implements Serializable {
* EmbeddedId primary key field
@EmbeddedId
protected ResultPK resultPK;
@Column(name = "libelle")
private String libelle;
@Column(name = "priorite", nullable = false)
private int priorite;
@Column(name = "prix", nullable = false)
private float prix;
@Column(name = "resType")
private Integer resType;
@Column(name = "retValue")
private Integer retValue;
@Column(name = "retUnit")
private String retUnit;
@JoinColumn(name = "refcampagne", referencedColumnName = "code", insertable = false, updatable = false)
@ManyToOne
private Campaign campaign;
/** Creates a new instance of Result */
public Result() {
* Creates a new instance of Result with the specified values.
* @param resultPK the resultPK of the Result
public Result(ResultPK resultPK) {
this.resultPK = resultPK;
* Creates a new instance of Result with the specified values.
* @param resultPK the resultPK of the Result
* @param priorite the priorite of the Result
* @param prix the prix of the Result
public Result(ResultPK resultPK, int priorite, float prix) {
this.resultPK = resultPK;
this.priorite = priorite;
this.prix = prix;
* Creates a new instance of ResultPK with the specified values.
* @param refcampagne the refcampagne of the ResultPK
* @param code the code of the ResultPK
public Result(String refcampagne, String code) {
this.resultPK = new ResultPK(refcampagne, code);
* Gets the resultPK of this Result.
* @return the resultPK
public ResultPK getResultPK() {
return this.resultPK;
* Sets the resultPK of this Result to the specified value.
* @param resultPK the new resultPK
public void setResultPK(ResultPK resultPK) {
this.resultPK = resultPK;
* Gets the libelle of this Result.
* @return the libelle
public String getLibelle() {
return this.libelle;
* Sets the libelle of this Result to the specified value.
* @param libelle the new libelle
public void setLibelle(String libelle) {
this.libelle = libelle;
* Gets the priorite of this Result.
* @return the priorite
public int getPriorite() {
return this.priorite;
* Sets the priorite of this Result to the specified value.
* @param priorite the new priorite
public void setPriorite(int priorite) {
this.priorite = priorite;
* Gets the prix of this Result.
* @return the prix
public float getPrix() {
return this.prix;
* Sets the prix of this Result to the specified value.
* @param prix the new prix
public void setPrix(float prix) {
this.prix = prix;
* Gets the resType of this Result.
* @return the resType
public Integer getResType() {
return this.resType;
* Sets the resType of this Result to the specified value.
* @param resType the new resType
public void setResType(Integer resType) {
this.resType = resType;
* Gets the retValue of this Result.
* @return the retValue
public Integer getRetValue() {
return this.retValue;
* Sets the retValue of this Result to the specified value.
* @param retValue the new retValue
public void setRetValue(Integer retValue) {
this.retValue = retValue;
* Gets the retUnit of this Result.
* @return the retUnit
public String getRetUnit() {
return this.retUnit;
* Sets the retUnit of this Result to the specified value.
* @param retUnit the new retUnit
public void setRetUnit(String retUnit) {
this.retUnit = retUnit;
* Gets the campaign of this Result.
* @return the campaign
public Campaign getCampaign() {
return this.campaign;
* Sets the campaign of this Result to the specified value.
* @param campaign the new campaign
public void setCampaign(Campaign campaign) {
this.campaign = campaign;
* Returns a hash code value for the object. This implementation computes
* a hash code value based on the id fields in this object.
* @return a hash code value for this object.
@Override
public int hashCode() {
int hash = 0;
hash += (this.resultPK != null ? this.resultPK.hashCode() : 0);
return hash;
* Determines whether another object is equal to this Result. The result is
* <code>true</code> if and only if the argument is not null and is a Result object that
* has the same id field values as this object.
* @param object the reference object with which to compare
* @return <code>true</code> if this object is the same as the argument;
* <code>false</code> otherwise.
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Result)) {
return false;
Result other = (Result)object;
if (this.resultPK != other.resultPK && (this.resultPK == null || !this.resultPK.equals(other.resultPK))) return false;
return true;
* Returns a string representation of the object. This implementation constructs
* that representation based on the id fields.
* @return a string representation of the object.
@Override
public String toString() {
return "com.bellconsulting.praxys.stats.entities.Result[resultPK=" + resultPK + "]";
Message was edited by:
081283Try posting this on the EJB forum:
http://forum.java.sun.com/forum.jspa?forumID=13 -
Question of the day: In which Thread context does the main method run ?
let's say, you create a JFrame in the main method:
public static void main(String[] args)
new MyJFrame();
let's suppose, you construct the whole JFrame
inside the constructor, which contains a lot
of other Swing components, like JTree's and more.
AND the JFrame calls setVisible(true) in its
constructor.
-> According to my knowledge, this won't work
properly - it will function, BUT you will get one
or two quite big exceptions (which usually start
with a nullpointer exception, produced by the
PLAF, but the whole stacktrace shows, that the
the exception was thrown AND catched inside
the Swing objects.
Reason for this would be, that all operations
after the "setVisible(true)" statement must be
carried out in the eventdispatch thread, according
to Swing rules.
Now, as you can see by running the source below,
the main() method always is processed in special thread,
NOT the event dispatch thread - which produces the above behaviour.
My Question:
Wouldn't it have been easier to let the JVM
process the main() methods right in the
event dispatch thread ?
Or:
Why is the JVM designed to process the
main() method in a special thread and not
the Swing event dispatch thread ?
opinions?
Regards
JPlaz / SnowRaver
package Test1;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Frame1 extends JFrame
public Frame1( final String title, int position )
this.setSize(400,300);
this.setLocation(position,position);
this.setVisible(true);
if( SwingUtilities.isEventDispatchThread() )
System.out.println("Constructor of "+title+" is processed IN the event dispatch thread.");
else
System.out.println("Constructor of "+title+" is processed in ANOTHER than the event dispatch thread.");
public static void main(String[] args)
// First creation just from the startup thread context :
new Frame1("first Frame", 60);
// Now we let the second creation be done in the
// eventdispatch thread context for sure :
SwingUtilities.invokeLater( new Runnable()
public void run()
new Frame1("second Frame",120);Matt,
it's been so long, I don't have the full answer in my head.
This page on Adobe.com has an example that shows Flash 4
mouse stuff (I'm Mr
Vague today) when you scroll down. Your timelinme reference
will be
something like
TellTarget(_Root, gotoAndPlay(50))
Hopefully from that vagueness you can locate the right
answer.
Steve
Adobe Community Expert: Authorware, Flash Mobile and Devices
My blog -
http://stevehoward.blogspot.com/
Authorware tips -
http://www.tomorrows-key.com -
Why is exception not thrown in AseCommand when "Truncation error occurred"?
In the below SQL, data is written to SOURCE and from there to TARGET.
The DECIMAL columns in TARGET are deliberately smaller than those in SOURCE (eg a DECIMAL (12, 2) column populated from a DECIMAL (19,11) source).
When I run this in an Query tool (eg, SqlDbx) I get the messages:
"Truncation error occurred
Command has been aborted"
But when I run this using the .net Client (supplied with the Developer Edition of ASE 16.0) no exception is thrown (the INSERT fails though). The method is AseCommand.ExecuteNonQuery().
Is this deliberate?
Is this believed to be correct?
How can I tell that a truncation error has been raised?
Thanks
IF OBJECT_ID ('dbo.TARGET') IS NOT NULL
DROP TABLE dbo.TARGET
GO
CREATE TABLE dbo.TARGET
S_Name_NVARCHAR NVARCHAR (50) null,
S_RedComponent_DEC_15_6 decimal(15, 6) NULL,
S_BlueComponent_DEC_12_2 decimal(12, 2) NULL,
S_GreenComponent_DEC_18_10 decimal(18, 10) NULL
GO
IF OBJECT_ID ('dbo.SOURCE') IS NOT NULL
DROP TABLE dbo.SOURCE
GO
CREATE TABLE dbo.SOURCE
Name_NVARCHAR NVARCHAR (2000) NULL,
RedComponent_DEC DECIMAL (19,11) NULL,
GreenComponent_DEC DECIMAL (19,11) NULL,
BlueComponent_DEC DECIMAL (19,11) NULL
GO
INSERT INTO dbo.SOURCE (Name_NVARCHAR, RedComponent_DEC, GreenComponent_DEC, BlueComponent_DEC)
VALUES ('Beige', 272.195, 272.195, 244.42)
GO
INSERT INTO dbo.SOURCE (Name_NVARCHAR, RedComponent_DEC, GreenComponent_DEC, BlueComponent_DEC)
VALUES ('Bisque', 283.305, 253.308, 217.756)
GO
INSERT INTO dbo.SOURCE (Name_NVARCHAR, RedComponent_DEC, GreenComponent_DEC, BlueComponent_DEC)
VALUES ('Black', 0, 0, 0)
GO
INSERT INTO dbo.SOURCE (Name_NVARCHAR, RedComponent_DEC, GreenComponent_DEC, BlueComponent_DEC)
VALUES ('BlanchedAlmond', 283.305, 261.085, 227.755)
GO
--Is there data to migrate?
SELECT LEFT( S.Name_NVARCHAR,8000),S.GreenComponent_DEC,S.GreenComponent_DEC,S.GreenComponent_DEC
FROM (
SELECT * FROM SOURCE
) S
--Yes.migrate away!
--Next line gives a truncation error occurred in Sybase (gives a truncation error occurred in a query tool
--but fails silently in AseCommand.ExecuteNonQuery).
INSERT dbo.TARGET (S_Name_NVARCHAR,S_RedComponent_DEC_15_6,S_BlueComponent_DEC_12_2,S_GreenComponent_DEC_18_10)
SELECT LEFT( S.Name_NVARCHAR,8000),S.GreenComponent_DEC,S.GreenComponent_DEC,S.GreenComponent_DEC
FROM (
SELECT * FROM SOURCE
) S
select * from dbo.TARGETHi Dave,
I am consulting internally on this. To my understanding, this behavior is based on the ASE severity level, as returned in the TDS_EED token. AseExceptions are thrown when severity level is 11 or higher.
Our docs are not explanatory in this regard. Once I get clarification we will provide something in the form of wiki or KBA or doc bug to further explain the detail. Apologize for the delay and problems this caused. I guess since the command is aborted by ASE, therefore no insertion occurs, even though ASE indicates truncation occurs prior - makes this confusing.
The message severity, etc is controlled by ASE and the client is just following suit according to the TDS spec. Its just lacking in the client docs. This can be remedied.
ASE does provide the option to allow truncation and not abort. It's a set command:
Enter a query:
1 > set arithabort numeric_truncation off
Enter a query:
1 > INSERT dbo.TARGET (S_Name_NVARCHAR,S_RedComponent_DEC_15_6,S_BlueComponent_DEC_12_2,S_GreenComponent_DEC_18_10) SELECT LEFT( S.Name_NVARCHAR,8000),S.GreenComponent_DEC,S.GreenComponent_DEC,S.GreenComponent_DEC FROM (SELECT * FROM SOURCE
) S
4 rows Affected.
Notice though ASE does NOT send truncation message. This is when it is well known and accepted to insert and truncate the numeric data.
Cheers,
-Paul -
Exception not thrown on Key Exists
using c# api:
I have a Btree DB configured with two secondary DB's and a custom comparer, I have initialized the DB with 'DuplicatesPolicy.NONE'. To my understanding this should cause an exception to be raised if I try to enter a duplicate. On Put(), I get no such exception.
Why? Am I supposed to throw this from comparer? (Actually tried this but it looks like it leaves cursor in undefined state). How Do I get the KeyExists Exception to be raised when a key exists???
To my understadning I cannot use PutNoDuplicate() as a primary with secondaries cannot have duplicates configured, and you can only use PutNoDuplicate if there is a sorted duplicate policy...
Any suggestions?Hi,
The documentation could be a little misleading here. If you specify DuplicatesPolicy.NONE for a database, then duplicates will not be allowed in the database, and when trying to put a key/data pair in the database when the key already exist will fail:
"Insertion when the key of the key/data pair being inserted already exists in the database will fail. "
Failing here means that there will be no duplicate created, without any exception being thrown as the default behavior is to "Store the key/data pair in the database, replacing any previously existing key if duplicates are disallowed"; see the Database.Put() methods (BTreeDatabase extends from / is a sub-class of Database).
You should use the PutNoOverwrite method. When the key that your are trying to insert already exists in the database, you will get a KeyExistException exception.
Regards,
Andrei -
BPM error: exception cx_merge_split occured,object FLOWITEM method EXECUTE
Hi Guys
I am working on a interface involving BPM.....
I am facing this problem while executing the interface...
I am getting error texts as below:
exception cx_merge_split occured,
object FLOWITEM method EXECUTE
I am trying to fix it....Please provide any iputs on this...
Thanx in adavance.Is your Transformation step designed for multimapping (n:1 or 1:n)?
If yes the payload seems to be incorrect....did you check the working of your mapping (MM/ IM) using the expected payload structure...
the transformation step in BPM has been given exception as System Error
There is one block step before the transformation step...in which exception is not given...?can this be the cause??
Does it mean...you have a Block step in your BPM and your Transformation Step is placed in it....the Block should have an exception handling branch...have the exception handling logic as per your need....the Block step needs to use Exception Handler...same Handler to be used in the Transformation Step's System Error section.
Press F7 and check if your BPM is giving any warning message.
Regards,
Abhishek. -
Web Service: Response has null value and no exception is thrown
Hi
I have generated a Web Service Proxy in JDeveloper 11gR1 against a web service.
My problem is that if I try to invoke the web service programmatically the only property on the response object has the null value. I can inspect the response in the Http Analyzer and it seems to understand and display content of the response properly.
I have debugged the service proxy and discovered that the set-method on the property is never called. No exceptions are thrown, so it is very hard to see where to start solving this issue!
Any ideas?When a webservice provides a response that is not valid according to its wsdl, a webservice proxy in 10g will give useful error messages such as "Missing element 'xxx'."
In 11g the web service proxy simply sets non-valid values to null, quietly accepting the invalid response. Is this the intended behavior?
Is it possible to enter a debug mode, where the webservice response is validated against the wsdl as in 10g?
I appreciate any help on this question.
Thanks! -
Exception is thrown but exception.getMessage() is null
Hi,
I am wirting a code in which an exception is thrown, I catch this exception in the catch block, but when I display e.getMessage() it displays null.....Can any body help in telling why....
Thanks
Rajnish VermagetMessage() is just about useless. If you use the no-arg constructor for a Throwable, you'll get a null message. Much, much better for displaying information about Throwables is toString() which will include the class name of the Throwable and the message if it's not null. Out shop never uses getMessage()
-
Hi All,
My environment details:
SCSM 2012 R2
SCCM 2012 R2 connector configured
When I looked into the event viewer , I find the following error occurring continuously while the SCCM 2012 synchronization
Error Event 26319
An exception was thrown while processing ProcessDiscoveryData for session ID uuid:xxxxx
Exception message: The relationship source specified in the discovery data item is not valid.
Relationship source ID: xxxx
Rule ID: xxxxxx
Full Exception: Microsoft.EnterpriseManagement.Common.DiscoveryDataInvalidRelationshipSourceException: The relationship source specified in the discovery data item is not valid.
This error is accompanied by the below warning
Event:34113
Connector SCCM Connector -Primary Site
Error writing changes to entity of type Microsoft.Windows.Peripheral.LogicalDisk with DisplayName XXXXXXX
Message: The relationship source specified in the discovery data item is not valid.
Relationship source ID: XXXXXXX
Rule ID: XXXXXXX
If this error occurs with every synchronization, examine view Cached_CMv5_LogicalDisks for correctness or the schema for type Microsoft.Windows.Peripheral.LogicalDisk in management pack Microsoft.Windows.Peripheral.Library.
Event:33333
Data Access Layer rejected retry on SqlError:
Request: p_RelationshipDiscovered -- (RelationshipId=f449d88a-ecbf-5b16-40be-c085391a6380), (SourceEntityId=ccdf084d-254f-0ad4-ba2e-189b75ff109a), (TargetEntityId=07734206-0880-a4ec-a638-df20ccbdcbaf), (RelationshipTypeId=e4c6f8ce-0763-51c6-6421-c424a93a1eb6),
(DiscoverySourceId=df6eae9f-f14f-4e6e-9f3c-c1effa193fbe), (HealthServiceEntityId=34b1c704-120c-1175-9fe3-411e2c0aac30), (PerformHealthServiceCheck=False), (TimeGenerated=09/01/2015 04:15:26), (SourceEntityLastModified=), (IsRelationshipAlreadyDiscovered=False),
(RelationshipInserted=False), (LastModified=), (ChangeId=), (RETURN_VALUE=1)
Class: 16
Number: 777980002
Message: The specified relationship doesn't have a valid source.
From the events, it is clear that the problem is with SCCM connector and in the warning it mention to check the management pack ,
Microsoft.Windows.Peripheral.Library
whether need to update any MP ??
I tried to resolve this, but ended up in aforum which suggested to do a restart of server .But since it is Prod , restart will not be easy.
If any suggestions , it will be good to resolve this
Thank youHi,
Please install UR3 and check the result:
Update Rollup 3 for System Center 2012 R2 Service Manager
http://support.microsoft.com/kb/2962041
Regards,
Yan Li
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Maybe you are looking for
-
Strange character in report script unload file.
I have an Essbase Report script I'm using to create an unload file of my Essbase Data. Ever time I run the report script and open the file it has this character on the first line of the file  , what are these and how do I suppress them>? thanks
-
Upload flat file (Content Conversion Parameters)
Hello, I am still trying to upload a flat text file to XI. Its a non separator file. Here the error message from the XI adaper engine: Sender Adapter v1508 for Party '', Service 'IXI_FileSystem_CSV': Configured at 15:36:12 2005-08-03 Initialization e
-
Thinkpad X201 Without touchpad
Hi, my x201 type no is : 3626-FBG but i can not find suitable palm rest for my laptop " with fingerprint reader, without touchpad ". there is no FBx you can see below list : http://support.lenovo.com/us/en/documents/migr-70510 Palm rest assembly with
-
Memory consumption of queries in workbooks
We have an issue with the exceution of a Workbook which contains several queries. The queries require very much memory which finally leads to a shortdump (TSV_TNEW_PAGE_ALLOC_FAILED). We found that during execution of the workbook the memory is not r
-
Jmap executable not found in linux
I have installed jdk 1.6 in linux long time before, now I want to use jmap to get heap dump, looking under the bin folder there is no jmap, lrwxrwxrwx 1 root root 10 May 21 2012 ControlPanel -> ./jcontrol -rwxr-xr-x 1 root root 50794 Jan 20 20