NoSuchObjectException thrown when using exportObject
Hello,
while dealing with some jGuru-exercise (http://java.sun.com/developer/onlineTraining/rmi/exercises/DistributedGarbageCollector/index.html) I encountered some problems with UnicastRemoteObject.exportObject( obj, 0).
I modified the mentioned exercise so that the server-side remote implementation classes do not extend UnicastRemoteObject anymore. Instead, the remote reference stubs will now be created by calling UnicastRemoteObject.exportObject( obj, 0) and returned to the client.
The modified code:
class MessageObjectImpl
//extends UnicastRemoteObject
implements MessageObject, Serializable, Unreferenced
public MessageObject getMessageObject() throws RemoteException
MessageObject mo = new MessageObjectImpl();
//return mo;
return (MessageObject) UnicastRemoteObject.exportObject(mo, 0);
}Sometimes it works, sometimes it does not. In the latter case the following exception is thrown:
java.rmi.NoSuchObjectException: no such object in tableIt seems as if the Garbage Collector finalizes the object right before the client is able to call a method on the stub.
Can somebody help me out and tell, why it works when the remote implementation class extend UnicastRemoteObject and why it does not work when using UnicastRemoteObject.exportObject(mo, 0).
Thanks in advance!
MP
See http://java.sun.com/developer/onlineTraining/rmi/exercises/DistributedGarbageCollector/index.html.
The interface MessageObject implements Remote. The implementation class does not need to implement Serializable, but it is not wrong, because every UnicastRemoteObject has to be serializable. UnicastRemoteObject itself implements Serializable...
I bypassed the problem by returning the instance "mo" of MessgeObjectImpl instead of the result of exportObject. Now it does work.
Moreover if I would not have extended Remote, there would not be a NoSuchObjectException but an UnmarshallingException.
Similar Messages
-
HBR Error thrown when using @NEXTSIBLING or @SHIFTSIBLING within the FIX
Hi,
I'm working on a HBR that works fine, when using the following code:
SET CREATENONMISSINGBLK ON;
+FIX("BegBalance",[KHSA_PLAN2_ACCOUNT],[KHSA_PLAN2_CUSTOM3],[KHSA_PLAN2_CUSTOM4],"E-00000","FY10","Budget","Robocza",[KHSA_PLAN2_CURRENCY],HSP_InputValue)+
FIX(T4)
+"C2-00000"= 2;+
ENDFIX
ENDFIX
Now, I'd like to use the @NEXTSIBLING or @SHIFTSIBLING within the second FIX statement, so the BR code looks like this:
SET CREATENONMISSINGBLK ON;
+FIX("BegBalance",[KHSA_PLAN2_ACCOUNT],[KHSA_PLAN2_CUSTOM3],[KHSA_PLAN2_CUSTOM4],"E-00000","FY10","Budget","Robocza",[KHSA_PLAN2_CURRENCY],HSP_InputValue)+
FIX(@NEXTSIBLING(T4))
+"C2-00000"= 2;+
ENDFIX
ENDFIX
When launched, the HBR throws an error: Detail:Cannot calculate. Essbase Error(1200315): Error parsing formula for [FIX STATEMENT] (line 3): invalid object type
I'm missing sth, am I not?
Thanks for help, regards
Marcin StawnyIt truly helped, however I went further and wanted to use @SHIFTSIBLING where the shift integer comes from a sum of data values. The code looks like this:
SET CREATENONMISSINGBLK ON;
+FIX("BegBalance",[KHSA_PLAN2_ACCOUNT],[KHSA_PLAN2_CUSTOM3],[KHSA_PLAN2_CUSTOM4],"E-00000","FY10","Budget","Robocza",[KHSA_PLAN2_CURRENCY],HSP_InputValue)+
FIX(@MEMBER(@SHIFTSIBLING("T1", (@SUM(@DESCENDANTS("Transactions"))))))_
+"C2-00000"= 1;+
ENDFIX
ENDFIX
The @SUM(@DESCENDANTS("Transactions")) calculates the sum properly (verified this part of the code in another place), however it seems that it has to be passed as an integer to the @SHIFTSIBLING, hasn't it?
How can I do that?
Regards
Marcin Stawny -
NullPointerException thrown when using get method in CMR relationship outsi
We are using weblogic 9.1 CMP entity beans with BEA's XA oracle driver. We have a bean called User that has a many address beans. When calling the getAddresses method on a UserLocal a NullPointerException gets thrown if the stateless session bean method that is marked as @LocalMethod(transactionAttribute=Constants.TransactionAttribute.SUPPORTS). If we change it to REQUIRED the method returns addresses successfully. Does anyone have any ideas as to what could be causing this? Below is the stack trace.
My best guess is that an exception is occurring and when weblogic tries to handle the exception EJBRuntimeUtils.throwEJBException encounters the NullPointerException.
javax.ejb.EJBException: EJB Exception: : java.lang.NullPointerException
at gov.nasa.echo.dataaccessobjects.user.echo_user_User_l47u68__WebLogic_CMP_RDBMS_addresses_Set.<init>(echo_user_User_l47u68__WebLogic_CMP_RDBMS_addresses_Set.java
:93)
at gov.nasa.echo.dataaccessobjects.user.echo_user_User_l47u68__WebLogic_CMP_RDBMS.getAddresses(echo_user_User_l47u68__WebLogic_CMP_RDBMS.java:1161)
at gov.nasa.echo.dataaccessobjects.user.echo_user_User_l47u68_ELOImpl.getAddresses(echo_user_User_l47u68_ELOImpl.java:770)
at gov.nasa.echo.subsystems.user.UserTypeMap.convertUser(UserTypeMap.java:66)
at gov.nasa.echo.subsystems.user.UserSubsystem.getUserByUserId(UserSubsystem.java:321)
at gov.nasa.echo.subsystems.user.UserSubsystem.getUsersByUserId(UserSubsystem.java:302)
at gov.nasa.echo.services.authentication.AuthenticationServiceBean.login(AuthenticationServiceBean.java:442)
at gov.nasa.echo.services.authentication.AuthenticationServiceBean_plcr77_ELOImpl.login(AuthenticationServiceBean_plcr77_ELOImpl.java:1001)
at gov.nasa.echo.v8.AuthenticationServicePortImpl.login(AuthenticationServicePortImpl.java:105)
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:585)
at weblogic.wsee.component.pojo.JavaClassComponent.invoke(JavaClassComponent.java:91)
at weblogic.wsee.ws.dispatch.server.ComponentHandler.handleRequest(ComponentHandler.java:68)
at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:127)
at weblogic.wsee.ws.dispatch.server.ServerDispatcher.dispatch(ServerDispatcher.java:84)
at weblogic.wsee.ws.WsSkel.invoke(WsSkel.java:60)
at weblogic.wsee.server.servlet.SoapProcessor.handlePost(SoapProcessor.java:66)
at weblogic.wsee.server.servlet.SoapProcessor.process(SoapProcessor.java:44)
at weblogic.wsee.server.servlet.BaseWSServlet$AuthorizedInvoke.run(BaseWSServlet.java:124)
at weblogic.wsee.server.servlet.BaseWSServlet.service(BaseWSServlet.java:53)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3153)
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:1973)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
; nested exception is: java.lang.NullPointerException
at weblogic.ejb.container.internal.EJBRuntimeUtils.throwEJBException(EJBRuntimeUtils.java:141)
at weblogic.ejb.container.internal.BaseLocalObject.handleSystemException(BaseLocalObject.java:643)
at weblogic.ejb.container.internal.BaseLocalObject.handleSystemException(BaseLocalObject.java:604)
at weblogic.ejb.container.internal.BaseLocalObject.postInvoke1(BaseLocalObject.java:347)
at weblogic.ejb.container.internal.BaseLocalObject.postInvokeTxRetry(BaseLocalObject.java:286)
Truncated. see log file for complete stacktraceJason Gilman wrote:
We are using weblogic 9.1 CMP entity beans with BEA's XA oracle driver. We have a bean called User that has a many address beans. When calling the getAddresses method on a UserLocal a NullPointerException gets thrown if the stateless session bean method that is marked as @LocalMethod(transactionAttribute=Constants.TransactionAttribute.SUPPORTS). If we change it to REQUIRED the method returns addresses successfully. Does anyone have any ideas as to what could be causing this? Below is the stack trace
My best guess is that an exception is occurring and when weblogic tries to handle the exception EJBRuntimeUtils.throwEJBException encounters the NullPointerException.
Open an official support case. This has nothing to do with jdbc.
Joe
>
>
javax.ejb.EJBException: EJB Exception: : java.lang.NullPointerException
at gov.nasa.echo.dataaccessobjects.user.echo_user_User_l47u68__WebLogic_CMP_RDBMS_addresses_Set.<init>(echo_user_User_l47u68__WebLogic_CMP_RDBMS_addresses_Set.java
:93)
at gov.nasa.echo.dataaccessobjects.user.echo_user_User_l47u68__WebLogic_CMP_RDBMS.getAddresses(echo_user_User_l47u68__WebLogic_CMP_RDBMS.java:1161)
at gov.nasa.echo.dataaccessobjects.user.echo_user_User_l47u68_ELOImpl.getAddresses(echo_user_User_l47u68_ELOImpl.java:770)
at gov.nasa.echo.subsystems.user.UserTypeMap.convertUser(UserTypeMap.java:66)
at gov.nasa.echo.subsystems.user.UserSubsystem.getUserByUserId(UserSubsystem.java:321)
at gov.nasa.echo.subsystems.user.UserSubsystem.getUsersByUserId(UserSubsystem.java:302)
at gov.nasa.echo.services.authentication.AuthenticationServiceBean.login(AuthenticationServiceBean.java:442)
at gov.nasa.echo.services.authentication.AuthenticationServiceBean_plcr77_ELOImpl.login(AuthenticationServiceBean_plcr77_ELOImpl.java:1001)
at gov.nasa.echo.v8.AuthenticationServicePortImpl.login(AuthenticationServicePortImpl.java:105)
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:585)
at weblogic.wsee.component.pojo.JavaClassComponent.invoke(JavaClassComponent.java:91)
at weblogic.wsee.ws.dispatch.server.ComponentHandler.handleRequest(ComponentHandler.java:68)
at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:127)
at weblogic.wsee.ws.dispatch.server.ServerDispatcher.dispatch(ServerDispatcher.java:84)
at weblogic.wsee.ws.WsSkel.invoke(WsSkel.java:60)
at weblogic.wsee.server.servlet.SoapProcessor.handlePost(SoapProcessor.java:66)
at weblogic.wsee.server.servlet.SoapProcessor.process(SoapProcessor.java:44)
at weblogic.wsee.server.servlet.BaseWSServlet$AuthorizedInvoke.run(BaseWSServlet.java:124)
at weblogic.wsee.server.servlet.BaseWSServlet.service(BaseWSServlet.java:53)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:225)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:127)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3153)
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:1973)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1880)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1310)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)
; nested exception is: java.lang.NullPointerException
at weblogic.ejb.container.internal.EJBRuntimeUtils.throwEJBException(EJBRuntimeUtils.java:141)
at weblogic.ejb.container.internal.BaseLocalObject.handleSystemException(BaseLocalObject.java:643)
at weblogic.ejb.container.internal.BaseLocalObject.handleSystemException(BaseLocalObject.java:604)
at weblogic.ejb.container.internal.BaseLocalObject.postInvoke1(BaseLocalObject.java:347)
at weblogic.ejb.container.internal.BaseLocalObject.postInvokeTxRetry(BaseLocalObject.java:286)
Truncated. see log file for complete stacktrace -
Exception thrown when using SDK 4.5.1 with debug flash player
My setup:
Windows 7
Flash Builder 4 Premium, Version 4.0 (build 272416), volume license
SDK 4.5.1
RIATest 4.3, RIATestAgent4.swc
I compiled our application using SDK 4.5.1 with these compiler setting:
-locale en_US -use-network=false -theme=Halo/halo.swc --keep-as3-metadata Test -define CONFIG::WITH_DEMS true -define CONFIG::LP_MODULE true -includes com.mycompany.automationDelegates.MyContainerAutomationImpl com.mycompany.automationDelegates.MyFirstComponentAutomationImpl com.mycompany.automationDelegates.MySecondComponentAutomationImpl com.mycompany.automationDelegates.MyThirdComponentAutomationImpl -include-libraries "C:\Program Files (x86)\RIATest 4\agent\RIATestAgent4.swc" "C:\Program Files (x86)\Adobe\Adobe Flash Builder 4\sdks\4.5.1\frameworks\libs\automation\automation.swc" "C:\Program Files (x86)\Adobe\Adobe Flash Builder 4\sdks\4.5.1\frameworks\libs\automation\automation_dmv.swc" "C:\Program Files (x86)\Adobe\Adobe Flash Builder 4\sdks\4.5.1\frameworks\libs\automation\automation_agent.swc"
When I run our application using the debug 10.2 Flash Player, the following exception is thrown:
ReferenceError: Error #1065: Variable Scroller is not defined.
at flash.system::ApplicationDomain/getDefinition()
at mx.automation.delegates.containers::ApplicationAutomationImpl/getAutomationChildren()[E:\ dev\4.5.1\frameworks\projects\automation\src\mx\automation\delegates\containers\Applicatio nAutomationImpl.as:266]
at mx.core::UIComponent/getAutomationChildren()[E:\dev\4.5.1\frameworks\projects\framework\s rc\mx\core\UIComponent.as:12919]
at mx.automation::AutomationManager/getAutomationChildrenArray()[C:\work\flex\dmv_automation \projects\automation_agent\src\mx\automation\AutomationManager.as:4895]
at com.riatest::CachedAutomationManager2/getAutomationChildrenArray()[C:\WORK\RIATest\Source \agent4\com\riatest\CachedAutomationManager2.as:46]
at mx.automation::AutomationManager/getChildrenRecursively()[C:\work\flex\dmv_automation\pro jects\automation_agent\src\mx\automation\AutomationManager.as:1252]
at mx.automation::AutomationManager/getChildren()[C:\work\flex\dmv_automation\projects\autom ation_agent\src\mx\automation\AutomationManager.as:1225]
at com.riatest::CachedAutomationManager/getChildren()[C:\WORK\RIATest\Source\agent4\com\riat est\CachedAutomationManager.as:55]
at com.riatest.toolbar::DisplayListTreeDataDescriptor/getChildren()[C:\WORK\RIATest\Source\a gent4\com\riatest\toolbar\DisplayListTreeDataDescriptor.as:74]
at com.riatest.toolbar::DisplayListTreeDataDescriptor/hasChildren()[C:\WORK\RIATest\Source\a gent4\com\riatest\toolbar\DisplayListTreeDataDescriptor.as:112]
at com.riatest.toolbar::DisplayListTreeDataDescriptor/isBranch()[C:\WORK\RIATest\Source\agen t4\com\riatest\toolbar\DisplayListTreeDataDescriptor.as:117]
at mx.controls::Tree/isBranch()[E:\dev\4.5.1\frameworks\projects\mx\src\mx\controls\Tree.as: 1552]
at mx.controls::Tree/initListData()[E:\dev\4.5.1\frameworks\projects\mx\src\mx\controls\Tree .as:2858]
at mx.controls::Tree/makeListData()[E:\dev\4.5.1\frameworks\projects\mx\src\mx\controls\Tree .as:1330]
at mx.controls::List/www.adobe.com/2006/flex/mx/internal::setupRendererFromData()[E:\dev\4.5.1\frameworks\projects\mx\src\mx\controls\List.as:1699]
at mx.controls::List/commitProperties()[E:\dev\4.5.1\frameworks\projects\mx\src\mx\controls\ List.as:896]
at mx.controls::Tree/commitProperties()[E:\dev\4.5.1\frameworks\projects\mx\src\mx\controls\ Tree.as:1191]
at mx.core::UIComponent/validateProperties()[E:\dev\4.5.1\frameworks\projects\framework\src\ mx\core\UIComponent.as:8209]
at mx.managers::LayoutManager/validateProperties()[E:\dev\4.5.1\frameworks\projects\framewor k\src\mx\managers\LayoutManager.as:597]
at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\4.5.1\frameworks\projects\frame work\src\mx\managers\LayoutManager.as:783]
at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\4.5.1\frameworks\projec ts\framework\src\mx\managers\LayoutManager.as:1180]
I contacted the folks who make RIATest, and they did their best to debug the problem. Their conclusion is:
"The stack trace that you posted shows that ApplicationAutomationImpl/getAutomationChildren calls ApplicationDomain/getDefinition on line 266 and the call fails with an error. This most likely indicates a bug in ApplicationAutomationImpl."
This problem never occurred when we were compiling our code using SDK 3.4.1. What can I do to work around this and continue performing automated tests of our Flash applications?Try linking a Scroller into your app.
-
EJBException thrown when using EntityBean
I am currently developing on the BEA Weblogic server 8.1 on Win2k SP4. The application
is currently up and running under Weblogic. I've added a new EntityBean (along
with the necessarn DB tables, classes, and descriptor file updates). Everything
compiles and the jar file builds. However, when I run the application and attempt
to access the new bean I get the following runtime exception:
javax.ejb.EJBException: Attempt to pass a reference to an EJBLocalObject to a
remote client. A local EJB component may only be accessed by clients co-located
in the same ear or standalone jar file..
javax.ejb.EJBException: Attempt to pass a reference to an EJBLocalObject to a
remote client. A local EJB component may only be accessed by clients co-located
in the same ear or standalone jar file.
at com.jsims.ws.ejbgame.ejb.Metadata_na2102_ELOImpl.writeObject(Ljava.io.ObjectOutputStream;)V(Metadata_na2102_ELOImpl.java:355)
at COM.jrockit.reflect.NativeMethodInvoker.invoke0(ILjava.lang.Object;[Ljava.lang.Object;)Ljava.lang.Object;(Native
Method)
where Metadata is the new bean added to the system. Could someone give me a clue
as to how I would start to debug this problem? I've gone over every file and I
can't see any issues.
Thanks in advance.Right, but you're returning a Collection of EJBLocalObjects. That's the
problem.
-- Rob
Bill Beebe wrote:
Rob Woollen <[email protected]> wrote:
It looks like your GameFacade EJB has a remote call trying to return
the
Local Metadata EJBI wish that were true, but it's just returning a Collection. I've attached another
file that includes code snippets of the various classes (from the client to the
EJBs) stripped down to their bare essentials as well as the section in the ejb-jar.xml
file where the ejb is defined.
Here is the home interface class:
package com.jsims.ws.ejbgame.ejb;
import java.util.Collection;
import javax.ejb.EJBLocalHome;
import javax.ejb.CreateException;
import javax.ejb.FinderException;
public interface MetadataHome extends EJBLocalHome
public static final String
JNDI_NAME = "cirrus/ejb/Metadata";
public MetadataLocal create(
String toeId,
String entityName,
Integer count,
String entityType,
Integer parent,
String symbolCode)
throws
CreateException;
public MetadataLocal findByPrimaryKey(MetadataKey primeKey)
throws FinderException;
public Collection findAllUnits()
throws FinderException;
public Collection findUnitEgs(String toeId)
throws FinderException;
public Collection findAllByDomain(String domain)
throws FinderException;
Here is the EJBLocalObject definition:
package com.jsims.ws.ejbgame.ejb;
import javax.ejb.EJBLocalObject;
* The local interface for the Metadata bean.
public interface MetadataLocal extends EJBLocalObject
public String getToeId();
public String getEntityName();
public Integer getCount();
public String getEntityType();
public Integer getParent();
public String getSymbolCode();
Here are the methods defined in GameFacade (and Bean):
public interface GameFacade extends EJBObject
public Collection getUnitsByDomain(String domain)
throws RemoteException;
Here is the implementation in the bean:
public class GameFacadeBean
extends NullEventListener
implements SessionBean
public Collection getUnitsByDomain(String domainName)
Collection
domainUnits = Collections.EMPTY_LIST;
try
domainUnits = metadataHome.findAllByDomain(domainName);
catch(FinderException ex)
ex.printStackTrace();
domainUnits = Collections.EMPTY_LIST;
return domainUnits;
and here is where it is being used on the client:
public TemplateView(int en, Framework fw)
framework = fw;
// Get the GameFacade and perform the query.
Collection
templates =
framework.getGame().getUnitsByDomain(domainName);
Here is the definition in the ejb-jar.xml entry:
<entity>
<display-name>Metadata</display-name>
<ejb-name>Metadata</ejb-name>
<local-home>com.jsims.ws.ejbgame.ejb.MetadataHome</local-home>
<local>com.jsims.ws.ejbgame.ejb.MetadataLocal</local>
<ejb-class>com.jsims.ws.ejbgame.ejb.MetadataBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>com.jsims.ws.ejbgame.ejb.MetadataKey</prim-key-class>
<reentrant>False</reentrant>
<abstract-schema-name>Metadata</abstract-schema-name>
<cmp-field>
<field-name>toeId</field-name>
</cmp-field>
<cmp-field>
<field-name>entityName</field-name>
</cmp-field>
<cmp-field>
<field-name>count</field-name>
</cmp-field>
<cmp-field>
<field-name>entityType</field-name>
</cmp-field>
<cmp-field>
<field-name>parent</field-name>
</cmp-field>
<cmp-field>
<field-name>symbolCode</field-name>
</cmp-field>
<query>
<query-method>
<method-name>findAllUnits</method-name>
<method-params/>
</query-method>
<ejb-ql>SELECT OBJECT(f) FROM Metadata AS f WHERE f.count = 0 OrderBy f.toeId</ejb-ql>
</query>
<query>
<query-method>
<method-name>findUnitEgs</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql>SELECT OBJECT(f) FROM Metadata AS f WHERE f.toeId = ?1 AND f.count > 0 OrderBy f.count</ejb-ql>
</query>
<query>
<query-method>
<method-name>findAllByDomain</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql>SELECT OBJECT(f) FROM Metadata AS f, TOE as t, ToeTemplateMappings as t2 WHERE f.toeId = t2.toeId AND t2.templateId = t.templateId AND t.domain=?1 and f.count = 0 OrderBy f.toeId</ejb-ql>
</query>
<!--query>
<query-method>
<method-name>findAllUnitKeys</method-name>
<method-params/>
</query-method>
<ejb-ql>SELECT f.toeId FROM Metadata AS f WHERE f.count = 0 OrderBy f.toeId</ejb-ql>
</query-->
</entity> -
Unique constraint is not thrown when used MERGE INSERT (alone) via dblink.
We found some interesting behaviour of unique constraint on Merge query when we use Merge When Not Matched Insert (no update query) via a dblink.
In one Schema S1, on Table A1(c1,c2,c3) there is a unique constraint on column (c1,c2).
Column c2 is nullable and has null for some records.
Now i have a table A2 with same defintion as A1 in Schema S2.In S2 , i have a dblink of S1 as S1 itself.
I have data in S2.A2. Here also i have some records with c2 as null and c1 matching with the data of S1.A1.
Now from schema S2,
I am using the following Merge Query,
MERGE INTO S1.A1 target
USING S2.A2 source
ON (target.c1 = source.c1 and target.c2 = source.c2)
WHEN NOT MATCHED
INSERT (c1,c2,c3) values (source.c1, source.c2,source.c3)
WHEN MATCHED
UPDATE c3 = source.c3;
Now when i execute this merge in schema S2,
if i have some data in S1.A1 and S2.A2 having c1 as same and c2 as null, as oracle does not treat two nulls same, it goes for an insert, i have got unique constraint violated error.
But if i execute MERGE INSERT alone, though that record is getting inserted , i am not getting unique constraint violated error.
Oracle version we are using is 10g (10.2...).
Is it a bug in oracle or what could have caused this behaviour.Dear,
ERROR at line 1:
ORA-00001: unique constraint (SYS_C00137508) violatedYou need to think about two things
(a) read consistency : what was the situation of table_1 when the maching clause has been initially evaluated ; there were 0 rows matching which means the merge operation will be all insert
(b) your matching clause has a problem : the join column must be unique in both tables otherwise the merge will be ambigous. You don't have a unique key on the source table
(c) think that the merge operation will never insert id =1 and then update id = 1 within the same operation. This will never happen
Hope this helps
Mohamed Houri -
Exception is thrown when using JEditorPane to display html
Hello,
I have this basic browser to display some pages from our intranet. Here's the code for it:
import java.awt.BorderLayout;
import javax.swing.JPanel;
import javax.swing.JEditorPane;
import javax.swing.JScrollPane;
import java.net.MalformedURLException;
import java.net.URL;
import java.io.IOException;
public class BrowserPanel extends JPanel {
private JEditorPane pane = null;
// Constructors
public BrowserPanel() {
pane = new JEditorPane();
pane.setEditable(false);
JScrollPane sp = new JScrollPane(pane);
sp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
setLayout(new BorderLayout());
add(sp, BorderLayout.CENTER);
// Methods
public void setContent(String str) {
StringBuffer sb = new StringBuffer(500);
sb.append("http://local.com/cgi-bin/search.pl?arg=");
sb.append(str);
try {
URL url = new URL(sb.toString());
pane.setPage(url);
} catch (MalformedURLException e) {
System.err.println("Malformed URL: " + e);
} catch (IOException e) {
System.err.println("IOException: " + e);
On some of the pages I get text all scrambled and the following exception comes up:
java.lang.ArrayIndexOutOfBoundsException
at javax.swing.text.html.TableView$RowView.layoutMajorAxis(TableView.java:1393)
at javax.swing.text.BoxView.layout(BoxView.java:580)
at javax.swing.text.BoxView.setSize(BoxView.java:265)
at javax.swing.text.BoxView.paint(BoxView.java:283)
at javax.swing.text.html.TableView$RowView.paint(TableView.java:1315)
at javax.swing.text.html.TableView.paint(TableView.java:740)
at javax.swing.text.BoxView.paintChild(BoxView.java:104)
at javax.swing.text.BoxView.paint(BoxView.java:294)
at javax.swing.text.html.BlockView.paint(BlockView.java:240)
at javax.swing.text.BoxView.paintChild(BoxView.java:104)
at javax.swing.text.BoxView.paint(BoxView.java:294)
at javax.swing.text.html.BlockView.paint(BlockView.java:240)
at javax.swing.plaf.basic.BasicTextUI$RootView.paint(BasicTextUI.java:1170)
at javax.swing.plaf.basic.BasicTextUI.paintSafely(BasicTextUI.java:523)
at javax.swing.plaf.basic.BasicTextUI.paint(BasicTextUI.java:657)
at javax.swing.plaf.basic.BasicTextUI.update(BasicTextUI.java:636)
at javax.swing.JComponent.paintComponent(JComponent.java:395)
at javax.swing.JComponent.paint(JComponent.java:687)
at javax.swing.JComponent.paintChildren(JComponent.java:498)
at javax.swing.JComponent.paint(JComponent.java:696)
at javax.swing.JViewport.paint(JViewport.java:668)
at javax.swing.JComponent.paintWithBuffer(JComponent.java:3878)
at javax.swing.JComponent._paintImmediately(JComponent.java:3821)
at javax.swing.JComponent.paintImmediately(JComponent.java:3672)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:370)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:124)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:154)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:337)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:98)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)
Many thanks for any clues on how to make it work.
cheers,
--JavanTyou should specify that this is an HTML veiwer explicitly, by writting something similar to this,
editor.setContentType("text/html");
kit = (HTMLEditorKit) editor.getEditorKit();
editor.setEditorKit(kit);
doc = (HTMLDocument) kit.createDefaultDocument();
editor.setDocument(doc); -
Exception report when using tomcat 5 with JDBC
i followed this guide to setup the JDBC with my TOMCAT 5
http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jndi-datasource-examples-howto.html#Database%20Connection%20Pool%20(DBCP)%20Configurations
but i seem to get this error
exception
javax.servlet.ServletException: Unable to get connection, DataSource invalid: "org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'"
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:846)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)
org.apache.jsp.SID.test_jsp._jspService(test_jsp.java:81)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
javax.servlet.jsp.JspException: Unable to get connection, DataSource invalid: "org.apache.commons.dbcp.SQLNestedException: Cannot create JDBC driver of class '' for connect URL 'null'"
org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.getConnection(QueryTagSupport.java:276)
org.apache.taglibs.standard.tag.common.sql.QueryTagSupport.doStartTag(QueryTagSupport.java:159)
org.apache.jsp.SID.test_jsp._jspx_meth_sql_query_0(test_jsp.java:100)
org.apache.jsp.SID.test_jsp._jspService(test_jsp.java:58)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
i can compile *.java and run them when they need the jdbc drivers to interact with mysql 5 database.
This is my server.xml
<!-- Example Server Configuration File -->
<!-- Note that component elements are nested corresponding to their
parent-child relationships with each other -->
<!-- A "Server" is a singleton element that represents the entire JVM,
which may contain one or more "Service" instances. The Server
listens for a shutdown command on the indicated port.
Note: A "Server" is not itself a "Container", so you may not
define subcomponents such as "Valves" or "Loggers" at this level.
-->
<Server port="8005" shutdown="SHUTDOWN" debug="0">
<!-- Comment these entries out to disable JMX MBeans support -->
<!-- You may also configure custom components (e.g. Valves/Realms) by
including your own mbean-descriptor file(s), and setting the
"descriptors" attribute to point to a ';' seperated list of paths
(in the ClassLoader sense) of files to add to the default list.
e.g. descriptors="/com/myfirm/mypackage/mbean-descriptor.xml"
-->
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
debug="0"/>
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"
debug="0"/>
<!-- Global JNDI resources -->
<GlobalNamingResources>
<!-- Test entry for demonstration purposes -->
<Environment name="simpleValue" type="java.lang.Integer" value="30"/>
<!-- Editable user database that can also be used by
UserDatabaseRealm to authenticate users -->
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved">
</Resource>
<ResourceParams name="UserDatabase">
<parameter>
<name>factory</name>
<value>org.apache.catalina.users.MemoryUserDatabaseFactory</value>
</parameter>
<parameter>
<name>pathname</name>
<value>conf/tomcat-users.xml</value>
</parameter>
</ResourceParams>
</GlobalNamingResources>
<!-- A "Service" is a collection of one or more "Connectors" that share
a single "Container" (and therefore the web applications visible
within that Container). Normally, that Container is an "Engine",
but this is not required.
Note: A "Service" is not itself a "Container", so you may not
define subcomponents such as "Valves" or "Loggers" at this level.
-->
<!-- Define the Tomcat Stand-Alone Service -->
<Service name="Catalina">
<!-- A "Connector" represents an endpoint by which requests are received
and responses are returned. Each Connector passes requests on to the
associated "Container" (normally an Engine) for processing.
By default, a non-SSL HTTP/1.1 Connector is established on port 8080.
You can also enable an SSL HTTP/1.1 Connector on port 8443 by
following the instructions below and uncommenting the second Connector
entry. SSL support requires the following steps (see the SSL Config
HOWTO in the Tomcat 5 documentation bundle for more detailed
instructions):
* If your JDK version 1.3 or prior, download and install JSSE 1.0.2 or
later, and put the JAR files into "$JAVA_HOME/jre/lib/ext".
* Execute:
%JAVA_HOME%\bin\keytool -genkey -alias tomcat -keyalg RSA (Windows)
$JAVA_HOME/bin/keytool -genkey -alias tomcat -keyalg RSA (Unix)
with a password value of "changeit" for both the certificate and
the keystore itself.
By default, DNS lookups are enabled when a web application calls
request.getRemoteHost(). This can have an adverse impact on
performance, so you can disable it by setting the
"enableLookups" attribute to "false". When DNS lookups are disabled,
request.getRemoteHost() will return the String version of the
IP address of the remote client.
-->
<!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 -->
<Connector port="8080"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
debug="0" connectionTimeout="20000"
disableUploadTimeout="true" />
<!-- Note : To disable connection timeouts, set connectionTimeout value
to 0 -->
<!-- Note : To use gzip compression you could set the following properties :
compression="on"
compressionMinSize="2048"
noCompressionUserAgents="gozilla, traviata"
compressableMimeType="text/html,text/xml"
-->
<!-- Define a SSL Coyote HTTP/1.1 Connector on port 8443 -->
<!--
<Connector port="8443"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" debug="0" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS" />
-->
<!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
<Connector port="8009"
enableLookups="false" redirectPort="8443" debug="0"
protocol="AJP/1.3" />
<!-- Define a Proxied HTTP/1.1 Connector on port 8082 -->
<!-- See proxy documentation for more information about using this. -->
<!--
<Connector port="8082"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false"
acceptCount="100" debug="0" connectionTimeout="20000"
proxyPort="80" disableUploadTimeout="true" />
-->
<!-- An Engine represents the entry point (within Catalina) that processes
every request. The Engine implementation for Tomcat stand alone
analyzes the HTTP headers included with the request, and passes them
on to the appropriate Host (virtual host). -->
<!-- You should set jvmRoute to support load-balancing via JK/JK2 ie :
<Engine name="Standalone" defaultHost="localhost" debug="0" jvmRoute="jvm1">
-->
<!-- Define the top level container in our container hierarchy -->
<Engine name="Catalina" defaultHost="localhost" debug="0">
<!-- The request dumper valve dumps useful debugging information about
the request headers and cookies that were received, and the response
headers and cookies that were sent, for all requests received by
this instance of Tomcat. If you care only about requests to a
particular virtual host, or a particular application, nest this
element inside the corresponding <Host> or <Context> entry instead.
For a similar mechanism that is portable to all Servlet 2.4
containers, check out the "RequestDumperFilter" Filter in the
example application (the source for this filter may be found in
"$CATALINA_HOME/webapps/examples/WEB-INF/classes/filters").
Request dumping is disabled by default. Uncomment the following
element to enable it. -->
<!--
<Valve className="org.apache.catalina.valves.RequestDumperValve"/>
-->
<!-- Global logger unless overridden at lower levels -->
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="catalina_log." suffix=".txt"
timestamp="true"/>
<!-- Because this Realm is here, an instance will be shared globally -->
<!-- This Realm uses the UserDatabase configured in the global JNDI
resources under the key "UserDatabase". Any edits
that are performed against this UserDatabase are immediately
available for use by the Realm. -->
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
debug="0" resourceName="UserDatabase"/>
<!-- Comment out the old realm but leave here for now in case we
need to go back quickly -->
<!--
<Realm className="org.apache.catalina.realm.MemoryRealm" />
-->
<!-- Replace the above Realm with one of the following to get a Realm
stored in a database and accessed via JDBC -->
<!--
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
driverName="org.gjt.mm.mysql.Driver"
connectionURL="jdbc:mysql://localhost/authority"
connectionName="test" connectionPassword="test"
userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name" />
-->
<!--
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
driverName="oracle.jdbc.driver.OracleDriver"
connectionURL="jdbc:oracle:thin:@ntserver:1521:ORCL"
connectionName="scott" connectionPassword="tiger"
userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name" />
-->
<!--
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
driverName="sun.jdbc.odbc.JdbcOdbcDriver"
connectionURL="jdbc:odbc:CATALINA"
userTable="users" userNameCol="user_name" userCredCol="user_pass"
userRoleTable="user_roles" roleNameCol="role_name" />
-->
<!-- Define the default virtual host
Note: XML Schema validation will not work with Xerces 2.2.
-->
<Host name="localhost" debug="0" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<!-- Defines a cluster for this node,
By defining this element, means that every manager will be changed.
So when running a cluster, only make sure that you have webapps in there
that need to be clustered and remove the other ones.
A cluster has the following parameters:
className = the fully qualified name of the cluster class
name = a descriptive name for your cluster, can be anything
debug = the debug level, higher means more output
mcastAddr = the multicast address, has to be the same for all the nodes
mcastPort = the multicast port, has to be the same for all the nodes
mcastBindAddr = bind the multicast socket to a specific address
mcastTTL = the multicast TTL if you want to limit your broadcast
mcastSoTimeout = the multicast readtimeout
mcastFrequency = the number of milliseconds in between sending a "I'm alive" heartbeat
mcastDropTime = the number a milliseconds before a node is considered "dead" if no heartbeat is received
tcpThreadCount = the number of threads to handle incoming replication requests, optimal would be the same amount of threads as nodes
tcpListenAddress = the listen address (bind address) for TCP cluster request on this host,
in case of multiple ethernet cards.
auto means that address becomes
InetAddress.getLocalHost().getHostAddress()
tcpListenPort = the tcp listen port
tcpSelectorTimeout = the timeout (ms) for the Selector.select() method in case the OS
has a wakup bug in java.nio. Set to 0 for no timeout
printToScreen = true means that managers will also print to std.out
expireSessionsOnShutdown = true means that
useDirtyFlag = true means that we only replicate a session after setAttribute,removeAttribute has been called.
false means to replicate the session after each request.
false means that replication would work for the following piece of code:
<%
HashMap map = (HashMap)session.getAttribute("map");
map.put("key","value");
%>
replicationMode = can be either 'pooled', 'synchronous' or 'asynchronous'.
* Pooled means that the replication happens using several sockets in a synchronous way. Ie, the data gets replicated, then the request return. This is the same as the 'synchronous' setting except it uses a pool of sockets, hence it is multithreaded. This is the fastest and safest configuration. To use this, also increase the nr of tcp threads that you have dealing with replication.
* Synchronous means that the thread that executes the request, is also the
thread the replicates the data to the other nodes, and will not return until all
nodes have received the information.
* Asynchronous means that there is a specific 'sender' thread for each cluster node,
so the request thread will queue the replication request into a "smart" queue,
and then return to the client.
The "smart" queue is a queue where when a session is added to the queue, and the same session
already exists in the queue from a previous request, that session will be replaced
in the queue instead of replicating two requests. This almost never happens, unless there is a
large network delay.
-->
<!--
When configuring for clustering, you also add in a valve to catch all the requests
coming in, at the end of the request, the session may or may not be replicated.
A session is replicated if and only if all the conditions are met:
1. useDirtyFlag is true or setAttribute or removeAttribute has been called AND
2. a session exists (has been created)
3. the request is not trapped by the "filter" attribute
The filter attribute is to filter out requests that could not modify the session,
hence we don't replicate the session after the end of this request.
The filter is negative, ie, anything you put in the filter, you mean to filter out,
ie, no replication will be done on requests that match one of the filters.
The filter attribute is delimited by ;, so you can't escape out ; even if you wanted to.
filter=".*\.gif;.*\.js;" means that we will not replicate the session after requests with the URI
ending with .gif and .js are intercepted.
The deployer element can be used to deploy apps cluster wide.
Currently the deployment only deploys/undeploys to working members in the cluster
so no WARs are copied upons startup of a broken node.
The deployer watches a directory (watchDir) for WAR files when watchEnabled="true"
When a new war file is added the war gets deployed to the local instance,
and then deployed to the other instances in the cluster.
When a war file is deleted from the watchDir the war is undeployed locally
and cluster wide
-->
<!--
<Cluster className="org.apache.catalina.cluster.tcp.SimpleTcpCluster"
managerClassName="org.apache.catalina.cluster.session.DeltaManager"
expireSessionsOnShutdown="false"
useDirtyFlag="true">
<Membership
className="org.apache.catalina.cluster.mcast.McastService"
mcastAddr="228.0.0.4"
mcastPort="45564"
mcastFrequency="500"
mcastDropTime="3000"/>
<Receiver
className="org.apache.catalina.cluster.tcp.ReplicationListener"
tcpListenAddress="auto"
tcpListenPort="4001"
tcpSelectorTimeout="100"
tcpThreadCount="6"/>
<Sender
className="org.apache.catalina.cluster.tcp.ReplicationTransmitter"
replicationMode="pooled"/>
<Valve className="org.apache.catalina.cluster.tcp.ReplicationValve"
filter=".*\.gif;.*\.js;.*\.jpg;.*\.htm;.*\.html;.*\.txt;"/>
<Deployer className="org.apache.catalina.cluster.deploy.FarmWarDeployer"
tempDir="/tmp/war-temp/"
deployDir="/tmp/war-deploy/"
watchDir="/tmp/war-listen/"
watchEnabled="false"/>
</Cluster>
-->
<!-- Normally, users must authenticate themselves to each web app
individually. Uncomment the following entry if you would like
a user to be authenticated the first time they encounter a
resource protected by a security constraint, and then have that
user identity maintained across all web applications contained
in this virtual host. -->
<!--
<Valve className="org.apache.catalina.authenticator.SingleSignOn"
debug="0"/>
-->
<!-- Access log processes all requests for this virtual host. By
default, log files are created in the "logs" directory relative to
$CATALINA_HOME. If you wish, you can specify a different
directory with the "directory" attribute. Specify either a relative
(to $CATALINA_HOME) or absolute path to the desired directory.
-->
<!--
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="localhost_access_log." suffix=".txt"
pattern="common" resolveHosts="false"/>
-->
<!-- Logger shared by all Contexts related to this virtual host. By
default (when using FileLogger), log files are created in the "logs"
directory relative to $CATALINA_HOME. If you wish, you can specify
a different directory with the "directory" attribute. Specify either a
relative (to $CATALINA_HOME) or absolute path to the desired
directory.-->
<Logger className="org.apache.catalina.logger.FileLogger"
directory="logs" prefix="localhost_log." suffix=".txt"
timestamp="true"/>
<Context path="/testdb" docBase="APACHE_DIR/htdocs/testdb"
debug="5" reloadable="true" crossContext="true">
<Logger className="org.apache.catalina.logger.FileLogger"
prefix="localhost_DBTest_log." suffix=".txt"
timestamp="true"/>
<Resource name="jdbc/TestDB"
auth="Container"
type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/TestDB">
<parameter>
<name>factory</name>
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<!-- Maximum number of dB connections in pool. Make sure you
configure your mysqld max_connections large enough to handle
all of your db connections. Set to 0 for no limit.
-->
<parameter>
<name>maxActive</name>
<value>10</value>
</parameter>
<!-- Maximum number of idle dB connections to retain in pool.
Set to 0 for no limit.
-->
<parameter>
<name>maxIdle</name>
<value>5</value>
</parameter>
<!-- Maximum time to wait for a dB connection to become available
in ms, in this example 10 seconds. An Exception is thrown if
this timeout is exceeded. Set to -1 to wait indefinitely.
-->
<parameter>
<name>maxWait</name>
<value>10000</value>
</parameter>
<!-- MySQL dB username and password for dB connections -->
<parameter>
<name>username</name>
<value>test</value>
</parameter>
<parameter>
<name>password</name>
<value>testpwd</value>
</parameter>
<!-- Class name for mm.mysql JDBC driver -->
<parameter>
<name>driverClassName</name>
<value>com.mysql.jdbc.Driver</value>
</parameter>
<!-- The JDBC connection url for connecting to your MySQL dB.
The autoReconnect=true argument to the url makes sure that the
mm.mysql JDBC Driver will automatically reconnect if mysqld closed the
connection. mysqld by default closes idle connections after 8 hours.
-->
<parameter>
<name>url</name>
<value>jdbc:mysql://localhost/testdb?autoReconnect=true</value>
</parameter>
</ResourceParams>
</Context>
</Host>
</Engine>
</Service>
</Server>You haven't added a resource reference for your web application that gives the application a local name for the global resource "UserDatabase".
-
Error message to be thrown when multiple enteries are not entered
Hello Guys,
I have used a select-options with no intervals in the selection screen.
If the user enters one value in the range, its working.
But I want a error message to be thrown when only one entry is entered. User should enter more than one entry always.
I used low and high but its not working.
Kindly guide me.No intervals only works on the main screen. If the press the right arrow and go to the ADDL choices, they can choose the entire database table in a single range....Your test is, therefore, too simplistic. If you want to limit this on both the main and the additional choices screens, you have to implement Function Module SELECT_OPTIONS_RESTRICT in the Load-of-Program or Initialization event.
Why not select from a table into a work table where the values are IN the select-options and see how many the user obtained?
Something like this:
Select <your field> from <your table> into table <your internal table>
where <your field> IN <your select-options>.
if lines( <your internal table> ) lt 2.
<your error message>.
endif. -
AutoSize not working properly in TextField when using non-zero line spacing
When using non-zero line spacing, the autoSize property is not functioning as expected, causing text fields to scroll that shouldn't. Also, when using device fonts, the sizes of the TextFields are wrong in the Flash IDE.
I have a TextField whose height is supposed to be dynamic, depending the width of the TextField. wordWrap is true, the text is left aligned, and the autoSize value is flash.text.TextFieldAutoSize.LEFT.
When the TextField's width is adjusted, the height increases or decreases as expected, but when I scroll the mouse wheel over the TextField, it allows a single line to scroll out of view. This should not be happening. The autoSize property should ensure the TextField is large enough to neither require nor allow scrolling.
Has anyone else encountered this issue or know how to fix it?
Update: Been a problem since at least 2006! > http://blog.nthsense.net/?p=46
http://www.kirupa.com/forum/showthread.php?288955-Disabling-textfield-scrolling Bug is caused by using a line height ("line spacing" in Flash) larger than zero, for example 1.0pt. It looks like when I reduce the line spacing of the text field to zero, the issue goes away. There doesn't seem to be anything wrong with how autoSize is calculating the required height of the text (i.e. it is exactly textHeight + 4 pixel gutter, and drawing the rectangle (2,2,textWidth,textHeight) aligns visually with the text), so it must have to do with how the TextField is deciding whether it needs to scroll or not, and that separate calculation is being thrown off by the non-zero line spacing. The additional non-zero spacing at the end of the last line could be making the TextField think it needs to scroll, even though it's hight is sufficient at "textHeight + 4". Apparently the problem manifests when using a non-zero leading value as well.
In fact, it has to be related to the leading value exactly, since the following code stops the textfield from scrolling.
//body is TextField
var tlm:TextLineMetrics = body.getLineMetrics(body.numLines - 1);
trace(tlm.leading); //traces "1" here. traces zero when line spacing is zero, and traces larger values with larger line spacing values
body.autoSize = flash.text.TextFieldAutoSize.NONE; //turn off autosize so the height can be set manually
body.height += tlm.leading; //increase height of textfield by leading value of last line to cause scrolling to be turned off.
Honestly, this is pretty unacceptable bug. First of all, scrolling should not be sensitive to trailing line spacing, because autoSize and textHeight do not include it. It need to be consistent, and I think textHeight and autoSize setting height = textHeight + 4 is correct. Vertical scrolling should use textHeight as it's guage for whether scrolling is necessary, but instead, it's obviously involving the leading values of the last line. At the very least, vertical scrolling should simply be disabled when autoSize is turned on and wordWrap is true, because the TextField should be big enough to fit all the text. The workaround of manually adjusting the height is also no good, since turning autoSize back on will immediately change the size back and trigger scrolling again. I also shouldn't have to set line spacing to zero just to use the autoSize feature, since the scrolling calculations are wrong in this way.No, lol. Luckly, I replace most of my TextFields on the display list with my subclass TextFieldEx. I just call a clone method that accepts a TextField and returns a TextFieldEx with identical properties.
I corrected the problem via modifying the subclass to behave differently when autoSize is not NONE and wordWrap is true. Under those conditions, the maxScrollV and scrollV property values are fixed at 1, and the class listens for its own SCROLL event and sets scrollV to 1 when it occurs. That allows me to leave everything else alone, including text selection, and use whatever line spacing I want.
The modification seems to work fine so far.
For anyone interested in doing something similar, here is a clone method that will copy a TextField.
public static function clone( t:TextField ):TextFieldEx
var te:TextFieldEx = create( "", t.width, t.type, t.multiline, t.wordWrap, t.selectable, t.embedFonts, t.defaultTextFormat );
te.alpha = t.alpha;
te.alwaysShowSelection = t.alwaysShowSelection;
te.antiAliasType = t.antiAliasType;
te.autoSize = t.autoSize;
te.background = t.background;
te.backgroundColor = t.backgroundColor;
te.blendMode = t.blendMode;
//te.blendShader = t.blendShader;
te.border = t.border;
te.borderColor = t.borderColor;
te.cacheAsBitmap = t.cacheAsBitmap;
te.condenseWhite = t.condenseWhite;
te.displayAsPassword = t.displayAsPassword;
//te.embedFonts = t.embedFonts;
te.filters = t.filters;
te.gridFitType = t.gridFitType;
te.height = t.height;
te.opaqueBackground = t.opaqueBackground;
te.restrict = t.restrict;
//te.selectable = t.selectable;
te.sharpness = t.sharpness;
te.thickness = t.thickness;
te.transform = t.transform;
//te.type = t.type;
te.useRichTextClipboard = t.useRichTextClipboard;
//te.wordWrap = t.wordWrap;
//Assign text last
te.htmlText = t.htmlText;
return te;
//And the create method it uses
public static function create( text:String = "", width:Number = NaN, type:String = null, multiline:Boolean = false, wordWrap:Boolean = false, selectable:Boolean = true, embedFonts:Boolean = false, font_or_textformat:*=null, size:Object=null, color:Object=null, bold:Object=null, italic:Object=null, underline:Object=null, url:String=null, target:String=null, align:String=null, leftMargin:Object=null, rightMargin:Object=null, indent:Object=null, leading:Object=null ):TextFieldEx
var tf:TextFieldEx = new TextFieldEx();
tf.width = isNaN(width) ? 100 : width;
tf.defaultTextFormat = (font_or_textformat is TextFormat) ? (font_or_textformat as TextFormat) : new TextFormat( font_or_textformat as String, size, color, bold, italic, underline, url, target, align, leftMargin, rightMargin, indent, leading );
tf.embedFonts = embedFonts;
tf.multiline = multiline;
tf.wordWrap = wordWrap;
tf.selectable = selectable;
tf.type = type;
tf.text = text; //setting text last ensures the text line metrics returns correct values
//Initialize the TextField's size to fit the text.
if (!multiline)
//When in single-line mode and no specific width is given,
//expand width to entire line.
if (isNaN(width))
tf.width = tf.textWidth + 4; //match width of text
//Height is always automatically adjusted to fit the text by default.
//It's better than the arbitrary 100px default height.
var minimum_height = tf.getLineMetrics( 0 ).height;
var h:Number = tf.textHeight;
tf.height = (h < minimum_height) ? (minimum_height + 4) : (h + 4); //match height of text, ensuring height is at least enough to display one line, even if there is no text
return tf; -
Java.lang.NullPointerException is thrown when packaging Adobe AIR application for iOS
Hi All,
https://bugbase.adobe.com/index.cfm?event=bug&id=3071298
As per above link this bug resolve(latest build) but i am facing Java.lang.NullPointerException is thrown when packaging Adobe AIR application for iOS, using the packaging tools.
(for inappPurchase Demo app --- i used below link code)
http://code.google.com/p/in-app-purchase-air-ios/
Thanks,
Sunil RanaHi Everyone,
I'm getting basically the same error. Are there any rules or guidelines that we are suppose follow when writing an app for iOS? Is there a way to know exactly where it is crashing? My apps are not MXML, only actionscript. Also I made sure I have no errors not even warnings in my SWF file, but still no go!
Getting the same error.
Exception in thread "main" java.lang.NullPointerException
at adobe.abc.GlobalOptimizer.sccp_eval(GlobalOptimizer.java:6944)
at adobe.abc.GlobalOptimizer.sccp_analyze(GlobalOptimizer.java:5909)
at adobe.abc.GlobalOptimizer.sccp(GlobalOptimizer.java:4628)
at adobe.abc.GlobalOptimizer.optimize(GlobalOptimizer.java:3514)
at adobe.abc.GlobalOptimizer.optimize(GlobalOptimizer.java:2215)
at adobe.abc.LLVMEmitter.optimizeABCs(LLVMEmitter.java:526)
at adobe.abc.LLVMEmitter.generateBitcode(LLVMEmitter.java:336)
at com.adobe.air.ipa.AOTCompiler.convertAbcToLlvmBitcodeImpl(AOTCompiler
.java:472)
at com.adobe.air.ipa.BitcodeGenerator.main(BitcodeGenerator.java:82)
Compilation failed while executing : ADT
regards,
Keith -
FileNotFoundException when using the Help.addBook method
Hi,
I tried to use the following code:
HelpSet helpSet = new HelpSet(myUrl);
Help help = new Help();
help.addBook(helpSet);
However, when trying to launch my application, a "FileNotFoundException: c:\Documents%20and%20Settings\...\myToc.xml" is thrown !
This problem occurs when using the JDK 1.4 (it does not seem to depend on the version of Oracle Help for Java: I tried to use successively 4.1.16, 4.1.17 and 4.2 versions !).
When developping my own application, I encountered a similar problem and found that it was related to a change in the java API. More precisely, prior to JDK 1.4 beta, getClass().getResource("myFile").getFile() would return "/c:/Documents and Settings/myFile" which could be used to read "myFile". But in JDK 1.4 beta, it returns a location that has spaces translated into %20 characters ("/c:/Documents%20and%20Settings/myFile") which cannot be used as a valid file name in java.io.File or java.io.FileInputStream classes.
Could you help me ?
Carine.Hi,
"myUrl" is the url of my "helpset.hs" file.
This file is written as follow:
<helpset>
<title>Validation</title>
<maps>
<homeID>top</homeID>
<mapref location="validation_map.xml"/>
</maps>
<view>
<title>Table of Contents</title>
<label>Table of Contents</label>
<type>oracle.help.navigator.tocNavigator.TOCNavigator</type>
<data engine="oracle.help.engine.XMLTOCEngine">validation_toc.xml</data>
</view>
<view>
<title>Index</title>
<label>Index</label>
<type>oracle.help.navigator.keywordNavigator.KeywordNavigator</type>
<data engine="oracle.help.engine.XMLIndexEngine">validation_index.xml</data>
</view>
<view>
<title>Search</title>
<label>Search</label>
<type>oracle.help.navigator.searchNavigator.SearchNavigator</type>
<data engine="oracle.help.engine.SearchEngine">validation_search.idx</data>
</view>
</helpset>
Thank you,
Carine. -
Properties file not found by classloader when using wlappc ant task
I have encountered a problem with the WebLogic Ant task "wlappc". When this task compiles a webmodule that uses the struts 1.1 framework I get the below error. This struts based web module deploys and runs fine on BEA Weblogic 8.1 SP2 as an exploded EAR structure. But when I attempt to precompile all the J2EE modules the struts web module will not compile with wlappc. The project is strutured correctly in a split directory structure. The problem area seems to be that we are using the struts-el (struts-el.jar) classes which need the properties files located in the struts.jar. The classloader seems to space out when running via the wlappc ant task. I tried adjusting the classpath via the "classpath" wlappc ant task attribute - but no success. Has anyone had this or a similiar problem?
Any suggestions would be greatly appreciated!
Thanks in advance,
Scott
Error from ant task is as such:
compile:
[javac] Compiling 256 source files to C:\My Builds\WWL\build\wwlentityejb
[javac] Compiling 4 source files to C:\My Builds\WWL\build\wwlsessejb
[javac] Compiling 91 source files to C:\My Builds\WWL\build\wwlweb\WEB-INF\classes
appc:
[wlappc] [appc] Compiling EAR module 'wwltestweb'
[wlappc] [JspcInvoker]Checking web app for compliance.
[wlappc] <Jul 28, 2004 4:38:47 PM GMT-05:00> <Info> <HTTP> <BEA-101047> <[ComplianceChecker] Validating the servlet element with servlet-name named "JUnitEETestServlet".>
[wlappc] <Jul 28, 2004 4:38:48 PM GMT-05:00> <Info> <HTTP> <BEA-101047> <[ComplianceChecker] Checking servlet-mapping for servlet name : "JUnitEETestServlet".>
[wlappc] [appc] Compiling EAR module 'wwlweb'
[wlappc] [JspcInvoker]Checking web app for compliance.
[wlappc] <Jul 28, 2004 4:38:48 PM GMT-05:00> <Info> <HTTP> <BEA-101047> <[ComplianceChecker] Validating the servlet element with servlet-name named "wwlActionServlet".>
[wlappc] <Jul 28, 2004 4:38:48 PM GMT-05:00> <Info> <HTTP> <BEA-101047> <[ComplianceChecker] Checking servlet-mapping for servlet name : "wwlActionServlet".>
[wlappc] <Jul 28, 2004 4:38:48 PM GMT-05:00> <Info> <HTTP> <BEA-101047> <[ComplianceChecker] Checking filter-mapping with filter-name "I18NFilter".>
[wlappc] <Jul 28, 2004 4:38:48 PM GMT-05:00> <Info> <HTTP> <BEA-101047> <[ComplianceChecker] Checking filter-mapping with filter-name "Security Filter".>
[wlappc] [jspc] parsing /admin/jsps/menu.jsp:
[wlappc] Jul 28, 2004 4:38:50 PM org.apache.struts.util.MessageResourcesFactory createFactory
[wlappc] SEVERE: MessageResourcesFactory.createFactory
[wlappc] java.lang.ClassNotFoundException: org.apache.struts.util.PropertyMessageResourcesFactory
[wlappc] at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
[wlappc] at java.security.AccessController.doPrivileged(Native Method)
[wlappc] at java.net.URLClassLoader.findClass(URLClassLoader.java:186)
[wlappc] at java.lang.ClassLoader.loadClass(ClassLoader.java:299)
[wlappc] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:272)
[wlappc] at java.lang.ClassLoader.loadClass(ClassLoader.java:255)
[wlappc] at org.apache.struts.util.RequestUtils.applicationClass(RequestUtils.java:207)
[wlappc] at org.apache.struts.util.MessageResourcesFactory.createFactory(MessageResourcesFactory.java:192)
[wlappc] at org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:576)
[wlappc] at org.apache.struts.util.RequestUtils.<clinit>(RequestUtils.java:134)
[wlappc] at org.apache.struts.util.MessageResourcesFactory.createFactory(MessageResourcesFactory.java:192)
[wlappc] at org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:576)
[wlappc] at org.apache.struts.taglib.html.BaseTag.<clinit>(BaseTag.java:94)
[wlappc] at java.lang.Class.forName0(Native Method)
[wlappc] at java.lang.Class.forName(Class.java:140)
[wlappc] at org.apache.strutsel.taglib.html.ELBaseTagBeanInfo.class$(ELBaseTagBeanInfo.java:81)
[wlappc] at org.apache.strutsel.taglib.html.ELBaseTagBeanInfo.getPropertyDescriptors(ELBaseTagBeanInfo.java:81)
[wlappc] at java.beans.Introspector.getTargetPropertyInfo(Introspector.java:436)
[wlappc] at java.beans.Introspector.getBeanInfo(Introspector.java:372)
[wlappc] at java.beans.Introspector.getBeanInfo(Introspector.java:207)
[wlappc] at java.beans.Introspector.getBeanInfo(Introspector.java:193)
[wlappc] at weblogic.servlet.jsp.StandardTagLib.parseTagDD(StandardTagLib.java:1323)
[wlappc] at weblogic.servlet.jsp.StandardTagLib.parseDD(StandardTagLib.java:1261)
[wlappc] at weblogic.servlet.jsp.StandardTagLib.<init>(StandardTagLib.java:292)
[wlappc] at weblogic.servlet.jsp.TagLibHelper.loadTagLib(TagLibHelper.java:314)
[wlappc] at weblogic.servlet.jsp.JspLexer.loadTagLib(JspLexer.java:145)
[wlappc] at weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE_BODY(JspLexer.java:5015)
[wlappc] at weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE(JspLexer.java:4853)
[wlappc] at weblogic.servlet.jsp.JspLexer.mDIRECTIVE(JspLexer.java:4699)
[wlappc] at weblogic.servlet.jsp.JspLexer.mSTANDARD_THING(JspLexer.java:2094)
[wlappc] at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1880)
[wlappc] at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java:1753)
[wlappc] at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java:963)
[wlappc] at weblogic.servlet.jsp.JspParser.doit(JspParser.java:106)
[wlappc] at weblogic.servlet.jsp.JspParser.parse(JspParser.java:230)
[wlappc] at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:125)
[wlappc] at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:258)
[wlappc] at weblogic.jspc.runJspc(jspc.java:550)
[wlappc] at weblogic.jspc.runJspc(jspc.java:437)
[wlappc] at weblogic.servlet.jsp.JspcInvoker.compile(JspcInvoker.java:163)
[wlappc] at weblogic.appc.compileWAR(appc.java:859)
[wlappc] at weblogic.appc.compileModules(appc.java:650)
[wlappc] at weblogic.appc.compileEAR(appc.java:733)
[wlappc] at weblogic.appc.compileInput(appc.java:458)
[wlappc] at weblogic.appc.runBody(appc.java:184)
[wlappc] at weblogic.utils.compiler.Tool.run(Tool.java:146)
[wlappc] at weblogic.utils.compiler.Tool.run(Tool.java:103)
[wlappc] at weblogic.appc.main(appc.java:1028)
[wlappc] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[wlappc] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[wlappc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[wlappc] at java.lang.reflect.Method.invoke(Method.java:324)
[wlappc] at weblogic.ant.taskdefs.j2ee.CompilerTask.invokeMain(CompilerTask.java:278)
[wlappc] at weblogic.ant.taskdefs.j2ee.Appc.execute(Appc.java:179)
[wlappc] at org.apache.tools.ant.Task.perform(Task.java:341)
[wlappc] at org.apache.tools.ant.Target.execute(Target.java:309)
[wlappc] at org.apache.tools.ant.Target.performTasks(Target.java:336)
[wlappc] at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
[wlappc] at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
[wlappc] at org.apache.tools.ant.Main.runBuild(Main.java:609)
[wlappc] at org.apache.tools.ant.Main.start(Main.java:196)
[wlappc] at org.apache.tools.ant.Main.main(Main.java:235)
[wlappc] Jul 28, 2004 4:38:50 PM org.apache.struts.util.MessageResourcesFactory createFactory
[wlappc] SEVERE: MessageResourcesFactory.createFactory
[wlappc] java.lang.ExceptionInInitializerError
[wlappc] at org.apache.struts.util.MessageResourcesFactory.createFactory(MessageResourcesFactory.java:192)
[wlappc] at org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:576)
[wlappc] at org.apache.struts.taglib.html.BaseTag.<clinit>(BaseTag.java:94)
[wlappc] at java.lang.Class.forName0(Native Method)
[wlappc] at java.lang.Class.forName(Class.java:140)
[wlappc] at org.apache.strutsel.taglib.html.ELBaseTagBeanInfo.class$(ELBaseTagBeanInfo.java:81)
[wlappc] at org.apache.strutsel.taglib.html.ELBaseTagBeanInfo.getPropertyDescriptors(ELBaseTagBeanInfo.java:81)
[wlappc] at java.beans.Introspector.getTargetPropertyInfo(Introspector.java:436)
[wlappc] at java.beans.Introspector.getBeanInfo(Introspector.java:372)
[wlappc] at java.beans.Introspector.getBeanInfo(Introspector.java:207)
[wlappc] at java.beans.Introspector.getBeanInfo(Introspector.java:193)
[wlappc] at weblogic.servlet.jsp.StandardTagLib.parseTagDD(StandardTagLib.java:1323)
[wlappc] at weblogic.servlet.jsp.StandardTagLib.parseDD(StandardTagLib.java:1261)
[wlappc] at weblogic.servlet.jsp.StandardTagLib.<init>(StandardTagLib.java:292)
[wlappc] at weblogic.servlet.jsp.TagLibHelper.loadTagLib(TagLibHelper.java:314)
[wlappc] at weblogic.servlet.jsp.JspLexer.loadTagLib(JspLexer.java:145)
[wlappc] at weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE_BODY(JspLexer.java:5015)
[wlappc] at weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE(JspLexer.java:4853)
[wlappc] at weblogic.servlet.jsp.JspLexer.mDIRECTIVE(JspLexer.java:4699)
[wlappc] at weblogic.servlet.jsp.JspLexer.mSTANDARD_THING(JspLexer.java:2094)
[wlappc] at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1880)
[wlappc] at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java:1753)
[wlappc] at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java:963)
[wlappc] at weblogic.servlet.jsp.JspParser.doit(JspParser.java:106)
[wlappc] at weblogic.servlet.jsp.JspParser.parse(JspParser.java:230)
[wlappc] at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:125)
[wlappc] at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:258)
[wlappc] at weblogic.jspc.runJspc(jspc.java:550)
[wlappc] at weblogic.jspc.runJspc(jspc.java:437)
[wlappc] at weblogic.servlet.jsp.JspcInvoker.compile(JspcInvoker.java:163)
[wlappc] at weblogic.appc.compileWAR(appc.java:859)
[wlappc] at weblogic.appc.compileModules(appc.java:650)
[wlappc] at weblogic.appc.compileEAR(appc.java:733)
[wlappc] at weblogic.appc.compileInput(appc.java:458)
[wlappc] at weblogic.appc.runBody(appc.java:184)
[wlappc] at weblogic.utils.compiler.Tool.run(Tool.java:146)
[wlappc] at weblogic.utils.compiler.Tool.run(Tool.java:103)
[wlappc] at weblogic.appc.main(appc.java:1028)
[wlappc] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[wlappc] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[wlappc] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[wlappc] at java.lang.reflect.Method.invoke(Method.java:324)
[wlappc] at weblogic.ant.taskdefs.j2ee.CompilerTask.invokeMain(CompilerTask.java:278)
[wlappc] at weblogic.ant.taskdefs.j2ee.Appc.execute(Appc.java:179)
[wlappc] at org.apache.tools.ant.Task.perform(Task.java:341)
[wlappc] at org.apache.tools.ant.Target.execute(Target.java:309)
[wlappc] at org.apache.tools.ant.Target.performTasks(Target.java:336)
[wlappc] at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
[wlappc] at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
[wlappc] at org.apache.tools.ant.Main.runBuild(Main.java:609)
[wlappc] at org.apache.tools.ant.Main.start(Main.java:196)
[wlappc] at org.apache.tools.ant.Main.main(Main.java:235)
[wlappc] Caused by: java.lang.NullPointerException
[wlappc] at org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:577)
[wlappc] at org.apache.struts.util.RequestUtils.<clinit>(RequestUtils.java:134)
[wlappc] ... 52 more
BUILD FAILED
file:C:/My Sources/WWLEar/wwlear/build.xml:128: weblogic.utils.compiler.ToolFailureException: [J2EE:160119]Appc is unable to process the file 'C:\My Builds\WWL\build'. The following error occurred:
java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:140)
at org.apache.strutsel.taglib.html.ELBaseTagBeanInfo.class$(ELBaseTagBeanInfo.java:81)
at org.apache.strutsel.taglib.html.ELBaseTagBeanInfo.getPropertyDescriptors(ELBaseTagBeanInfo.java:81)
at java.beans.Introspector.getTargetPropertyInfo(Introspector.java:436)
at java.beans.Introspector.getBeanInfo(Introspector.java:372)
at java.beans.Introspector.getBeanInfo(Introspector.java:207)
at java.beans.Introspector.getBeanInfo(Introspector.java:193)
at weblogic.servlet.jsp.StandardTagLib.parseTagDD(StandardTagLib.java:1323)
at weblogic.servlet.jsp.StandardTagLib.parseDD(StandardTagLib.java:1261)
at weblogic.servlet.jsp.StandardTagLib.<init>(StandardTagLib.java:292)
at weblogic.servlet.jsp.TagLibHelper.loadTagLib(TagLibHelper.java:314)
at weblogic.servlet.jsp.JspLexer.loadTagLib(JspLexer.java:145)
at weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE_BODY(JspLexer.java:5015)
at weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE(JspLexer.java:4853)
at weblogic.servlet.jsp.JspLexer.mDIRECTIVE(JspLexer.java:4699)
at weblogic.servlet.jsp.JspLexer.mSTANDARD_THING(JspLexer.java:2094)
at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1880)
at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java:1753)
at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java:963)
at weblogic.servlet.jsp.JspParser.doit(JspParser.java:106)
at weblogic.servlet.jsp.JspParser.parse(JspParser.java:230)
at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:125)
at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:258)
at weblogic.jspc.runJspc(jspc.java:550)
at weblogic.jspc.runJspc(jspc.java:437)
at weblogic.servlet.jsp.JspcInvoker.compile(JspcInvoker.java:163)
at weblogic.appc.compileWAR(appc.java:859)
at weblogic.appc.compileModules(appc.java:650)
at weblogic.appc.compileEAR(appc.java:733)
at weblogic.appc.compileInput(appc.java:458)
at weblogic.appc.runBody(appc.java:184)
at weblogic.utils.compiler.Tool.run(Tool.java:146)
at weblogic.utils.compiler.Tool.run(Tool.java:103)
at weblogic.appc.main(appc.java:1028)
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 weblogic.ant.taskdefs.j2ee.CompilerTask.invokeMain(CompilerTask.java:278)
at weblogic.ant.taskdefs.j2ee.Appc.execute(Appc.java:179)
at org.apache.tools.ant.Task.perform(Task.java:341)
at org.apache.tools.ant.Target.execute(Target.java:309)
at org.apache.tools.ant.Target.performTasks(Target.java:336)
at org.apache.tools.ant.Project.executeTarget(Project.java:1339)
at org.apache.tools.ant.Project.executeTargets(Project.java:1255)
at org.apache.tools.ant.Main.runBuild(Main.java:609)
at org.apache.tools.ant.Main.start(Main.java:196)
at org.apache.tools.ant.Main.main(Main.java:235)
Caused by: java.lang.NullPointerException
at org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:577)
at org.apache.struts.taglib.html.BaseTag.<clinit>(BaseTag.java:94)
... 49 more
- with nested exception:
[java.lang.ExceptionInInitializerError]
Total time: 42 secondsHi Rob,
I also gets this error when I deploy my application using struts 1.2.2 with struts-el.jar also.
The error is thrown when the server comile the jsp's :
<BEA-101047>[ServletContext(id=20164970,name=tracer,context-path=/tracer)] classfile up-to-date for JSP /webdatagrid/layouts/default/customize.jsp>
####<Sep 2, 2004 2:05:26 PM EDT> <Info> <HTTP> <nyeqshu2> <sit1tracerweb> <ExecuteThread: '3' for queue: 'weblogic.kernel.System'> <<WLS Kernel>> <>
<BEA-101047> <[ServletContext(id=20164970,name=tracer,context-path=/tracer)] checking /webdatagrid/layouts/default/exceldownload.jsp:>
####<Sep 2, 2004 2:05:30 PM EDT> <Error> <Deployer> <nyeqshu2> <sit1tracerweb> <ExecuteThread: '3' for queue: 'weblogic.kernel.System'> <<WLS Kernel>>
<>
<BEA-149201> <Failed to complete the deployment task with ID 0 for the application tracer-webapp-application-uncontrolled.
java.lang.NullPointerException
at org.apache.struts.util.MessageResources.getMessageResources(MessageResources.java:577)
at org.apache.struts.taglib.html.BaseTag.<clinit>(BaseTag.java:94)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:140)
at org.apache.strutsel.taglib.html.ELBaseTagBeanInfo.class$(ELBaseTagBeanInfo.java:81)
at org.apache.strutsel.taglib.html.ELBaseTagBeanInfo.getPropertyDescriptors(ELBaseTagBeanInfo.java:81)
at java.beans.Introspector.getTargetPropertyInfo(Introspector.java:436)
at java.beans.Introspector.getBeanInfo(Introspector.java:372)
at java.beans.Introspector.getBeanInfo(Introspector.java:207)
at java.beans.Introspector.getBeanInfo(Introspector.java:193)
at weblogic.servlet.jsp.StandardTagLib.parseTagDD(StandardTagLib.java:1323)
at weblogic.servlet.jsp.StandardTagLib.parseDD(StandardTagLib.java:1261)
at weblogic.servlet.jsp.StandardTagLib.<init>(StandardTagLib.java:292)
at weblogic.servlet.jsp.TagLibHelper.loadTagLib(TagLibHelper.java:314)
at weblogic.servlet.jsp.JspLexer.loadTagLib(JspLexer.java:145)
at weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE_BODY(JspLexer.java:5015)
at weblogic.servlet.jsp.JspLexer.mTAGLIB_DIRECTIVE(JspLexer.java:4853)
at weblogic.servlet.jsp.JspLexer.mDIRECTIVE(JspLexer.java:4699)
at weblogic.servlet.jsp.JspLexer.mSTANDARD_THING(JspLexer.java:2094)
at weblogic.servlet.jsp.JspLexer.mTOKEN(JspLexer.java:1880)
at weblogic.servlet.jsp.JspLexer.nextToken(JspLexer.java:1753)
at weblogic.servlet.jsp.JspLexer.parse(JspLexer.java:963)
at weblogic.servlet.jsp.JspParser.doit(JspParser.java:106)
at weblogic.servlet.jsp.JspParser.parse(JspParser.java:230)
at weblogic.servlet.jsp.Jsp2Java.outputs(Jsp2Java.java:125)
at weblogic.utils.compiler.CodeGenerator.generate(CodeGenerator.java:258)
at weblogic.servlet.jsp.Precompiler.compileOne(Precompiler.java:191)
at weblogic.servlet.jsp.Precompiler.compile(Precompiler.java:71)
at weblogic.servlet.jsp.Precompiler.compile(Precompiler.java:82)
at weblogic.servlet.internal.WebAppServletContext.precompileJSPs(WebAppServletContext.java:4908)
at weblogic.servlet.internal.WebAppServletContext.precompileJSPs(WebAppServletContext.java:4886)
at weblogic.servlet.internal.WebAppServletContext.prepareFromDescriptors(WebAppServletContext.java:2342)
at weblogic.servlet.internal.WebAppServletContext.init(WebAppServletContext.java:565)
at weblogic.servlet.internal.WebAppServletContext.<init>(WebAppServletContext.java:493)
at weblogic.servlet.internal.HttpServer.loadWebApp(HttpServer.java:628)
at weblogic.servlet.internal.WebAppModule.prepare(WebAppModule.java:626)
at weblogic.j2ee.J2EEApplicationContainer.prepareWebModule(J2EEApplicationContainer.java:3011)
at weblogic.j2ee.J2EEApplicationContainer.prepareModules(J2EEApplicationContainer.java:1532)
at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1188)
at weblogic.j2ee.J2EEApplicationContainer.prepare(J2EEApplicationContainer.java:1031)
at weblogic.management.deploy.slave.SlaveDeployer$ComponentActivateTask.prepareContainer(SlaveDeployer.java:2602)
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.createContainer(SlaveDeployer.java:2552)
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2474)
at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:798)
at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:507)
at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:465)
at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
--------------- nested within: ------------------
weblogic.management.ManagementException: - with nested exception:
[java.lang.NullPointerException]
at weblogic.management.deploy.slave.SlaveDeployer$ActivateTask.prepare(SlaveDeployer.java:2491)
at weblogic.management.deploy.slave.SlaveDeployer.processPrepareTask(SlaveDeployer.java:798)
at weblogic.management.deploy.slave.SlaveDeployer.prepareDelta(SlaveDeployer.java:507)
at weblogic.management.deploy.slave.SlaveDeployer.prepareUpdate(SlaveDeployer.java:465)
at weblogic.drs.internal.SlaveCallbackHandler$1.execute(SlaveCallbackHandler.java:25)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
>
####<Sep 2, 2004 2:37:29 PM EDT> <Info> <Deployer> <nyeqshu2> <sit1tracerweb> <ExecuteThread: '2' for queue: 'weblogic.kernel.System'> <<WLS Kernel>>
<>
<BEA-149059> <Module tracer of application tracer-webapp-application-1_6_3_510 is transitioning from unprepared to prepared on server sit1tracerweb
.>
####<Sep 2, 2004 2:37:39 PM EDT> <Debug> <HTTP> <nyeqshu2> <sit1tracerweb> <ExecuteThread: '2' for queue: 'weblogic.kernel.System'> <<WLS Kernel>> <>
####<Sep 2, 2004 2:37:39 PM EDT> <Debug> <HTTP> <nyeqshu2> <sit1tracerweb> <ExecuteThread: '2' for queue: 'weblogic.kernel.System'> <<WLS Kernel>> <>
<BEA-101211> <tracer-webapp-application-1_6_3_510:tracer Precompiling JSPs at startup with JSP config [JspConfig: verbose=true,packagePrefix=jsp_servl
et,-compiler=javac,compileFlags=,workingDir=./applications/tracer/WEB-INF/classes,pageCheckSeconds=5,superclass=weblogic.servlet.jsp.JspBase,keepgener
ated=true,precompileContinue=false,compilerSupportsEncoding=true,encoding=null,defaultfilename=index.jsp,compilerclass=null,noTryBlocks=true,debugEnab
led=false,printNulls=true,jspServlet=null].>
I've looked at the source code ant it is actually using the current thread's classloader.
The fact is that it works fine when deployed to tomcat 4.1.30, but it fails when deploying on our weblogic managed servers.
Thanks
Julien De Santis
CGI Group -
Working around unchecked conversions when using reflection
I think I've convinced myself that there's no way around this issue when using reflection and Generics, but here's the issue:
Suppose I've got a method that uses reflection to compare an arbitrary property in
an arbitrary pair of beans (of the same class).
public static <T> int compare(T bean0, T bean1, String prop) throws Exception {
Method m = bean0.getClass().getMethod(
"get" + prop.substring(0,1).toUpperCase() +
prop.substring(1));
Object o0 = m.invoke(bean0);
Object o1 = m.invoke(bean1);
if (o0 instanceof Comparable &&
o1 instanceof Comparable &&
(o1.getClass().isAssignableFrom(o0.getClass()) ||
o0.getClass().isAssignableFrom(o1.getClass()))) {
return ((Comparable)o0).compareTo(o1); // compiler warning
} else {
return o0.toString().compareTo(o1.toString());
}There's no way that, in general, when using reflection to invoke methods, that you can coerce the types to avoid compile-time type safety warnings. I think the above code is guarranteed not to throw a runtime ClassCastException, but there's no way to write the code so that the compiler can guarrantee it. At least that's what I think. Am I wrong?Ok it looks like you're dealing with a classloader issue. when you call that method, it is the equivelant of calling
Class.forName("Box", true, this.getClass().getClassLoader())The exception is thrown when your class's classloader cannot find the class box. try putting 'null' there
Class.forName("Box", true, null)and it will request the bootstrap classloader to load the class. just make sure you have permission :
If the loader is null, and a security manager is present, and the caller's class loader is not null, then this method calls the security manager's checkPermission method with a RuntimePermission("getClassLoader") permission to ensure it's ok to access the bootstrap class loader. (copied from the API) -
ADF BC: Exception when using an association accessor in polymorphic EOs
Hi,
I have generated a classic Dept-Emp ADF BC project. Since I need inheritance for my business logic, I created a new EO Manager which extends Employee. Attribute Job is the discriminator with a default value 'MANAGER'. The Employee VO uses polymorphic EOs. When I try to get the department of an employee in a method like Employee.getSal() the ClassCastException is thrown.
public Number getSal() {
DepartmentImpl d = (DepartmentImpl) getDepartment(); // Exception!
// process business logic
return aValue;
java.lang.ClassCastException: oracle.jbo.domain.Number
at oracle.jbo.server.RowFilterKey.<init>(RowFilterKey.java:47)
at oracle.jbo.server.ViewObjectImpl.buildRowFilter(ViewObjectImpl.java:4527)
at oracle.jbo.server.ViewRowSetImpl.getRowFilter(ViewRowSetImpl.java:419)
at oracle.jbo.server.ViewRowSetImpl.getRowFilter(ViewRowSetImpl.java:370)
at oracle.jbo.server.ViewRowSetImpl.ensureStorage(ViewRowSetImpl.java:4632)
at oracle.jbo.server.EntityRowSetImpl.<init>(EntityRowSetImpl.java:80)
at oracle.jbo.server.EntityImpl.createAssociationAccessorRS(EntityImpl.java:7610)
at oracle.jbo.server.AssociationDefImpl.get(AssociationDefImpl.java:329)
at oracle.jbo.server.AssociationDefImpl.get(AssociationDefImpl.java:274)
at oracle.jbo.server.EntityImpl.getAttributeInternal(EntityImpl.java:2144)
at com.trivadis.adf.inheritance.model.eo.EmployeeImpl.getDepartment(EmployeeImpl.java:186)
at com.trivadis.adf.inheritance.model.eo.EmployeeImpl.getSal(EmployeeImpl.java:103)
at com.trivadis.adf.inheritance.model.eo.EmployeeImpl.getAttrInvokeAccessor(EmployeeImpl.java:141)
at com.trivadis.adf.inheritance.model.eo.ManagerImpl.getAttrInvokeAccessor(ManagerImpl.java:76)
at oracle.jbo.server.EntityImpl.getAttribute(EntityImpl.java:784)Is it a known bug? or not allowed to use associations with EO Inheritance? Something else?
Any hints are welcome!
Thanks,
MarkusI have the same problem.
I'm using the RowIterator of an association to create a new Entity.
The exception is thrown when fetching the RowIterator before the createRow method is used.
java.lang.ClassCastException: oracle.jbo.domain.Number
at oracle.jbo.server.RowFilterKey.<init>(RowFilterKey.java:47)
at oracle.jbo.server.ViewObjectImpl.buildRowFilter(ViewObjectImpl.java:4527)
at oracle.jbo.server.ViewRowSetImpl.getRowFilter(ViewRowSetImpl.java:419)
at oracle.jbo.server.ViewRowSetImpl.getRowFilter(ViewRowSetImpl.java:370)
at oracle.jbo.server.ViewRowSetImpl.ensureStorage(ViewRowSetImpl.java:4632)
at oracle.jbo.server.EntityRowSetImpl.<init>(EntityRowSetImpl.java:80)
at oracle.jbo.server.EntityImpl.createAssociationAccessorRS(EntityImpl.java:7610)
at oracle.jbo.server.AssociationDefImpl.get(AssociationDefImpl.java:329)
at oracle.jbo.server.AssociationDefImpl.get(AssociationDefImpl.java:274)
at oracle.jbo.server.EntityImpl.getAttributeInternal(EntityImpl.java:2144)
at com.photoswing.model.web.AccountImpl.getAccountExcludedPhotoAccount(AccountImpl.java:2283)
at com.photoswing.model.web.WeventEditVORowImpl.registerNewEventFile(WeventEditVORowImpl.java:480)Thanks
Fred
Maybe you are looking for
-
After recently upgrading to Snow Leopard, my old bluetooth devices are no longer recognized and therefore unusable. Everything worked perfectly fine beforehand and now I cant play my music wirelessly on my stereo. The only thing that changed is the n
-
Why does my Pdf convert into hieroglyphs in Word?
Is it perhaps encrypted?
-
Why the drastic file size reduction in cropped images?
I just cropped a 9MB image a TINY amount and the resulting image was 756KB. Why? Is this normal?
-
Itunes help rated songs that shouldn't
hello, has anyone else had the problem of one day opening up you itunes and you have a whole bunch of rated songs in my top rated that you didnt even do. they are at a 5 stars but there not solid black like when you normal rate songs there a transpar
-
Upgrading from Windows Vista Home Premium to Vista Ultimate
Hi all I am trying to upgrade my windows Vista from home premium to ultimate and I have the original CD for the ultimate but when I put the CD and upgrade it wont upgrade and it gives me this message: " - The upgrade cannot be started. To upgrade, ca