JPA tests problem
Hi
I've just started to code a small application using JPA, to be precise I've followed steps from http://schuchert.wikispaces.com/JPA+Tutorial+1+-GettingStarted and I get a strange error:
I made a test class:
package entity;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Level;
import org.apache.log4j.Logger;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
public class PersonTest {
private EntityManagerFactory emf;
private EntityManager em;
@Before
public void initEmfAndEm() {
BasicConfigurator.configure();
Logger.getLogger("org").setLevel(Level.ERROR);
emf = Persistence.createEntityManagerFactory("examplePersistenceUnit");
em = emf.createEntityManager();
@After
public void cleanup() {
em.close();
@Test
public void emptyTest() {
}My persistence.xml looks as follows:
<persistence>
<persistence-unit name="examplePersistenceUnit"
transaction-type="RESOURCE_LOCAL">
<properties>
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.format_sql" value="false" />
<property name="hibernate.connection.driver_class"
value="org.hsqldb.jdbcDriver" />
<property name="hibernate.connection.url"
value="jdbc:hsqldb:mem:mem:aname" />
<property name="hibernate.connection.username" value="sa" />
<property name="hibernate.dialect"
value="org.hibernate.dialect.HSQLDialect" />
<property name="hibernate.hbm2ddl.auto" value="create" />
</properties>
</persistence-unit>
</persistence>While running the test I'm getting null pointer exception on line
em.close().
I've surrounded it with try-catch, and the stack-trace is:
java.lang.NullPointerException
at entity.PersonTest.cleanup(PersonTest.java:33)
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:597)
at org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74)
at org.junit.internal.runners.BeforeAndAfterRunner.runAfters(BeforeAndAfterRunner.java:65)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:37)
at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)What did I do wrong?
Greetings
Michal
It seems I used some incompatible jars. I still don't know which ones was it, but I've solved it.
Similar Messages
-
Recently, my Iphone shuts down at 50%+ bettery. My local Apple Store told me that the bettery was tested problem and needs to be repaired or changed. Since the phone is still under a year warranty, I was suggested to return it to the US Apple Store for help. Please let me know if I can send it to any store in the US or the store where I bought. Also, I don't find the email receipt. Will it be a problem for repair? Your quick response will be very appreciated. Thank you.
One more question. Can it be down without the receipt? If yes, I will send the phone to US immediately before warranty expired. Thank you.
-
Toplink JPA Deployment problem in OC4J
Hi all ,
we are having problem in deployment for an toplink JPA program in OC4J 10.1.3 .. We are using toplink essesntial and our deployed EAR structure is
aaplication.xml
rmwtoplink.war
the content of application.xml is as
<display-name>rmwtoplink</display-name>
<module>
<web>
<web-uri>rmwtoplink.war</web-uri>
<context-root>rmwapplist</context-root>
</web>
</module>
the content of war file as below :
web-inf\web.xml
web-inf\classes\META-INF\persistence.xml
web-inf\classes\<classes>
web-inf\gnf\<jsp pages>
when ever a pages are called those do not use entity manager / jpa call are loading perfectly , but the pages which have used jpa are nt diplayed , we check the error messages , it just halts after following codes :
EntityManagerFactory emf =
Persistence.createEntityManagerFactory(jpaSource);
It seems there is no exception that is even thrown in page or opmn log .
The same program is running fine in Jdveloper 10.1.3 /
Is there any way where we can get the actual error message ?
we are using toplink.jdbc.url for connecting the database .Here is little more insight for the problem , further check reveals that :
start connecting rmwtest
exception occured for connection test , Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: Listener refused the connection with the following error:
ORA-12514, TNS:listener does not currently know of service requested in connect descriptor
The Connection descriptor used by the client was:
//localhost:1521/ORCL
we do not have any idea how is localhost:1521/ORCL picked up , in our persistence.xml we have
where as rmwtest defined in persistence.xml as
<persistence-unit name="rmwtest" transaction-type="RESOURCE_LOCAL">
<provider>oracle.toplink.essentials.PersistenceProvider</provider>
<class>rmw.gnf.entity.ServSesnUser</class>
<class>rmw.gnf.entity.RmwData</class>
<class>rmw.gnf.entity.GnfData</class>
<properties>
<property name="toplink.logging.level" value="FINEST"/>
<property name="toplink.jdbc.driver" value="oracle.jdbc.driver.OracleDriver"/>
<property name="toplink.jdbc.url" value="jdbc:oracle:thin:@middb.1dc.com:1621:ukdbins"/>
<property name="toplink.jdbc.user" value="****"/>
<property name="toplink.jdbc.password" value="********"/>
</properties>
</persistence-unit> -
Hi All,
We had a problem while testing mapping in Altova Map Force.Here question is while testing our mapping in IR's interface mapping we got the message "Error while loading XSLT ".Target result is notgetting displayed.
Any ideas.....
Regards,
Surya.After importing XSL in imported archives, double click it and check whether u can open it or not. Make sure that the namespace ur XSL uses is same as the namespac under which it is imported. Make sure file loaded is XSL and not XSLT. Then try running end-to-end scenario and check the result.
Regards,
Prateek -
Hi All. I have a very weird problem here, as I can't get the Apple Hardware Test to start on my late 2008, 2.66 MBP15 inch model# MC026LL/A (released early 2009 as a quiet upgrade from 2.53). Here's the story:
I opened up my machine as usual one morning, and the optical drive made a very weird noise I never heard before. So I decided to run the Apple Hardware Test (AHT) to see if anything was amiss. Well, I inserted the second install disk, held down the "d" key, and restarted the machine. It began to boot into the hardware test, but just after the AHT screen appears the computer just shut down. This happens every time I try to run the AHT.
I went to an Apple Store while I was on holiday in Brisbane (they don't have one here in Adelaide), and the genius said it was likely a bad optical drive. Well, I returned to Adelaide last week and had the local Apple Authorized store replace the optical drive. Tried to run AHT once again, and the same problem persists. So the original problem wasn't with the optical drive.
I thought maybe I accidentally used the startup disks for my wife's late 2008 15inch, 2.4, MBP (the one actually released in late 2008). I've looked around for the other sets of disks and can't find them. So here's what I'm asking help for: can someone who owns a 15inch MBP 2.66 15-inch (released in early 2009, model# MC026LL/A ) please tell me what the part # is for their set of install disks? It is written on the plastic sleeves of the install disks. And, could this person please tell which version of AHT is written on the disk itself? The set I have (which I think might be my wife's) has AHT version 3A158.
Might this be the problem, or should my computer still be able to run the hardware test using my wife's disks? I know they are both technically late-2008 15inch unibody MBPs, but I think my 2.66 (again, quietly updated and released in early 2009) might require a different AHT version, which would explain my inability to run the test. If not, what might be causing my computer to not run the AHT? I tried reinstalling OS X to no avail.
Thanks for all of your help!I think I share your skepticism--if your Mac was shipped with the later version of the OS, you should not have been able to do a clean install with discs of an earlier version. It looks like some machines originally shipped with OS X v. 10.5.5 and others with OS X v. 10.5.6. I don't remember just when 10.5.6 came out.
Your two machines are likely very similar in build, and maybe similar enough for the OS to install. It may be that the AHT is specifically designed for the hardware in each machine, and that would be a bit different.
As someone else said in another thread, there ought to be a tutorial on how to keep track of the original install discs since they are always getting lost. Maybe a secure note in the keychain or something like that.
Out of curiosity, does the AHT work on your wife's machine? If not, there could be a problem with the install disc itself, and if so, you might be able to get a free replacement under warranty.
Good luck! -
Adf ejb jpa persistance problem
Hi everyone,
I`m a newbie to adf technology.
I was trying Build a Web Application with JDeveloper 11g Using EJB, JPA, and JavaServer Faces tutorial
([http://www.oracle.com/technology/obe/obe11jdev/11/ejb/ejb.html])
I have a problem when I try to run it.
It says;
javax.ejb.EJBException: EJB Exception: ; nested exception is:
Exception [EclipseLink-4002|http://forums.oracle.com/forums/] (Eclipse Persistence Services - 1.0.1 (Build 20080905)): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLSyntaxErrorException: ORA-00904: "EMAİL": geçersiz belirleyici (invalid identifier)
I thing it`s becouse I use a turkish operating system.
I tried to change the encoding settings to windows1252 intead of windows 1254 but same problem occures.
It makes the column EMAIL to EMAİL
Could you please help me abpout this problem?Hi,
can you print out the value that is received in the session facde to see where the conversion happens?
Frank -
ADF - MyFaces, HttpUnit testing problem with Javascript.
Dear all
Does anybody know how to test ADF Faces. Any tool would be of interest to me although Opensource and Free Software is prefered?
My task is to write a set of unit tests to test an Oracle ADF and Apache MyFaces application. I have attempted to use both Cactus and HttpUnit. However I am struggling with a simple test case which should simulate a login.
The problem I have is that ADF Faces produces the following dynamic javascript file (I am guessing it is dynamic because I can not find this in either adf-faces-impl-10_1_3_0_4.jar or adf-faces-api-10_1_3_0_4.jar which are the two jars am implementing in my project.):
Common10_1_3_0_4.js
Which when parsed by js.jar (Rhino javascript engine) I get the following error:
com.meterware.httpunit.ScriptException: Event 'submitForm('maincontent:loginForm',1, {source:'maincontent:submit'});return false;' failed: org.mozilla.javascript.EcmaError: TypeError: Cannot call method "split" of undefined at
com.meterware.httpunit.javascript.JavaScript$JavaScriptEngine.handleScriptException (JavaScript.java:202)
(This file Common10_1_3_0_4.js is over 5000 lines long and so I do not want to post it as this posting is already quite long).
Downloading the file directly after it has been built and modifying it and fixing the error by ensuring the split function is called on a strongly typed String variable, then commenting out from the web.xml below I tried the HttpUnit test again.
<servlet>
<servlet-name>resources</servlet-name>
<servlet-class>oracle.adf.view.faces.webapp.ResourceServlet</servlet-class>
</servlet>
<!-- servlet-mapping>
<servlet-name>resources</servlet-name>
<url-pattern>/adf/*</url-pattern>
</servlet-mapping -->
This time I get no error, but the original login page simply gets served again.
login.jsp (which is called as login.jsf)
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles"%>
<%@ taglib uri="http://xmlns.oracle.com/adf/faces/html" prefix="afh"%>
<%@ taglib uri="http://xmlns.oracle.com/adf/faces" prefix="af"%>
<!-- Content -->
<af:objectSeparator />
<af:panelBox text="#{msg['login.info.loginHeader']}" width="100%" background="transparent">
<af:form id="loginForm">
<af:objectSpacer height="10px" />
<af:panelGroup layout="vertical">
<af:panelForm labelWidth="5%">
<!--User Name-->
<af:panelLabelAndMessage for="username">
<af:inputText label="User Name:"
id="username"
columns="25"
required="yes"
secret="false"
value="#{userBean.userName}"
shortDesc="#{msg['global.user.userName']}" />
</af:panelLabelAndMessage>
<af:panelLabelAndMessage for="password">
<af:inputText label="Password:"
id="password"
columns="25"
required="yes"
secret="true"
value="#{userBean.password}"
shortDesc="#{msg['global.user.password']}" />
</af:panelLabelAndMessage>
<af:objectSpacer height="10px" />
<!--Login Button-->
<af:commandButton id="submit"
textAndAccessKey="#{msg['global.button.login']}"
action="#{userBean.login}" />
</af:panelForm>
</af:panelGroup>
</af:form>
</af:panelBox>
TestCase LoginTest.java:
package com.siemens.pse.wmstesting;
import java.io.IOException;
import junit.framework.TestCase;
import junit.framework.TestSuite;
import com.meterware.httpunit.GetMethodWebRequest;
import com.meterware.httpunit.WebConversation;
import com.meterware.httpunit.WebForm;
import com.meterware.httpunit.WebLink;
import com.meterware.httpunit.WebRequest;
import com.meterware.httpunit.WebResponse;
public class LoginTest extends TestCase {
* The URL of the Login page for all login tests
public static final String URL = new String( "http://localhost/WMS/pages/login.jsf" );
public static void main( String args[] ) {
junit.textui.TestRunner.run( suite() );
public static TestSuite suite() {
return new TestSuite( LoginTest.class );
public LoginTest( String s ) {
super( s );
public void testGetLogin() throws Exception {
response = new WebConversation( ).getResponse( request );
// Test the result
assertContains( response, "Login Management" );
public void testLoginSuccess() throws Exception {
response = new WebConversation( ).getResponse( request );
WebForm form = response.getFormWithID( "maincontent:loginForm" );
assertNotNull( "No form found with ID 'maincontent:loginForm'", form );
form.setParameter( "maincontent:username", "admin" );
form.setParameter( "maincontent:password", "pass" );
WebLink submit = response.getLinkWithID("maincontent:submit");
response = submit.click();
System.out.println( response.getText());
// Test the result
assertContains( response, "Welcome to the Temperature Measurement System" );
* Convenience function that asserts that a substring can be found in
* the returned HTTP response body.
* @param theResponse the response from the server side.
* @param s the substring to look for
public void assertContains( WebResponse response, String s ) {
String target = new String("");
try {
target = response.getText(); }
catch (IOException e) {
e.printStackTrace(); }
if ( target.indexOf( s ) < 0 ) {
// Error showing which string was NOT found
fail( "Response did not contain the substring: [" + s + "]" );
private WebRequest request = new GetMethodWebRequest( LoginTest.URL );
private WebResponse response;
}Dear All
Well I found the solution to my testing requirements. HtmlUnit is able to deal with the dynamic Javascript that is generated by the ADF Faces application. The strange part is that HtmlUnit uses the Rhino Javascript engine just as HttpUnit and Cactus, however these two could not deal with the javascript whereas HtmlUnit could.
I include a snippet of a test case that I wrote that now works.
public void testLoginSuccess() throws Exception {
final WebClient webClient = new WebClient( BrowserVersion.INTERNET_EXPLORER_6_0 );
final URL url = new URL("http://localhost/WMS/pages/login.jsf");
final HtmlPage page = (HtmlPage)webClient.getPage(url);
// Get the form that we are dealing with and within that form,
// find the submit button and the field that we want to change.
final HtmlForm form = page.getFormByName("maincontent:loginForm");
final HtmlTextInput usernameField = (HtmlTextInput) form.getInputByName("maincontent:username");
final HtmlPasswordInput passwordField = (HtmlPasswordInput) form.getInputByName("maincontent assword");
final ClickableElement button = (ClickableElement) form.getHtmlElementById("maincontent:submit");
// Change the value of the text field
usernameField.setValueAttribute("admin");
passwordField.setValueAttribute("pass");
// Get the submitted form
final HtmlPage welcomePage = (HtmlPage) button.click();
assertEquals( "Temperature Measurement System", welcomePage.getTitleText() );
} -
Hi Experts,
We have Seeburger scenrio while testing with My partner received HTTP Error 403 forbidden.
For configuration we are using AS2 adapter.
what does this mean is it we are having cofiguration problem or is it partner setup.
Regards,
JI can think of few checks, may be this can help
1. A valid sender agreement is missing.
2. Check AS2 ID.
3. There are more then one AS2 sender agreements with the same sender AND receiver party. -
Hi evryone,
Please help me out by giving me some reliable solution.
I am using dream weavercs3 trail, but I got problem with
browser test. I have Internet explorer , when I used to try to view
the preview of my dreamweaver page in IE , I got some error and IE
page got closed...
Is anybody have solution with this??
please suggest me whats next?
ThanksWhat error are you receiving?
Also I wasn't aware the trial was working because it was
taken off and was not supposed to be back up until July 1st. -
Help on this coding getting testing problem?
Hi ,
I am getting problem when created the BP.
When i tested and check the BP is created or not.its not getting.
i give the Businesspartner no and click enter i am not getting the BP details.
WOuld u please give the solution on this.
Its very urgent to me.
THe coding which i written for create the business partner is :
FUNCTION ZCTS_NEW_CONTACT.
""Local interface:
*" IMPORTING
*" VALUE(BUSINESSPARTNER) LIKE BAPIBUS1006_HEAD-BPARTNER
*" VALUE(CNEWINFO) TYPE ZCTS_CONTACTS
*" VALUE(CDATA) LIKE BAPIBUS1006_CENTRAL STRUCTURE
*" BAPIBUS1006_CENTRAL
*" VALUE(BUSPART1) LIKE BAPIBUS1006_RELHEAD-BUSINESSPARTNER1
*" VALUE(BUSPART2) LIKE BAPIBUS1006_RELHEAD-BUSINESSPARTNER2
*" VALUE(RELCAT) LIKE BAPIBUS1006_RELHEAD-RELATIONSHIPCATEGORY
*" EXPORTING
*" VALUE(MESG) TYPE CHAR100
DATA: lt_return like bapiret2 occurs 0 with Header line.
DATA: CTPERS LIKE BAPIBUS1006_CENTRAL_PERSON OCCURS 0 WITH HEADER LINE.
DATA : PARTN_GRP TYPE BAPIBUS1006_HEAD-PARTN_GRP.
DATA : PARTN_CAT TYPE BAPIBUS1006_HEAD-PARTN_CAT.
DATA: BEGIN OF ADADD.
INCLUDE STRUCTURE BAPIBUS1006_ADDRESS.
DATA: END OF ADADD.
DATA: BEGIN OF ADTEL OCCURS 0.
INCLUDE STRUCTURE BAPIADTEL.
DATA: END OF ADTEL.
DATA: BEGIN OF ADSMP OCCURS 0.
INCLUDE STRUCTURE BAPIADSMTP.
DATA: END OF ADSMP.
CTPERS-FIRSTNAME = CNEWINFO-FNAME.
CTPERS-LASTNAME = CNEWINFO-LNAME.
PARTN_CAT = 1.
PARTN_GRP = 002.
ADADD-CITY = CNEWINFO-CITY .
telephone info **
ADTEL-TELEPHONE = CNEWINFO-PHONE.
ADTEL-CONSNUMBER = '001'.
APPEND ADTEL.
ADTEL-TELEPHONE = CNEWINFO-MOBILE.
ADTEL-CONSNUMBER = '002'.
APPEND ADTEL.
email information **
ADSMP-E_MAIL = CNEWINFO-EMAIL .
APPEND ADSMP.
CALL FUNCTION 'BAPI_BUPA_CREATE_FROM_DATA'
EXPORTING
PARTNERCATEGORY = PARTN_CAT
CENTRALDATA = CDATA
PARTNERGROUP = PARTN_GRP
CENTRALDATAPERSON = CTPERS
ADDRESSDATA = ADADD
IMPORTING
BUSINESSPARTNER = BUsinessPartner
TABLES
TELEFONDATA = ADTEL
E_MAILDATA = ADSMP
RETURN = lt_return.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
*PARTN_CAT = 1.
*PARTN_GRP = 002.
*ADADD-CITY = CNEWINFO-CITY .
telephone info **
ADTEL-TELEPHONE = CNEWINFO-PHONE.
ADTEL-CONSNUMBER = '001'.
APPEND ADTEL.
ADTEL-TELEPHONE = CNEWINFO-MOBILE.
ADTEL-CONSNUMBER = '002'.
APPEND ADTEL.
email information **
ADSMP-E_MAIL = CNEWINFO-EMAIL .
APPEND ADSMP.
CALL FUNCTION 'BAPI_BUPR_PFCT_CREATEFROMDATA'
EXPORTING
BUSINESSPARTNER1 = BUSPART1
BUSINESSPARTNER2 = BUSPART2
RELATIONSHIPCATEGORY = RELCAT
TABLES
RETURN = lt_return.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
EXPORTING
WAIT = 'X'.
LOOP AT lt_return WHERE TYPE = 'E'.
MESG = ' NOT CREATED NEW CONTACT'(020).
EXIT.
ENDLOOP.
ENDFUNCTION.
Thanks,
BOROHello Chow
I cannot tell you what the problem is but the answer lies in the returned messages of the BAPI.
CALL FUNCTION 'BAPI_BUPR_PFCT_CREATEFROMDATA'
EXPORTING
BUSINESSPARTNER1 = BUSPART1
BUSINESSPARTNER2 = BUSPART2
RELATIONSHIPCATEGORY = RELCAT
TABLES
RETURN = lt_return.
" NOTE: The evalutation of the returned messages should be more sophisticated:
LOOP AT lt_return TRANSPORTING NO FIELDS
WHERE ( type CA 'AEX' ). " abort, error, dump
EXIT.
ENDLOOP.
IF ( syst-subrc = 0 ).
CALL FUNCTION 'BAPI_TRANSACTION_ROLLBACK'.
ELSE.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
ENDIF.
"CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'
"EXPORTING
"WAIT = 'X'.
"LOOP AT lt_return WHERE TYPE = 'E'.
"MESG = ' NOT CREATED NEW CONTACT'(020).
"EXIT.
"ENDLOOP.
ENDFUNCTION.
You must analyze the returned messages in detail. It might be as simple as an authorization problem.
Regards
Uwe -
TopLink JPA join problems.
I need a bit of help here, I hope someone can give me a few pointers...
I've been building out an Object Relational mapping in TopLink using the bean-style interfaces. On one of my objects I have a 1:M relationship to another table, so
One Key in T1 -> >1 Keys in T2.
Pretty simple really. I'm doing it like this:
@JoinTable( name=, etc. etc.)
private Set<ObjectForTable2> variableName.
When I call the getVariableName() method, I get back an IndirectSet (as a set) from the method as expected; however, the size of this set is either 0 or 1.
In Table 2 I have approximately a dozen rows which correspond to the join key, and when I run the query toplink is building in my SQL shell, I get back the dozen rows. When TopLink does it, I only get to see the first row. Is there some other trick I need to use with the set returned? Right now when I call mySet.size() on the Set returned from getVariableName() I get a size of 1 or 0. (I only get 0 if I change the key to one that does not exist in table 2.)
if I use the iterator method, such as
for ( final Iterator i = mySet.iterator(); i.hasNext(); ) {
ObjectForTable2 myObj = (ObjectForTable2)i.next();
System.out.println( myObj.getXXX() );
I still only get one result out. Help! What am I doing wrong here? Do I need to configure something to pull back more than one record from the database?
Also, how does one use the Oracle bugtracker for this open-source product, if I don't have a service contract?
Thanks,
RobbieExactly.
In TopLink (and in JPA in general) you need identify the field, or combination of fields that are used to uniquely identify entities. As Doug mentioned, it is most common that these fields are the PK of the database.
Based on your response above I assume that you had a non unique field mapped as the PK of the enitity. This could cause the trouble you are experiencing. Mapping the pk to a unique field (or combination of fields) will likely solve this problem. -
Portal Service from wsdl testing problem
Hi all,I use Developer Studio to generate sap portal wsdl client,when I finished generating,I want to do test.But it throws the Exception like that
java.lang.IllegalStateException: Not able to initialize Web Service configuration for service TPOStatusService#
com.sapportals.portal.prt.service.soap.mapping.SpecializedRegistry.initSerializersXML(SpecializedRegistry.java:601)
com.sapportals.portal.prt.service.soap.mapping.SpecializedRegistry.initXMLBased(SpecializedRegistry.java:477)
com.sapportals.portal.prt.service.soap.SOAPServiceManager.getSpecializedRegistry(SOAPServiceManager.java:321)
com.sapportals.portal.prt.service.soap.PRTSOAPCall.invokeMethod(PRTSOAPCall.java:181)
com.ilog.pct.tpo.proxy.TPOService.getProblemInfo(TPOService.java:168 at com.ilog.pct.tpo.pages.KpiPage$KpiPageDynPage.doProcessAfterInput(KpiPage.java:48)
I don't know what's the problem.Can anyone help me to solve this problem?
The followings is my wsdl:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://ws.tpo.ilog.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://ws.tpo.ilog.com" xmlns:intf="http://ws.tpo.ilog.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.3
Built on Oct 05, 2005 (05:23:37 EDT)-->
<wsdl:types>
<schema elementFormDefault="qualified" targetNamespace="http://ws.tpo.ilog.com" xmlns="http://www.w3.org/2001/XMLSchema">
<element name="getProblemInfo">
<complexType>
<sequence>
<element name="name" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="getProblemInfoResponse">
<complexType>
<sequence>
<element name="getProblemInfoReturn" type="impl:ProblemInfo"/>
</sequence>
</complexType>
</element>
<simpleType name="ProcessStatus">
<restriction base="xsd:string">
<enumeration value="1"/>
<enumeration value="2"/>
<enumeration value="3"/>
</restriction>
</simpleType>
<complexType name="Vehicle">
<sequence>
<element name="cost" type="xsd:double"/>
<element name="count" type="xsd:int"/>
<element name="fixcost" type="xsd:double"/>
<element name="name" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="ArrayOfVehicle">
<sequence>
<element maxOccurs="unbounded" minOccurs="0" name="item" type="impl:Vehicle"/>
</sequence>
</complexType>
<complexType name="ProblemInfo">
<sequence>
<element name="numbervehicles" type="xsd:int"/>
<element name="numbervisit" type="xsd:int"/>
<element name="processStatus" nillable="true" type="impl:ProcessStatus"/>
<element name="shipvisit" type="xsd:int"/>
<element name="total" type="xsd:double"/>
<element name="vehicle" nillable="true" type="impl:ArrayOfVehicle"/>
</sequence>
</complexType>
<complexType name="SvcException">
<sequence>
<element name="errorMsg" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<element name="fault" type="impl:SvcException"/>
</schema>
</wsdl:types>
<wsdl:message name="getProblemInfoResponse">
<wsdl:part element="impl:getProblemInfoResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="getProblemInfoRequest">
<wsdl:part element="impl:getProblemInfo" name="parameters"/>
</wsdl:message>
<wsdl:message name="SvcException">
<wsdl:part element="impl:fault" name="fault"/>
</wsdl:message>
<wsdl:portType name="TPOProcessSvc">
<wsdl:operation name="getProblemInfo">
<wsdl:input message="impl:getProblemInfoRequest" name="getProblemInfoRequest"/>
<wsdl:output message="impl:getProblemInfoResponse" name="getProblemInfoResponse"/>
<wsdl:fault message="impl:SvcException" name="SvcException"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="TPOProcessSvcSoapBinding" type="impl:TPOProcessSvc">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="getProblemInfo">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="getProblemInfoRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="getProblemInfoResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="SvcException">
<wsdlsoap:fault name="SvcException" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="TPOProcessSvcService">
<wsdl:port binding="impl:TPOProcessSvcSoapBinding" name="TPOProcessSvc">
<wsdlsoap:address location="http://localhost:8080/tpo-web/services/TPOProcessSvc"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>Your installation for SAP JCO is not correct. Download the SAP JCO from service.sap.com and install it on your computer as the installation guide says.
The above error is due to missing file librfc32.dll. If you are using windows operating system. Put the dll files in windows/system32 directory. thank you.
Read the following thread. this should definitely solve your problem.
https://forums.sdn.sap.com/profile.jspa?userID=608260
PS: reward points if this hepls. thank you
Message was edited by: Prakash Singh -
Testing problem with Business Component Browser
I installed Jdeveloper3 and brought up the Bc4j sample (OrderEntry.jws). I went through the overview and then tried to test (right-click and select test) both the application module and the package. The browser comes up, but there are no views or any other objects. It is empty. I went through the tutorial on building Business Components using the emp and dept tables. Same problem when trying to test. The connection works because I created jsp pages using the views and all worked fine.
Hi,
Try resizing the tester window... there is a known issue with the tester wherein sometimes the window does not repaint. Resizing the window solves this problem.
Please let us know if this is not the issue.
Thanks,
Arun -
Hi,
I am a maven newbie, and I have a project with two modules: EjbProject and TestProject.
The error that I have to perform the test is : javax.persistence.PersistenceException: No Persistence provider for EntityManager named testUnit
These are my codes:
persistence.xml into the Test Module
<?xml version="1.0" encoding="UTF8" ?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="testUnit" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jar-file>${project.build.directory}/classes</jar-file>
<properties>
<property name="eclipselink.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
<property name="eclipselink.jdbc.url" value="jdbc:hsqldb:mem:test"/>
<property name="eclipselink.jdbc.user" value="sa"/>
<property name="eclipselink.jdbc.password" value=""/>
<property name="eclipselink.target-database"
value="org.eclipse.persistence.platform.database.HSQLPlatform"/>
<property name="eclipselink.logging.level" value="OFF"/>
<property name="eclipselink.orm.throw.exceptions" value="true"/>
<property name="eclipselink.ddl-generation" value="drop-and-create-tables"/>
<property name="eclipselink.ddl-generation.output-mode" value="database"/>
<property name="hibernate.show_sql" value="${hibernate.show_sql}"/>
</properties>
</persistence-unit>
</persistence>the test:
public class AbstractJPATestCase extends TestCase {
@Before
protected void setUp() throws Exception {
log.debug("setUp");
try {
emf = Persistence.createEntityManagerFactory("testUnit");
//EntityManager em = emf.createEntityManager();
//EntityHolder.setEM(em);
}catch (Exception e) {
e.printStackTrace();
throw e;
}These are the locations:
Test Module: src/test/resources/META-INF/persistence.xml
Anyway, this is the first approximation of the solution, because what I hope to do eventually is to run the test: the file is copied persistence.xml of ejb module to test module, and modify the lines that indicate it is a jta congiruarción a local configuration.
have suggestions
Thanks!
FelipeA little reasoning time.
- you have a META-INF/persistence.xml file
- this persistence.xml file contains a persistence unit 'unitTest'
- yet the code still reports that this persistent unit cannot be found
My conclusion right now is that the file is actually not on the test classpath. Do you perhaps have a conflicting test resources setup in your maven pom? The file must somehow be excluded if it is not found. -
I am trying to test a Flex Application with QTP. I have a Flex compiled application running at the severside.
In my scenario I have a Map (dynamically generated) with has some Nodes. Problem - First: QTP Doesn't recognize it, Second: It doesn't record any action( as per my knowledge If QTP doesn't recognize any Object it takes it as "WinObject" and record action on it, but Here QTP records nothing.
Along with that After Clicking that Node(element) a Flex Canvas Opens up, which also has many Controls like Menu bar Dropdown list, Button etc. but nothing is being recorded or recognized by QTP, except the main Canvas (parent Object).
Any advice is highly appreciated.I too have an issue with the QTP Flex Add-in and the FlexDataGrid...
Apparently the comumnNames property was not implemented for the add-in or isn't working. When I use the GetRoProperty method in conjuction with the comunNames property it always is an empty string.
What's up with that?
Also, you cannot use the GetCellData method either.
Any ideas on a work-around?
Maybe you are looking for
-
I have a slate 500 touch pad and am having trouble with my stylist operating smoothly. It will connect to the screen and will have difficulty disconnecting and at times very difficult for the stylist to initiate the board. HP has sent me two replacem
-
My macbook isn't powering up and makes a beeping noise in time with the sleep light
Hi There I hope someone can help!!! I had disconnected the power cable and left the MacBook in sleep mode with the lid shut. When I now go to open my MacBook up, and wait for my system to resume from where I left off the screen doesn't on and the sle
-
Global error page - compatible with partial page rendering
My global error page doesn't show in some isolated cases. Could this be because of partial page rendering? What changes might be needed to have it work in all cases? I have created a global error page and set it in the web.xml with: <error-page> <exc
-
Is there a way make an iWeb site appear on Google?
With other software I know you need code to do that. I was wondering if iBank had some other way to do it since it doesn't let you add code to websites.
-
Hi Experts, when i try to retrive data from <b>RESB</b> table based on<b> LIFNR</b> it is giving a warning this is the code REPORT Z_RESB. parameters : lifnr1 type lifnr. data : begin of itab occurs 0, rsnum type rsnum, rspos type