Above error was raised when we tried to deploy Web Application to a remote IIS server:
The detailed message was:
I tried to resolve an error as shown in IIS.net, but without any success. I gone through the link and checked all the points mentioned there. Both Web Management Service and Web Deployment Agent Service are running fine. In event log on remote server I don't found also any errors. Strange.
Finally I found verry simple (but why not documented) solution. To fix the problem you should go to IIS management console (on remote machine of course) and select appropriate host:
Next you should select Management Service, as shown above.
In management service form you should check "Enable remote connections" checkbox which is in default unchecked. Next restart IIS instance and voila, Web Deployment works.
Impressions and experiences from Java EE developer. If you are interested in java enterprise development, adf, java server faces, servlets, portlets and so on , this blog may be interesting for you.
Thursday, January 16, 2014
ADF: difference between Create and CreateInsert
Today I met a simple question: what difference exists between Create and CreateInsert operation?
Operation "Create" will create the record but not put it in the VO's recordset whereas operation "CreateInsert" will also create new, empty record and puts it in recordset.
There is a practical effect of described difference. Create Insert should be used to insert new record to af:table, because when you use Create instead, record will be created but not shown in the table. With adf forms you can use Create or CreateInsert.
Operation "Create" will create the record but not put it in the VO's recordset whereas operation "CreateInsert" will also create new, empty record and puts it in recordset.
There is a practical effect of described difference. Create Insert should be used to insert new record to af:table, because when you use Create instead, record will be created but not shown in the table. With adf forms you can use Create or CreateInsert.
Wednesday, November 6, 2013
Oracle SOA: How to Configure Transaction Timeout for BPEL on SOA 11g
During runtime of your BPEL process you may be seeing errors like this:
The solution is typically to increase the transaction timeout for the process.
But how do we could configure transaction timeout for BPEL on SOA 11g?
In the first, before we start changing, we should keep in mind two generall rules:
Let's start from syncMaxWaitTime. This property controls the maximum time the process result receiver will wait for a result before returning for Sync processes.
To change default value you should run Enterprise Manager and go to Farm -> SOA -> "soa-infra" branch and next select from context menu: SOA Administration -> BPEL Properties and expand "More BPEL Configuration Properties...".
Next thing you can change is BPEL EJB's transaction timeout. You can/should update the timeout for following EJB's:
To perform changes you have to run Administration Console, stop SOA server/cluster and next go to Deployments -> soa-infra and expand this position:
For each of cited EJB's you can change default timeout value in Configuration tab (you have to click on selected EJB to view its properties and next select second tab described as Configuration).
To modify Global Transaction Timeout go to Services -> JTA in Administration Console, as shown below:
After applying this change you have to restart Weblogic Domain.
Transaction Rolledback.: weblogic.transaction.internal.TimedOutException: Transaction timed out after 30 seconds BEA1-484455D7A39364D50D1F at weblogic.transaction.internal.ServerTransactionImpl.wakeUp(ServerTransactionImpl.java:1788) at weblogic.transaction.internal.ServerTransactionManagerImpl.processTimedOutTransactions(ServerTransactionManagerImpl.java:1676) at weblogic.transaction.internal.TransactionManagerImpl.wakeUp(TransactionManagerImpl.java:1988) at weblogic.transaction.internal.ServerTransactionManagerImpl.wakeUp(ServerTransactionManagerImpl.java:1586) at weblogic.transaction.internal.WLSTimer.timerExpired(WLSTimer.java:35) at weblogic.timers.internal.TimerImpl.run(TimerImpl.java:273) at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:545) at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256) at weblogic.work.ExecuteThread.run(ExecuteThread.java:221) ; nested exception is: weblogic.transaction.internal.TimedOutException: Transaction timed out after 30 seconds BEA1-484455D7A39364D50D1F
The solution is typically to increase the transaction timeout for the process.
But how do we could configure transaction timeout for BPEL on SOA 11g?
In the first, before we start changing, we should keep in mind two generall rules:
- This solution is ONLY applicable to Sync Processes
- syncMaxWaitTime < BPEL EJB's transaction timeout < Global Transaction Timeout
Let's start from syncMaxWaitTime. This property controls the maximum time the process result receiver will wait for a result before returning for Sync processes.
To change default value you should run Enterprise Manager and go to Farm -> SOA -> "soa-infra" branch and next select from context menu: SOA Administration -> BPEL Properties and expand "More BPEL Configuration Properties...".
Next thing you can change is BPEL EJB's transaction timeout. You can/should update the timeout for following EJB's:
- BPELActivityManagerBean
- BPELDeliveryBean
- BPELDispatcherBean
- BPELEngineBean
- BPELFinderBean
- BPELInstanceManagerBean
- BPELProcessManagerBean
- BPELSensorValuesBean
- BPELServerManagerBean
To perform changes you have to run Administration Console, stop SOA server/cluster and next go to Deployments -> soa-infra and expand this position:
For each of cited EJB's you can change default timeout value in Configuration tab (you have to click on selected EJB to view its properties and next select second tab described as Configuration).
To modify Global Transaction Timeout go to Services -> JTA in Administration Console, as shown below:
After applying this change you have to restart Weblogic Domain.
Tuesday, November 5, 2013
New and usefull services in WebcenterContent 11.1.1.8
In last version of WebcenterContent (UCM) I found two, new, very usefull services. The first of them is COPY_REVISION service.
The COPY_REVISION service copies one document revision, creating a new rev class from it. As says "Services Reference for Oracle WebCenter Content" most of the document metadata from the original revision will be carried over. The caller can also overwrite any metadata value by setting it in the request parameters.
You can use COPY_REVISION service as shown below:
Service returns two ResultSets:
To call this service you should supply only dID of source revision:
As the results the service returns:
The COPY_REVISION service copies one document revision, creating a new rev class from it. As says "Services Reference for Oracle WebCenter Content" most of the document metadata from the original revision will be carried over. The caller can also overwrite any metadata value by setting it in the request parameters.
You can use COPY_REVISION service as shown below:
// Databinder for Creating the clone request
DataBinder dataBinder = idcClient.createBinder();
dataBinder.putLocal("IdcService", "COPY_REVISION");
//Original Content dID and Content Id (dDocname)
dataBinder.putLocal("dID","1001");
dataBinder.putLocal("dDocName","001001");
//clone item Content ID - this is not mandatory - If set to Auto Content ID this need not be added
//dataBinder.putLocal("newdDocName","Cloned_item");
//The user only needs READ permissions to the original document revision.
//However, because the new revision inherits the metadata of the original, new security metadata values
//must be set if the user does not have WRITE permissions to the original revision. By example you can modify group and ACL
dataBinder.putLocal("dSecurityGroup","New_better_group");
dataBinder.putLocal("xClbraUserList","your_user(RW)");
//If the original content is in a Contribution Folder (Folders_g) then below parameter is mandatory - Either blank Collection ID or set a new Folder ID
//In case of Framework Folder this parameter is not needed
dataBinder.putLocal("xCollectionID","1214234324324324");
//Clone Item's Content Title
dataBinder.putLocal("dDocTitle","Title-cloned");
//Any other new / custom metadata for Clone Item
dataBinder.putLocal("Custom","Clone Item Metadata");
Service returns two ResultSets:
- NewDocInfo: Information about the newly created document.
- OriginalDocInfo: Information about the original document that was copied.
To call this service you should supply only dID of source revision:
// Databinder for Creating the restore request
DataBinder dataBinder = idcClient.createBinder();
dataBinder.putLocal("IdcService", "RESTORE_REVISION");
//Original Content dID
dataBinder.putLocal("dID","1001");
As the results the service returns:
- dID: The document ID of the new revision created.
- dDocName: The document name of the new revision created.
- dDocTitle: The document title of the new revision created.
HowTo: How to create JAX_WS WebMethod which returns a complex type, by example java.util.HashMap
In simple words, you can't do this directly. The only way is use of workaround.
But one by one. I decided to write this post after reading a few threads on Oracle's Forum. By example this thread: https://forums.oracle.com/message/7015500. I found also many other posts with issues "what to do when WebMethod returns null value instedad of complex type" - which is a typical symptom when you try to return an unacceptable type.
As says Java EE 6 Tutorial:
"JAX-WS delegates the mapping of Java programming language types to and from XML definitions to JAXB. Application developers don’t need to know the details of these mappings but should be aware that not every class in the Java language can be used as a method parameter or return type in JAX-WS."
next we have a list of Schema-to-Java mappings:
and Java-to-Schema mappings:
If your desired type wasn't listed above, you have to come up with some workaround. For types like lists and maps you can convert those types to array of simple java types. By example:
But one by one. I decided to write this post after reading a few threads on Oracle's Forum. By example this thread: https://forums.oracle.com/message/7015500. I found also many other posts with issues "what to do when WebMethod returns null value instedad of complex type" - which is a typical symptom when you try to return an unacceptable type.
As says Java EE 6 Tutorial:
"JAX-WS delegates the mapping of Java programming language types to and from XML definitions to JAXB. Application developers don’t need to know the details of these mappings but should be aware that not every class in the Java language can be used as a method parameter or return type in JAX-WS."
next we have a list of Schema-to-Java mappings:
| XML Schema Type | Java Data Type |
|---|---|
| xsd:string | java.lang.String |
| xsd:integer | java.math.BigInteger |
| xsd:int | int |
| xsd.long | long |
| xsd:short | short |
| xsd:decimal | java.math.BigDecimal |
| xsd:float | float |
| xsd:double | double |
| xsd:boolean | boolean |
| xsd:byte | byte |
| xsd:QName | javax.xml.namespace.QName |
| xsd:dateTime | javax.xml.datatype.XMLGregorianCalendar |
| xsd:base64Binary | byte[] |
| xsd:hexBinary | byte[] |
| xsd:unsignedInt | long |
| xsd:unsignedShort | int |
| xsd:unsignedByte | short |
| xsd:time | javax.xml.datatype.XMLGregorianCalendar |
| xsd:date | javax.xml.datatype.XMLGregorianCalendar |
| xsd:g | javax.xml.datatype.XMLGregorianCalendar |
| xsd:anySimpleType | java.lang.Object |
| xsd:anySimpleType | java.lang.String |
| xsd:duration | javax.xml.datatype.Duration |
| xsd:NOTATION | javax.xml.namespace.QName |
and Java-to-Schema mappings:
| Java Class | XML Data Type |
|---|---|
| java.lang.String | xs:string |
| java.math.BigInteger | xs:integer |
| java.math.BigDecimal | xs:decimal |
| java.util.Calendar | xs:dateTime |
| java.util.Date | xs:dateTime |
| javax.xml.namespace.QName | xs:QName |
| java.net.URI | xs:string |
| javax.xml.datatype.XMLGregorianCalendar | xs:anySimpleType |
| javax.xml.datatype.Duration | xs:duration |
| java.lang.Object | xs:anyType |
| java.awt.Image | xs:base64Binary |
| javax.activation.DataHandler | xs:base64Binary |
| javax.xml.transform.Source | xs:base64Binary |
| java.util.UUID | xs:string |
If your desired type wasn't listed above, you have to come up with some workaround. For types like lists and maps you can convert those types to array of simple java types. By example:
/**
* We need return Map<String,String> but because we can't do this,
* we would use workaround and return an two-dimensional array of Strings
*/
@WebMethod()
@WebResult(name="MyMethod",targetNamespace="http://my-java-planet.blogspot.com/my-java-planet")
public String[][] MyMethod(
@WebParam(name="Symbol",targetNamespace="http://my-java-planet.blogspot.com/my-java-planet")
String projectSymbol,
@WebParam(name="Year",targetNamespace="http://my-java-planet.blogspot.com/my-java-planet")
String projectYear)
{
try
{
LinkedHashMap<String,String> re = getData(projectSymbol, projectYear);
String ra[][] = new String[re.size()][2];
int i = 0;
for(Map.Entry<String,String> entry : re.entrySet())
{
ra[i][0] = entry.getKey();
ra[i][1] = entry.getValue();
i++;
}
return ra;
}
catch (Exception ex)
{
String methodName=Thread.currentThread().getStackTrace()[1].getMethodName();
logger.severe("Exception "+ex.getMessage()+" in "+methodName );
String re[][] = new String[][]{{"ERROR",ex.getMessage()}};
}
}
Friday, October 18, 2013
Webcenter Content: How to get all Aliases
In Webcenter Content you can create a group of users that can be then referenced by a single name, or ALIAS, in workflows, subscriptions, and projects.
Sometimes you may need to develop a custom user interface to view or manage Aliases. Below you have an example code which I use to load list of Webcenter Content Aliases. What more, you can with this code get users list per each Alias:
Sometimes you may need to develop a custom user interface to view or manage Aliases. Below you have an example code which I use to load list of Webcenter Content Aliases. What more, you can with this code get users list per each Alias:
IdcClient idcClient;
IdcContext userContext;
// ..........
// UcmAlias is my custom object which contains alias metadata
Map<String,UcmAlias> aliases = new LinkedHashMap<String,UcmAlias>();
DataBinder binder = idcClient.createBinder();
binder.putLocal("IdcService", "GET_ALIASES");
ServiceResponse response = idcClient.sendRequest (userContext, binder);
DataBinder serverBinder = response.getResponseAsBinder();
DataResultSet resultSet =
serverBinder.getResultSet("Alias");
for (DataObject dataObject : resultSet.getRows()) {
UcmAlias alias = new UcmAlias();
String nazwa = dataObject.get("dAlias");
alias.setDAlias(nazwa);
alias.setDAliasDescription(dataObject.get("dAliasDescription"));
alias.setDAliasDisplayName(dataObject.get("dAliasDisplayName"));
List<String> users = new ArrayList<String>();
alias.setUsers(users);
aliases.put(nazwa,alias);
}
DataResultSet resultSet1 =
serverBinder.getResultSet("AliasUserMap");
for (DataObject dataObject : resultSet1.getRows()) {
String nazwa = dataObject.get("dAlias");
String user = dataObject.get("dUserName");
aliases.get(nazwa).getUsers().add(user);
}
// here you get list of all aliases in custom map
JSF Tables and dynamic data models
I came today to an interesting thread on one of the forums. The discussion was concerned to "dynamic" data models of JSF data tables. Because this issue focuses in the center of my current interest, I want write a few words on this topic.
Returning to the forum entries, one of participants argued that :
" ... When workig on real application there are a thousands of even a millions rows.
But I have seen several JSF dagatable components.
They implement pagination, sorting and filtering on client side!! According to me this is very silly. This technology is called enterprise and they sort the data on the client side with java script!
I have not seen any good JSF data grid that has build in features for sorting, filtering and lazy loading on the server side.
Why is that? Am I looking in wrong direction or really there in no build support for this. Lately I am testing primefaces and lazy loading datatable. It really works fine, but the table i can only lazy load. If you add sort and filter then the problems begin...
Is there any datatable JSF component than can perform lazy load pagination, and filtering and sorting on server side?"
One of answers was:
No, there isn't. Because the component library cannot know what will be the persistence mechanism.
In my opinion the answer isn't correct. There are implementations of JSF components where problem was solved. One of this is ADF Faces based on Apache Trinidad component set. The second is by example Richfaces with data table component.
But, in fact, in ADF Faces the data model which supports sorting or searching on the server side is a very specific solution. In this sense cited answer is valid. Table component designed as generic solution, without "knowledge" about model and based on JSF standard data model (javax.faces.model.DataModel), can't deal with logic which obviously should work on the model side.
Ok. In conclusion the problem can be solved, but don't exists a one standard solution method. So let's see what solutions are used.
In ADF Faces ADF Table (af:table) component can "consume" model derived from
Very elegant solution is the fact that ordinary DataModels are still supported, and will automatically be wrapped into CollectionModels. However, in this case, the functionality added by CollecionModel isn't anymore supported.
An important feature is support for rowKeys. In the Faces DataModel, rows are identified entirely by index. This causes major problems if the underlying data changes from one request to the next - a user request to delete one row may delete a different row because a row got added by another user, etc. To work around this, CollectionModel is based around unique row keys.
Although Trinidad CollectionModel looks like complete solution, however some functionalities like filtering are solved outside of main model class. The specific properties of ADF BC are used to provide those functions.
Different approach to the problem presents RichFaces. Base class for all models used by
Default implementation of the ExtendedDataModel for the tables when filtering and sorting will be not used is SequenceDataModel. But functionalities like sorting and filtering need the more extensive model. For this purpose RichFaces provides
Class ArrangeableModel contains one universal method
Comparing the two presented approaches, especially when you compare source code, it is easy to see that JBoss approach looks very simple and clean, whereas Oracle's code is at first sight unclear. On the other hand Trinidad CollectionModel is direct implementation of
The purpose of my exercise wasn't comparison of datatable models only for the sake of this article. A problem which I wrote about refers to the situation when we create custom datatable component and we should decide what model of data would be used.
The basic idea was that the designed component will have built-in features for sorting, filtering and lazy loading, all working on the server side. As I wrote, there doesn't exists ready mechanism for these functionalities in base JSF DataModel implementation. Different vendors provide own specific solutions of this problem.
The component based on Datatables plug-in for the jQuery Javascript library has extensive user interface with possibility of sorting, filtering, lazy-loading, in-place editing and so on. The only problem was to design a model that will let easy to implement server-side logic. What more the model should let us consume in easy way the models developed for datatable components from ADF (Trinidad) and RichFaces sets. At the first sight, because of simplicity of solution for server-side filtering we choosed RichFaces approach as our pattern. But then we decided to turn back and start extending
Returning to the forum entries, one of participants argued that :
" ... When workig on real application there are a thousands of even a millions rows.
But I have seen several JSF dagatable components.
They implement pagination, sorting and filtering on client side!! According to me this is very silly. This technology is called enterprise and they sort the data on the client side with java script!
I have not seen any good JSF data grid that has build in features for sorting, filtering and lazy loading on the server side.
Why is that? Am I looking in wrong direction or really there in no build support for this. Lately I am testing primefaces and lazy loading datatable. It really works fine, but the table i can only lazy load. If you add sort and filter then the problems begin...
Is there any datatable JSF component than can perform lazy load pagination, and filtering and sorting on server side?"
One of answers was:
No, there isn't. Because the component library cannot know what will be the persistence mechanism.
In my opinion the answer isn't correct. There are implementations of JSF components where problem was solved. One of this is ADF Faces based on Apache Trinidad component set. The second is by example Richfaces with data table component.
But, in fact, in ADF Faces the data model which supports sorting or searching on the server side is a very specific solution. In this sense cited answer is valid. Table component designed as generic solution, without "knowledge" about model and based on JSF standard data model (javax.faces.model.DataModel), can't deal with logic which obviously should work on the model side.
Ok. In conclusion the problem can be solved, but don't exists a one standard solution method. So let's see what solutions are used.
In ADF Faces ADF Table (af:table) component can "consume" model derived from
org.apache.myfaces.trinidad.model.CollectionModel. The same data model is used by the Trinidad Table and Iterator components. CollectionModel class extends the Faces DataModel (javax.faces.model.DataModel) class and adds on support for rowKeys and sorting. What more construction of CollectionModel class provides possibility to implement simple lazy, incremental loading of data portions.
Very elegant solution is the fact that ordinary DataModels are still supported, and will automatically be wrapped into CollectionModels. However, in this case, the functionality added by CollecionModel isn't anymore supported.
An important feature is support for rowKeys. In the Faces DataModel, rows are identified entirely by index. This causes major problems if the underlying data changes from one request to the next - a user request to delete one row may delete a different row because a row got added by another user, etc. To work around this, CollectionModel is based around unique row keys.
Although Trinidad CollectionModel looks like complete solution, however some functionalities like filtering are solved outside of main model class. The specific properties of ADF BC are used to provide those functions.
Different approach to the problem presents RichFaces. Base class for all models used by
RichFaces is org.ajax4jsf.model.ExtendedDataModel. Just as in Trinidad CollectionModel, ExtendedDataModel introduces rowKeys as an unique identification of rows. ExtendedDataModel introduces also one simple method to "walk" through the data collection. In CollectionModel class isn't so easy to figure out where we should load the data from external datasource, and because of this I like the solution in ExtendedDataModel.
Default implementation of the ExtendedDataModel for the tables when filtering and sorting will be not used is SequenceDataModel. But functionalities like sorting and filtering need the more extensive model. For this purpose RichFaces provides
org.richfaces.model.ArrangeableModel, an implementation of the ExtendedDataModel which implements Arrangeable interface for sorting and filtering support.
Class ArrangeableModel contains one universal method
arrange which can be used in derived classes when implementing sorting and filtering behaviours. The object org.richfaces.model.ArrangeableState passed as a parameter to arrange method contains informations sufficient for implementing own mechanism of sorting or filtering.Comparing the two presented approaches, especially when you compare source code, it is easy to see that JBoss approach looks very simple and clean, whereas Oracle's code is at first sight unclear. On the other hand Trinidad CollectionModel is direct implementation of
javax.faces.model.DataModel without any additional "decoration", and because of this can look some poor. What more af:table component used in combination with ADF Bussiness Components is the best I've ever seen, because of possibility to create fully dynamic data table in seconds and only declaratively.The purpose of my exercise wasn't comparison of datatable models only for the sake of this article. A problem which I wrote about refers to the situation when we create custom datatable component and we should decide what model of data would be used.
The basic idea was that the designed component will have built-in features for sorting, filtering and lazy loading, all working on the server side. As I wrote, there doesn't exists ready mechanism for these functionalities in base JSF DataModel implementation. Different vendors provide own specific solutions of this problem.
The component based on Datatables plug-in for the jQuery Javascript library has extensive user interface with possibility of sorting, filtering, lazy-loading, in-place editing and so on. The only problem was to design a model that will let easy to implement server-side logic. What more the model should let us consume in easy way the models developed for datatable components from ADF (Trinidad) and RichFaces sets. At the first sight, because of simplicity of solution for server-side filtering we choosed RichFaces approach as our pattern. But then we decided to turn back and start extending
javax.faces.model.DataModel in our own way. We also provide possibility to consume in our datatable any object which implementats the Trinidad CollectionModel. This works on-the-fly through the wrapping original model and dynamic conversion of the methods calls.
Subscribe to:
Posts (Atom)






