Adding more fields to a CMP EJB
I'm using Sun's ONE studio 5, Sun ONE AS, and PointBase-db.
I use the CMP EJB wizard to generate the skeleton for a CMP EJB, and specify to use a database-table from PointBase as the CMP-persistant fields.
The problem arises when i want to add futher fields, when i try adding the in the IDE, i cant deploy the application(!)
What am i doing wrong?
Thank you in advance!
Please see response to
http://forum.java.sun.com/thread.jsp?forum=136&thread=444274&start=0&range=15#2191688
vbk
Similar Messages
-
BLOB field in Entity CMP EJB (DB = Oracle)
I use Borland App Server 4.5.1 .
I have table, which has BLOB column.
My first question is:
What datatype should corresponding field in Entity CMP EJB have?
I set it to byte [].
When I deal with BLOB data of small size, everything is OK.
But when the size of BLOB data is few larger,
when I insert new record
an Oracle error happens: a sort of
"TNS adapter error: end of communication chanel"
I use thin jdbc-driver.
So does anybody have an experience in working with BLOB field in Entity CMP EJB (DB = Oracle) ?
may be, the solution is to write BMP fields in Entity EJB,
i.e. to write own methods
set[BLOB_COLUMN](...),
get[BLOB_COLUMN]() ?
Thank you for answers.I have tried with db2 7.1/ IAS 4.0 and it works fine
I use Borland App Server 4.5.1 .
I have table, which has BLOB column.
My first question is:
What datatype should corresponding field in Entity CMP
EJB have?
I set it to byte [].this is perfect
When I deal with BLOB data of small size, everything
is OK.
But when the size of BLOB data is few larger,
when I insert new record
an Oracle error happens: a sort of
"TNS adapter error: end of communication chanel"In db2 there is a max size limit on the blob column. please check if such limit for oracle database.
>
I use thin jdbc-driver.
So does anybody have an experience in working with
BLOB field in Entity CMP EJB (DB = Oracle) ?
may be, the solution is to write BMP fields in Entity
EJB,
i.e. to write own methods
set[BLOB_COLUMN](...),
get[BLOB_COLUMN]() ?this is a good approach
>
Thank you for answers.Regards,
-- Ashish -
I don't know if I should post this question of mine here...but I needed help. Also posted the question in ABAP-General forum. please help
original post:
I need to add more fields like Cost-Center etc to the result list of ME55. What is the best way to do this?
Please advise and thanks much in advance.
When I searched for this question on forum I did come across the question posted earlier but it was not answered. please help.I have the same requirement of wanting to see the accoutn assignment on the report screen instead of drilling into the req. After investigating why the button didn't work I found a note 657090 dated 19.12.2003 the says:
"For displaying the source of supply and account assignment of the purchase requisitions, you should use the transaction ME5A. the button "Sources of supply" and "Account Assignment" will be eliminated from the report ME55 (ALV Grid) after the implementaion of this note"
We are currently implementing ERP 6.0 and the button is still there 6 years later. I would have thought that maybe this anomaly could have been fixed by now or maybe fix the functionality so it does work as obviously there is a requirement to improve the functionality of ME55 as shown in this thread. Will have to dig deeper I guess to understand why it hasn't happened or if it can be done. -
Refresh ALV by adding more fields
Hi,
I have created an ALV , now in display after pressing one button i want to add more fields in existing ALV and by refreshing, i would like to display it.
How can i do that?
Thanks in advance.Hi
>********************************************************************
This report displays User's info (SM04) using the FM : *
REUSE_ALV_LIST_DISPLAY *
The list is auto-refreshed (refresh time : 5 seconds) *
TYPE-POOLS: slis. " ALV Global Types
DATA :
gt_user LIKE uinfo OCCURS 0 WITH HEADER LINE. " User info in SM04
START-OF-SELECTION.
PERFORM f_read_data.
PERFORM f_display_data.
Form F_LIRE_DATA
FORM f_read_data.
REFRESH gt_user.
Get User's info
CALL FUNCTION 'THUSRINFO'
TABLES
usr_tabl = gt_user.
Wait in a task
PERFORM f_call_rfc_wait.
ENDFORM. " F_READ_DATA
Form F_DISPLAY_DATA
FORM f_display_data.
DEFINE m_sort.
add 1 to ls_sort-spos.
ls_sort-fieldname = &1.
append ls_sort to lt_sort.
END-OF-DEFINITION.
DEFINE m_event_exit.
clear ls_event_exit.
ls_event_exit-ucomm = &1.
ls_event_exit-after = 'X'.
append ls_event_exit to lt_event_exit.
END-OF-DEFINITION.
DATA :
ls_layout TYPE slis_layout_alv,
lt_sort TYPE slis_t_sortinfo_alv,
ls_sort TYPE slis_sortinfo_alv,
lt_event_exit TYPE slis_t_event_exit,
ls_event_exit TYPE slis_event_exit.
Build Sort Table
m_sort 'ZEIT'.
Build Event Exit Table
m_event_exit '&NTE'. " Refresh
ls_layout-zebra = 'X'.
ls_layout-colwidth_optimize = 'X'.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
i_callback_program = sy-cprog
i_callback_user_command = 'USER_COMMAND'
is_layout = ls_layout
i_structure_name = 'UINFO'
it_sort = lt_sort
it_event_exit = lt_event_exit
TABLES
t_outtab = gt_user.
ENDFORM. " F_DISPLAY_DATA
FORM USER_COMMAND *
FORM user_command USING i_ucomm TYPE syucomm
is_selfield TYPE slis_selfield. "#EC CALLED
CASE i_ucomm.
WHEN '&NTE'.
PERFORM f_read_data.
is_selfield-refresh = 'X'.
SET USER-COMMAND '&OPT'. " Optimize columns width
ENDCASE.
ENDFORM. " USER_COMMAND
Form F_CALL_RFC_WAIT
FORM f_call_rfc_wait.
DATA lv_mssg(80). "#EC NEEDED
Wait in a task
CALL FUNCTION 'RFC_PING_AND_WAIT' STARTING NEW TASK '001'
PERFORMING f_task_end ON END OF TASK
EXPORTING
seconds = 5 " Refresh time
busy_waiting = space
EXCEPTIONS
RESOURCE_FAILURE = 1
communication_failure = 2 MESSAGE lv_mssg
system_failure = 3 MESSAGE lv_mssg
OTHERS = 4.
ENDFORM. " F_CALL_RFC_WAIT
Form F_TASK_END
FORM f_task_end USING u_taskname.
DATA lv_mssg(80). "#EC NEEDED
Receiving task results
RECEIVE RESULTS FROM FUNCTION 'RFC_PING_AND_WAIT'
EXCEPTIONS
RESOURCE_FAILURE = 1
communication_failure = 2 MESSAGE lv_mssg
system_failure = 3 MESSAGE lv_mssg
OTHERS = 4.
CHECK sy-subrc EQ 0.
SET USER-COMMAND '&NTE'. " Refresh
ENDFORM. " F_TASK_END
END OF PROGRAM Z_ALV_AUTO_REFRESH ******************** -
Hello,
I got a problem trying to add a new field to my form, the user insert the information and
the phone number , but if the user have more than one phone i would like to he click in a button 'Add Phone'
and another field appear in the form , The solution that i was thinking , when user press the button
i send the information of the field to a bean , the bean will generate a new form , now
with the field wich was filled with the phone and a new one empty , the bean return the new form
and the page display the new form i dont know if it�s the best solution and if i will be able to reload the page
to to show the new form.
Does anyone have a better sugest or a code wich i can take a look, or this solution is better?
Thank You
Jeani did the same thing using DOM in javascript
do something like this
var data ="<INPUT type=text name=TestField value=></input>";
var tbody = document.getElementById(id).getElementsByTagName("TBODY")[1];
var row = document.createElement("TR");
var td1 = document.createElement("TD");
td1.appendChild(document.createElement(data));
row.appendChild(td1);
tbody.appendChild(row);
hope this will work... -
Can i add more fields and change colours?/
Hi this is probably a very simple question, with iCal at the moment i have three fields for appointments which are home/work/calendar. I can't find a way of adding more fields or changing the colours. Can it be done???
Yes it can be done in iCal. On the bottom of the screen you will see a + sign. Click on that and a new calendar will show up in your list.
To change calendar names or colors, right click on the checkbox for the desired calendar and a new pop up window will come up. From there you can rename the calendar or change it's color designation. -
Additional field in join table for CMP EJB
Hello,
I'm trying to perform this task using CMP entity beans:
The entity A has a CMR relation of cardinality m-n with entity B (bidirectional) (This is working fine).
I want to add a parameter to the relation.
Ex : When I find that A1 is linked to B1, I need to perform "x" times an action. x would be my parameter, and I would have kept this parameter as an additional column in the join table A_TO_B.
Could anyone provide an example of how to perform this with CMP EJB?
NOTE: I'm using OC4J 10g 9.0.4 standalone (and cannot change my version).
Thanks
TanguyManohar,
You need to create an append structure for table VBAP (for example ZAVBAP) using SE11. In this structure you create your ZZ fields. If you need a non-SAP domain/data element for your field then you need to create it first using the same transaction and activate it. Attach ZAVBAP to VBAP so the SE11 shows:
.APPEND in the Fields column and
ZAVBAP in the Field type column.
Your ZZ fields will be shown automatically.
When you have finished then activate your ZAVBAP structure. You will notice when you go VA01 (for example) that a lot of programs are being recompiled. Don't worry. It will be ok.
The user-exit screen number for items is 8459 (in program SAPMV45A).
Thanks,
Wojtek -
Type-safe enum in CMP EJB field...
Is it possible to use a type-safe enum like this in an EJB CMP field?
I have tried to do that but although the code compiles I get errors.
package dataBeansPkg;
import java.io.Serializable;
import java.io.ObjectStreamException;
import java.util.HashMap;
public final class Estado implements Serializable
private static final String ACTIVODESC = "Activo";
private static final String INACTIVODESC = "Inactivo";
private static final String ELIMINADODESC = "Eliminado";
private static final String BLOQUEADODESC = "Bloqueado";
private static HashMap VALUES = new HashMap();
private final String status;
private final String descripcion;
public static final Estado ACTIVO = new Estado("A", ACTIVODESC);
public static final Estado INACTIVO = new Estado("I", INACTIVODESC);
public static final Estado ELIMINADO = new Estado("E", ELIMINADODESC);
public static final Estado BLOQUEADO = new Estado("B", BLOQUEADODESC);
protected Estado()
this.status = null;
this.descripcion = null;
protected Estado(String estado, String descripcion)
this.status = estado;
this.descripcion = descripcion;
VALUES.put(estado, this);
public String getValor() { return status; }
public String getEstado() { return status; }
public String getDescripcion() { return descripcion; }
public String toString() { return getValor(); }
public final boolean equals(Object o) { return super.equals(o); }
public final int hashCode() { return super.hashCode(); }
public static Estado find(String estado)
if(VALUES.containsKey(estado)) {
return (Estado)VALUES.get(estado);
return null;
public Object readResolve()
Object result = find(status);
if(result != null)
return result;
else
return INACTIVO; // valor por omision
Whenever I run a client using the bean with a field associated to this enum, I get...
java.io.StreamCorruptedException: Caught EOFException while reading the stream header
and
Error loading state: java.io.StreamCorruptedException: Caught EOFException while reading the stream header
Is it possible to use a type-safe enum as a field in an CMP bean?Yep... I think that's what I found. By using public methods in my enum class to map it's string member to the EJB field I was able to effectively use my enum in the EJB. The container does it work with a String but the EJB's clients only deal with a enum field. That's what I originally intended so, thanks for your response.
-
Adding one more field to the VL06O report
Hi everybody
When u execute the TR code VL06O a screen will appear from that screen select list outbound deliveries and then provide some date and execute.
The output will come having fields delivery,ship-to-party,name of ship-to-party like that 7 fields are there and now i want to see one more field called shipment number in the output along with the previuos 7 fields.
what should i do it is a standard program?
please guide me?Hello.
See note 128150 to more details.
There are user exists to add new fields (user fields).
Regards. -
Defining a many-to-many relationship with CMP EJBs : does it work for you
Curious to know whether someone has been able to set up a many to many relationship between two entity beans.
I have been struggling with this for days now and I can't get it to work.
In my test project I have two entity beans, resp. Consultant and Solution.
Consultant has a cmr field called 'solutions', which is a collection object from the opposite side (Solution).
This is the source of the ejb-jar.xml file
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
<ejb-jar>
<description>EJB JAR description</description>
<display-name>EJB JAR</display-name>
<enterprise-beans>
<session>
<ejb-name>ProfilerBean</ejb-name>
<home>com.atosorigin.tcc.testing.ejbses.profiling.ProfilerHome</home>
<remote>com.atosorigin.tcc.testing.ejbses.profiling.Profiler</remote>
<local-home>com.atosorigin.tcc.testing.ejbses.profiling.ProfilerLocalHome</local-home>
<local>com.atosorigin.tcc.testing.ejbses.profiling.ProfilerLocal</local>
<ejb-class>com.atosorigin.tcc.testing.ejbses.profiling.ProfilerBean</ejb-class>
<session-type>Stateless</session-type>
<transaction-type>Container</transaction-type>
<ejb-local-ref>
<ejb-ref-name>EJBTesting/Solution</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.atosorigin.tcc.testing.ejbcmp.profiling.SolutionLocalHome</local-home>
<local>com.atosorigin.tcc.testing.ejbcmp.profiling.SolutionLocal</local>
<ejb-link>SolutionBean</ejb-link>
</ejb-local-ref>
<ejb-local-ref>
<ejb-ref-name>EJBTesting/Consultant</ejb-ref-name>
<ejb-ref-type>Entity</ejb-ref-type>
<local-home>com.atosorigin.tcc.testing.ejbcmp.profiling.ConsultantLocalHome</local-home>
<local>com.atosorigin.tcc.testing.ejbcmp.profiling.ConsultantLocal</local>
<ejb-link>ConsultantBean</ejb-link>
</ejb-local-ref>
</session>
<entity>
<ejb-name>ConsultantBean</ejb-name>
<home>com.atosorigin.tcc.testing.ejbcmp.profiling.ConsultantHome</home>
<remote>com.atosorigin.tcc.testing.ejbcmp.profiling.Consultant</remote>
<local-home>com.atosorigin.tcc.testing.ejbcmp.profiling.ConsultantLocalHome</local-home>
<local>com.atosorigin.tcc.testing.ejbcmp.profiling.ConsultantLocal</local>
<ejb-class>com.atosorigin.tcc.testing.ejbcmp.profiling.ConsultantBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>Consultant</abstract-schema-name>
<cmp-field>
<field-name>firstname</field-name>
</cmp-field>
<cmp-field>
<field-name>lastname</field-name>
</cmp-field>
<cmp-field>
<field-name>country</field-name>
</cmp-field>
<cmp-field>
<field-name>id</field-name>
</cmp-field>
<primkey-field>id</primkey-field>
<query>
<query-method>
<method-name>findBySolution</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql>SELECT Object(c) FROM Consultant AS c,
IN(c.solutions) s WHERE s.id = ?1 </ejb-ql>
</query>
</entity>
<entity>
<ejb-name>SolutionBean</ejb-name>
<home>com.atosorigin.tcc.testing.ejbcmp.profiling.SolutionHome</home>
<remote>com.atosorigin.tcc.testing.ejbcmp.profiling.Solution</remote>
<local-home>com.atosorigin.tcc.testing.ejbcmp.profiling.SolutionLocalHome</local-home>
<local>com.atosorigin.tcc.testing.ejbcmp.profiling.SolutionLocal</local>
<ejb-class>com.atosorigin.tcc.testing.ejbcmp.profiling.SolutionBean</ejb-class>
<persistence-type>Container</persistence-type>
<prim-key-class>java.lang.String</prim-key-class>
<reentrant>False</reentrant>
<cmp-version>2.x</cmp-version>
<abstract-schema-name>Solution</abstract-schema-name>
<cmp-field>
<field-name>description</field-name>
</cmp-field>
<cmp-field>
<field-name>name</field-name>
</cmp-field>
<cmp-field>
<field-name>parent</field-name>
</cmp-field>
<cmp-field>
<field-name>id</field-name>
</cmp-field>
<primkey-field>id</primkey-field>
<query>
<query-method>
<method-name>findChildSolutions</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
</query-method>
<ejb-ql>SELECT Object(s) FROM Solution AS s WHERE
s.parent = ?1</ejb-ql>
</query>
<query>
<query-method>
<method-name>findTopLevelSolutions</method-name>
<method-params/>
</query-method>
<ejb-ql>Select Object(s) FROM Solution AS s WHERE
(s.parent = 'none')</ejb-ql>
</query>
</entity>
</enterprise-beans>
<relationships>
<ejb-relation>
<description>A consultant may have one or more areas of expertise</description>
<ejb-relation-name>Consultant_Solutions</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>com.atosorigin.tcc.testing.ejbcmp.profiling.ConsultantBean</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source>
<ejb-name>ConsultantBean</ejb-name>
</relationship-role-source>
<cmr-field>
<cmr-field-name>solutions</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>com.atosorigin.tcc.testing.ejbcmp.profiling.SolutionBean</ejb-relationship-role-name>
<multiplicity>Many</multiplicity>
<relationship-role-source>
<ejb-name>SolutionBean</ejb-name>
</relationship-role-source>
</ejb-relationship-role>
</ejb-relation>
</relationships>
<assembly-descriptor>
<container-transaction>
<description>container-transaction</description>
<method>
<ejb-name>SolutionBean</ejb-name>
<method-name>*</method-name>
</method>
<method>
<ejb-name>ProfilerBean</ejb-name>
<method-name>*</method-name>
</method>
<method>
<ejb-name>ConsultantBean</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
</ejb-jar>
I created a stateless session bean as a business facade for the two entity beans. I then created a webservice to test the beans.
What works :
- create a consultant
- get a consultant
- create a solution
- get a solution
(basically everything that doesn't involve the relationship field.
However, what doesn't work is the method call assignSolution:
- assign solution : this is implemented as follows
Business Method.
public void assignSolution(String consultantID, String solutionID)
throws ProfilingException {
// TODO : Implement
ConsultantLocal cons = null;
SolutionLocal sol = null;
try {
cons = consHome.findByPrimaryKey(consultantID);
sol = solHome.findByPrimaryKey(solutionID);
Collection solutions = cons.getSolutions();
solutions.add(sol);
//sol.getConsultants().add(cons);
} catch (FinderException ex) {
ex.printStackTrace();
throw new ProfilingException("failed to retrieve data from DB", ex);
As you can see I am trying to use the CM Relationship in this methhod. Adding the solution to a consultant should be as simple as adding a solution object to the collection retrieved with the getSolutions accessor. The Container is expected to persist the information in my MAXDB database.
However this doesn't happen.
The ORM details as defined in the persistent.xml follows :
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE persistent-ejb-map SYSTEM "persistent.dtd">
<persistent-ejb-map>
<locking
type="Table"/>
<db-properties>
<data-source-name>TCC_PORTAL_PROFILER</data-source-name>
<database-vendor
name="SAPDB"/>
</db-properties>
<entity-beans>
<entity-bean>
<ejb-name>ConsultantBean</ejb-name>
<table-name>PFL_CONSULTANTS</table-name>
<field-map
key-type="NoKey">
<field-name>firstname</field-name>
<column>
<column-name>FIRSTNAME</column-name>
</column>
</field-map>
<field-map
key-type="NoKey">
<field-name>lastname</field-name>
<column>
<column-name>LASTNAME</column-name>
</column>
</field-map>
<field-map
key-type="NoKey">
<field-name>country</field-name>
<column>
<column-name>COUNTRY</column-name>
</column>
</field-map>
<field-map
key-type="PrimaryKey">
<field-name>id</field-name>
<column>
<column-name>ID</column-name>
</column>
</field-map>
<finder-descriptor>
<method-name>findBySolution</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
<load-selected-objects
lock="read"/>
</finder-descriptor>
</entity-bean>
<entity-bean>
<ejb-name>SolutionBean</ejb-name>
<table-name>PFL_SAPSOLUTIONS</table-name>
<field-map
key-type="NoKey">
<field-name>description</field-name>
<column>
<column-name>DESCRIPTION</column-name>
</column>
</field-map>
<field-map
key-type="NoKey">
<field-name>name</field-name>
<column>
<column-name>NAME</column-name>
</column>
</field-map>
<field-map
key-type="NoKey">
<field-name>parent</field-name>
<column>
<column-name>PARENTID</column-name>
</column>
</field-map>
<field-map
key-type="PrimaryKey">
<field-name>id</field-name>
<column>
<column-name>ID</column-name>
</column>
</field-map>
<finder-descriptor>
<method-name>findChildSolutions</method-name>
<method-params>
<method-param>java.lang.String</method-param>
</method-params>
<load-selected-objects
lock="read"/>
</finder-descriptor>
<finder-descriptor>
<method-name>findTopLevelSolutions</method-name>
<method-params/>
<load-selected-objects
lock="read"/>
</finder-descriptor>
</entity-bean>
</entity-beans>
<relationships>
<table-relation>
<help-table>PFL_CONS_SOL_MAP</help-table>
<table-relationship-role
key-type="PrimaryKey">
<ejb-name>ConsultantBean</ejb-name>
<cmr-field>solutions</cmr-field>
<fk-column>
<column-name>CONSULTANTID</column-name>
<pk-field-name>id</pk-field-name>
</fk-column>
</table-relationship-role>
<table-relationship-role
key-type="PrimaryKey">
<ejb-name>SolutionBean</ejb-name>
<fk-column>
<column-name>SOLUTIONID</column-name>
<pk-field-name>id</pk-field-name>
</fk-column>
</table-relationship-role>
</table-relation>
</relationships>
</persistent-ejb-map>
The error in the default trace file when calling the method states, there is an "inconsistency in the number of primary keys". Details follow.
#1.5#000F1F188E5C004400000000000010480003E76C80EFD57A#1098880364327#com.sap.engine.services.ejb#com.atosorigin.tcc/EJBCMPProfilingTest#com.sap.engine.services.ejb#Guest#2####4d2b2370281411d9a40d000f1f188e5c#SAPEngine_Application_Thread[impl:3]_31##0#0#Error##Java###
[EXCEPTION]
#1#com.sap.engine.services.ejb.exceptions.BaseRemoteException: Exception in method assignSolution.
at com.atosorigin.tcc.testing.ejbses.profiling.ProfilerObjectImpl0.assignSolution(ProfilerObjectImpl0.java:822)
at com.atosorigin.tcc.testing.ejbses.profiling.Profiler_Stub.assignSolution(Profiler_Stub.java:533)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sap.engine.services.ejb.session.stateless_sp5.ObjectStubProxyImpl.invoke(ObjectStubProxyImpl.java:187)
at $Proxy73.assignSolution(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sap.engine.services.webservices.runtime.EJBImplementationContainer.invokeMethod(EJBImplementationContainer.java:126)
at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:146)
at com.sap.engine.services.webservices.runtime.RuntimeProcessor.process(RuntimeProcessor.java:68)
at com.sap.engine.services.webservices.runtime.servlet.ServletDispatcherImpl.doPost(ServletDispatcherImpl.java:92)
at SoapServlet.doPost(SoapServlet.java:51)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:385)
at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:263)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:339)
at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:317)
at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:810)
at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:238)
at com.sap.engine.services.httpserver.server.Client.handle(Client.java:92)
at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:147)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:37)
at com.sap.engine.core.cluster.impl6.session.UnorderedChannel$MessageRunner.run(UnorderedChannel.java:71)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:94)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:162)
Caused by: com.sap.engine.services.applocking.exception.SAPAppLockingIllegalArgumentException: Inconsistency in number of primary keys
at com.sap.engine.services.applocking.TableLockingImpl.getArgument(TableLockingImpl.java:385)
at com.sap.engine.services.applocking.TableLockingImpl.lock(TableLockingImpl.java:128)
at com.sap.engine.services.applocking.TableLockingImpl.lock(TableLockingImpl.java:138)
at com.sap.engine.services.ejb.entity.pm.lock.TableLockingSystem.write(TableLockingSystem.java:82)
at com.sap.engine.services.ejb.entity.pm.PersistentM2M.create(PersistentM2M.java:172)
at com.sap.engine.services.ejb.entity.pm.PersistentCacheM2M.add(PersistentCacheM2M.java:197)
at com.sap.engine.services.ejb.entity.pm.multiple.CollectionM2M.add(CollectionM2M.java:57)
at com.atosorigin.tcc.testing.ejbses.profiling.ProfilerBean.assignSolution(ProfilerBean.java:201)
at com.atosorigin.tcc.testing.ejbses.profiling.ProfilerObjectImpl0.assignSolution(ProfilerObjectImpl0.java:771)
... 32 more
I can't figure out what the problem is with the ORM mapping defined.
On the database level I have three tables. Consultant maps to PFL_CONSULTANT, Solution to PFL_SAPSOLUTIONS. The third table PFL_CONS_SOL_MAP is the help table used for the relationship (having two fields, which are in fact foreign keys from the other two tables to express the assignment of solutions to consultants (where a consultant can have one or more solutions).
ps. : I am running Netweaver Developer Workplace (Netweaver 2004, at stack level 5)
Message was edited by: Theo PaesenHm, after disabling 'automatic locking' it works.
-
Running CMP EJB in remote OC4J fails, works in embedded. Oracle 9i
I more or less followed the EJB Tutorial (in the help) for creating a session-entity bean facade from Oracle 9i tables. Everything executes correctly in the embedded oc4j but it fails on the remote oc4j with
java.sql.SQLException: Invalid column name
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:187)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:229)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:292)
at oracle.jdbc.driver.OracleStatement.get_column_index(OracleStatement.java:5632)
at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:716)
at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1506)
at com.evermind.sql.FilterResultSet.getString(FilterResultSet.java:585)
at EmployeeLocalHome_EntityHomeWrapper13.findAll(EmployeeLocalHome_EntityHomeWrapper13.java:1260)
Then I also created another simpler CMP EJB that just has 3 fields from Oracle table. This one doesn't even work in embedded oc4j :
com.evermind.server.rmi.OrionRemoteException: Database error: ORA-01747: invalid user.table.column, table.column, or column specification
java.util.Collection TimesheetHoursHome_EntityHomeWrapper11.findAll()
Are there any known problems I should look out for with generating CMP EJBS with wizards?
I think the IDE is more intuitive than WSAD. It would be great it things worked though.
Another question is regarding relationships. Do the wizards always use ejb-refs to implement relationships? It should be easy enough to add them with EJB Editor if they do not.
Thanks for any help.Known issues are documented in the release notes
http://otn.oracle.com/products/jdev/htdocs/readme_903Preview.html#ejb
<<<Another question is regarding relationships. Do the wizards always use ejb-refs to implement relationships? >>>>
Not sure what you meant here. If you reverse engineer let us say DEPT and EMP tables, foreign key relationships between the tables are reverse engineered as CMR but there aren't any ejb-ref/ejb-local-ref tags which get generated in the deployment descriptor.
<<It should be easy enough to add them with EJB Editor if they do not. >>
You can double-click on the EJB to bring the EJB Module Editor and select "Relationships" node to add/edit/delete relationships visually.
raghu
JDev Team -
Using a CMP Entity Bean local stub as a field of another CMP Entity Bean
Hello,
Is it possible to implement a field of a CMP Entity bean as another CMP Entity bean and how is it done?
I've seen a pseudo code for this in Ed Roman's Mastering EJBs, second edition, but I can't seem to get it to work (pages: 330 - 1:1 using CMP and 339 - fake M:N using CMP).
I'm using SUN ONE Application Sever 7. Is this server capable of this?
I'm trying to implement a fake M:N relationship using 3 beans: 2 for each side of the relationship and one as the "bridge" table.
For example, the two beans on each side of the relationship are SubscriberBean, SubscriptionBean and the "bridge: bean is SubscriberSubscriptionBean. The SubscriberSubscriptionBean has two fields: SubscriberLocal stub and SubscriptionLocal stub.
Please let me know if you need more information to answer this question.
Thanks.
NikolaIm sorry but i dont know about the example you are talking about. I kinda learn
all those techniques from forums, articles and tutorials because book often suffer from
not having the information im mostly looking for.
As far as i understand you, you want to implement a bridge been, which is representing a row in a join table. So that if one side of the relation is deleted the join-table entry (your bridge-CMP-Bean) is cascaded. Right?
First of all the simple part: (My approach)
- The joint table is foreign keys only - without a relation description. -
In this case you dont have to implement a bridge bean. Because it just wouldnt represent anything of sense.
Lets think of an entity/table USER whith the columns name (PRIMARY KEY), and prename.
Our second entity/table is ADDRESS with the columns road (PRIMARY KEY) and housenr.
The join table is simply: USER_ADDRESS with fk_name (FOREIGN KEY) and fk_road (FOREIGN KEY) both on CASCADE DELETE. So if the address is deleted the mapping entry is deleted, too same for the user part:
USER -> USER_ADDRESS <- ADDRESS.
Our entity Beans are called User and Address in class-names JNDI-names and names.
Now we want to create the CMR mapping so we can access the addresses of a user from the user bean directly. The methods on the user side are:
public abstract Collection getAddresses();
and
public abstract void setAddresses(Collection new_addresses);
the xdoclet comments on the User side are (for the getter only)
* @ejb.interface-method
* @ejb.relation
* name = "User-has-Addresses"
* role-name = "User-Addresses"
* target-ejb = "Address"
* target-multiple = "true"
* @sunone.relation
* column="USER_ADDRESS.fk_name"
* target="USER_ADDRESS.fk_road"
public abstract Collection getAddresses();
for the other side of the relation we define in the Address-Entity
public abstract Collection getUsers();
and
public void setUsers(Collection users);
the xdoclet comments on the Address side are (for the getter only)
* @ejb.interface-method
* @ejb.relation
* name = "User-has-Addresses"
* role-name = "Address-User"
* target-ejb = "User"
* target-multiple = "true"
* @sunone.relation
* target="USER_ADDRESS.fk_road"
* column="USER_ADDRESS.fk_name"
As we dont want the user or address to be deleted if the other side of the relation is deleted we dont specify cascade-delete="yes" in the ejb.relation namespace.
The sun-cmp-mappings.xml should now look like this:
(For the User - side)
<!-- Relationship User-has-Addresses, role User-Addresses -->
<cmr-field-mapping>
<cmr-field-name>addresses</cmr-field-name>
<column-pair>
<column-name>USER_ADDRESS.fk_name</column-name>
<column-name>USER_ADDRESS.fk_road</column-name>
</column-pair>
</cmr-field-mapping>
and similar on the Address-Side:
<cmr-field-mapping>
<cmr-field-name>users</cmr-field-name>
<column-pair>
<column-name>USER_ADDRESS.fk_road</column-name>
<column-name>USER_ADDRESS.fk_name>/column-name>
</column-pair>
</cmr-field-mapping>
Dont forget that all elements in the Collection must be of the right Interface-type.
First of all the harder part:
Now what you might want is when the relation has some information specified like user live at address and is tenant or facility manager.
The, in the first step you will have to implement the UserAddressRelation entity which will have to CMR fields of the 1:N type.(Just as you wish)
Lets think of the example above extended by the relation type. Our relation bean is named UserAddressRelation.
Now User has the methods as above but the classes in the Collection must now be of the UserAddressRelationLocal/Remote interface and not AddressLocal/Remote-interface.
You will have to change the xdoclet comment to:
* @ejb.interface-method
* @ejb.relation
* name = "User-has-Addresses"
* role-name = "User-Address"
* target-ejb = "UserAddressRelation"
* target-multiple = "true"
* @sunone.relation
* target="USER_ADDRESS.fk_name"
* column="USER.name"
So we now dont reference the other side bean directly. We reference the relation EntityBean. Do the similar changes on the other side.
In particular you will have to specify 4 CMR mappings now:
1. User to UserAddressRelation 1:N
2. UserAddressRelation N:1
3. Address to UserAddressRelation 1:N
4. UserAddressRelation N:1
Which i dont want to explain in detail now because its kinda all the same as above.
Now you cann access the Addresses of a user in the way.
UserLocal.getAddresses(); <- !you get the mappings!
UserLocal.getAddresses().item(0).getAddress() <- you get the address (this is dirty coding just for understanding)
UserLocal.getAddresses().item(0).getUserRole() <. you get the role of the user at this address.
Hope this helped you. You are welcome to ask any detailed question. -
I have a SharePoint 2010 site with two discussion boards. I added one additional field to each of the boards: a lookup to another list to link the discussions to individual projects. I need 2 different boards because they have different posting permissions
(one is open to all for comments, and one is open only to the project team to post but everyone can read).
When I go to the pages for each of the discussion boards, they work fine.
But I'm putting together a page for individual projects, and want to have web parts for both discussion boards on the same page, showing the discussions related to the selected project.
I am able to add one of the discussion boards to a web part in the page, but when I add the second discussion board to the page, the new web part contains:
One or more field types are not installed properly. Go to the list settings page to delete these fields.
Correlation ID: blah blah blah
I've searched for similar postings, but mostly I see this error message related to migration from 2007 to 2010 -- this is not the case here: I created both discussion boards, and the whole site, in SP 2010. I've also found this message related
to coding errors using SPQuery. I am not doing any coding here, just using the built-in SharePoint 2010 Edit Page -> add a web part -> select the discussion list. I tried doing it from SPD with the same result. I figured it out. I was using ?FilterField1=fieldname&FilterValue1=value on the URL to the page to pick out one project number. The web part I was trying to add was for a list that did not have that particular fieldname. I didn't realize that would matter
since I was using the Connections -> Get Filter Values From to get my filter values from the main web part, which does have that fieldname.
I added a field with that fieldname to the other list and set a workflow to copy the lookup value of the project number lookup field into the new field. Now all is working fine. Sorry for the wild geese in my original question. -
Hi Team,
I have created Administrator -approved Infopath form template to my site and activated same template in CA.
I have used this template in one of my Form library and i can able to submit the Form with success to the library.
when i click "View Item" or "Edit Item" of the form it throws , "One or more field types are not installed properly. Go to the list settings page to delete these fields." error message.
I have refered my log files also but there is no useful information in that, please find my logs for your reference.
w3wp.exe (0x2D7C)
0x3790
SharePoint Foundation
Logging Correlation Data
xmnv
Medium
Site=/sites/Prototypes
w3wp.exe (0x2D7C)
0x3790
SharePoint Foundation
Monitoring
b4ly
High
Leaving Monitored Scope (PostResolveRequestCacheHandler). Execution Time=8.51588679566816
w3wp.exe (0x2D7C)
0x3790
SharePoint Foundation
General
8kh7
High
One or more field types are not installed properly. Go to the list settings page to delete these fields.
w3wp.exe (0x2D7C)
0x3790
SharePoint Foundation
General
8sl1
High
DelegateControl: Exception thrown while adding control 'ASP._controltemplates_publishingconsole_ascx': One or more field types are not installed properly. Go to the list settings page to delete these fields.
w3wp.exe (0x2D7C)
0x3790
SharePoint Foundation
General
8kh7
High
One or more field types are not installed properly. Go to the list settings page to delete these fields.
w3wp.exe (0x2D7C)
0x3790
SharePoint Foundation
Runtime
tkau
Unexpected
System.Runtime.InteropServices.COMException: One or more field types are not installed properly. Go to the list settings page to delete these fields.
at Microsoft.SharePoint.Library.SPRequestInternalClass.GetListItemDataWithCallback2(IListItemSqlClient pSqlClient, String bstrUrl, String bstrListName, String bstrViewName, String bstrViewXml, SAFEARRAYFLAGS fSafeArrayFlags, ISP2DSafeArrayWriter pSACallback,
ISPDataCallback pPagingCallback, ISPDataCallback pPagingPrevCallback, ISPDataCallback pFilterLinkCallback, ISPDataCallback pSchemaCallback, ISPDataCallback pRowCountCallback, Boolean& pbMaximalView)
at Microsoft.SharePoint.Library.SPRequest.GetListItemDataWithCallback2(IListItemSqlClient pSqlClient, String bstrUrl, String bstrListName, String bstrViewName, String bstrViewXml, SAFEA...
w3wp.exe (0x2D7C)
0x3790
SharePoint Foundation
Runtime
tkau
Unexpected
...RRAYFLAGS fSafeArrayFlags, ISP2DSafeArrayWriter pSACallback, ISPDataCallback pPagingCallback, ISPDataCallback pPagingPrevCallback, ISPDataCallback pFilterLinkCallback, ISPDataCallback pSchemaCallback, ISPDataCallback pRowCountCallback, Boolean& pbMaximalView)
w3wp.exe (0x2D7C)
0x3790
SharePoint Foundation
Monitoring
b4ly
Medium
Leaving Monitored Scope (Request (GET:http://test-sharepoint:80/sites/Prototypes/TRT/TRTLibrary/Forms/EditForm.aspx?ID=47&Source=http%3A%2F%2Ftest%2Dsharepoint%2Fsites%2FPrototypes%2FTRT%2FTRTLibrary%2FForms%2FAllItems%2Easpx&RootFolder=%2Fsites%2FPrototypes%2FTRT%2FTRTLibrary&ContentTypeId=0x01010100E7EE25E5A6898C4587A6B52C808EF03300FD54861D587A7E43BA3E2E6D392A3526&IsDlg=1)).
Execution Time=32.443369199158
w3wp.exe (0x08E4)
0x2C58
Access Services
Data Layer
8jg2
Medium
ResourceManager.PerformCleanup: Disk Manager: CurrentSize=0.
w3wp.exe (0x08E4)
0x2C58
Access Services
Data Layer
5pbr
Medium
ResourceManager.EvictUnusedItems: Disk Manager: Going to evict unused items. CurrentSize: 0.
w3wp.exe (0x08E4)
0x2C58
Access Services
Data Layer
5pbs
Medium
ResourceManager.EvictUnusedItems: Disk Manager: After unused items eviction. CurrentSize: 0
Diff:0.
w3wp.exe (0x2D7C)
0x0774
SharePoint Foundation
Topology
e5mc
Medium
WcfSendRequest: RemoteAddress: 'http://test-sharepoint:32843/4ac2daef5ffe4850be08bd7bbebb5ac2/MetadataWebService.svc' Channel: 'Microsoft.SharePoint.Taxonomy.IMetadataWebServiceApplication' Action: 'http://schemas.microsoft.com/sharepoint/taxonomy/soap/IDataAccessReadOnly/GetChanges'
MessageId: 'urn:uuid:dcba94c3-2764-428c-b44f-60e703328ceb'
w3wp.exe (0x08E4)
0x2E24
SharePoint Foundation
Topology
e5mb
Medium
WcfReceiveRequest: LocalAddress: 'http://test-sharepoint.anca.com.au:32843/4ac2daef5ffe4850be08bd7bbebb5ac2/MetadataWebService.svc' Channel: 'System.ServiceModel.Channels.ServiceChannel' Action: 'http://schemas.microsoft.com/sharepoint/taxonomy/soap/IDataAccessReadOnly/GetChanges'
MessageId: 'urn:uuid:dcba94c3-2764-428c-b44f-60e703328ceb'
JeevaHello,
Is there any other content type on library or check if there is any duplicate column? Could you please also show us your library columns detail? (pic is also fine of lib settings page)
If you have any ""Property Promotion" column then SP create those columns as site column and associate them with this template so check "Allow management of content types" for that form library as well.
Hemendra:Yesterday is just a memory,Tomorrow we may never see
Please remember to mark the replies as answers if they help and unmark them if they provide no help -
Added new field to ALV but not displaying the ouput
Hi guys,
I'm adding one more column to be displayed on an old existing program that uses REUSE_ALV_FIELDCATALOG_MERGE to generate the ALV fieldcat.
DATA : BEGIN OF itab OCCURS 0,
matnr LIKE eina-matnr,
extwg LIKE mara-extw,
matkl LIKE mara-matkl,
mtart LIKE mara-mtart,
maktx LIKE makt-maktx,
lifnr LIKE eina-lifnr,
wglif LIKE eina-wglif,
<span style="color:red">idnlf like eina-idnlf, " <----
new field</span>
name1 LIKE lfa1-name1,
profl LIKE mara-profl,
END OF itab.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = sy-cprog
i_internal_tabname = 'ITAB'
i_client_never_display = ''
i_inclname = sy-cprog
i_bypassing_buffer = 'X'
CHANGING
ct_fieldcat = t_cat
EXCEPTIONS
inconsistent_interface = 1
program_error = 2
OTHERS = 3.
I've added in a new field inside the ITAB internal table, but it wouldn't appear in the t_cat, only all the old fields will appear. What have i done wrong?Hi
Facing similar kind of issue.. added one field to the existing internal table. This is not getting populted by the field catalog merge FM. Tried with the suggested solution also of running programs BALVBUFDEL,
BCALV_BUFFER_DEL_SHARED then logging off and logging in..
But the newly added field is not getting populated. Any suggestions would be of great help.
Regards,
sridevi S
Maybe you are looking for
-
HT4527 How do I get my old iTunes account on my new phone?
I need to set up my old iTunes account on my phone?
-
How do I exit edit form mode in Acrobat 7?
I haven't used the program for a while and I can't remember how. I thought it was a quick button somewhere, but I'm just not seeing it... I feel like a dunce...
-
I am having trouble with one of my games crashing for a while now, and was asked by the technical support to uninstall my sound drivers and reinstall them. However, looking in Programs and Features, there is currently no way to do this. Only Creative
-
Switching images used as a symbol late in development
Does anyone know a way to switch the image you are using as a symbol later in the development stage? Lets say you edit an image in Fireworks, then convert it to a symbol, then copy and paste it into Flash and use it throughout the movie. Is there a w
-
Hola a todo/as. Me gustaria saber las combianaciones de teclado cundo dice los siguiente. 1.Forzar la salida (Opción - Comando-Escape) 2. Reiniciar (Control-comando-Encendido) 3. Forzar el cierre (pulsar el boton de encendido durante 10 segundos) me