[Beginner's Corner] - Web Service
by Mike Caputo
Mike Caputo [https://community.jboss.org/people/eequalsmcaputo] created the discussion
"Web Service"
To view the discussion, visit: https://community.jboss.org/message/745173#745173
--------------------------------------------------------------
Hello all,
I'm new to JBoss and to Java (a few months). My background is in .NET / SQL Server, and this stuff is a lot easier there.
So, what I'm trying to do is create a web service that does the following:
1) Allow the (mobile) user to upload an image
2) Store that image in a database
3) Respond to the user with a success message
4) Send notifications out to the user's friends
I've looked all over the place, and there's lots of documentation, but I'm getting a little overwhelmed. I know I need to create a service with a POST method, and have it reply with an HttpResponse. I just can't seem to figure out the best way to do that - I keep running into walls of assumed knowledge that I don't have. I can handle the database part of it, and the notifications can come later. So I'm really hoping someone can point me to a step-by-step that includes instructions on creating a basic service with a POST method and hopefully some instruction on building the response object.
Thanks, and I look forward to learning JBoss!
Mike
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/745173#745173]
Start a new discussion in Beginner's Corner at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[JBoss Web Services] - Deploying Native to AS 6.1.0
by Eric Smith
Eric Smith [https://community.jboss.org/people/esmith1] created the discussion
"Deploying Native to AS 6.1.0"
To view the discussion, visit: https://community.jboss.org/message/745054#745054
--------------------------------------------------------------
Hi - I downloaded JBoss AS 6.1.0.Final (community) and found it has the CXF stack by default. I read that AS 6.1.0 bundled the Native JBossWS stack 3.4.1.GA and I can see the common/lib/jbossws-native-core.jar. I don't know how to 'enable' and force Native for all web services and/or 'disable' CXF. I thought perhaps this would be an xml config chg but can't find a doc saying that.
So I downloaded the JBossws Native 3.4.1.GA zip, and I modified the ant.properties but I used 610 as the version, and it didn't like me.
Any advice on replacing CXF with NATIVE in JBoss 6.1 would be appreciated. Also please let me know if I am looking for the wrong thing and perhaps I should be specifying NATIVE stack somehow in my WAR?
BUILD FAILED
Target "deploy-jboss610" does not exist in the project "JBossWS-Native".
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/745054#745054]
Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[jBPM] - Exception retrieving task
by jnorris
jnorris [https://community.jboss.org/people/jnorris] created the discussion
"Exception retrieving task"
To view the discussion, visit: https://community.jboss.org/message/744057#744057
--------------------------------------------------------------
Hi All,
I'm getting the exception shown below when trying to get a task using the Mina server in the demo task server included with the installer. I've deployed and started a process definition that has a single human task in it. A row is inserted into the TASK table in the Oracle 11g DB. Other task tables with data are CONTENT (1 row), I18NText (2 rows), PEOPLEASSIGNMENTS_BAS (1 row - 'Administrator') and PEOPLEASSIGNMENTS_POTOWNERS (1 row - 'john'). One item of interest is that the column TASKINITIATOR_ID for the task is null. User 'john' started the process and is the single ActorId in the process defintion. Both the CREATEDBY_ID and ACTUALOWNER_ID columns for the task row are set to 'john'.
Client code:
String name = "ksclient-" + UUID.randomUUID();
TaskClient client = new TaskClient( new MinaTaskClientConnector( name, new MinaTaskClientHandler( SystemEventListenerFactory.getSystemEventListener())));
client.connect( "127.0.0.1", 9123 );
Task jbpmTask = this.getTask( id.longValue() );
utility method used in multiple places:
public Task getTask( long taskId, TaskClient client )
{
BlockingGetTaskResponseHandler responseHandler = new BlockingGetTaskResponseHandler();
client.getTask( taskId, responseHandler );
responseHandler.waitTillDone( 1000 );
return responseHandler.getTask();
}
Any help in resolving this would be appreciated.
Jim
Here's the exception:
[java] Task service started correctly!
[java] Task service running ...
[java] Hibernate: select task0_.id as id11_3_, task0_.archived as archived11_3_, task0_.allowedToDelegate as allowedT3_11_3_, task0_.taskInitiator_id as taskIni27_11_3_, task0_.priority as priori
ty11_3_, task0_.activationTime as activati5_11_3_, task0_.actualOwner_id as actualO28_11_3_, task0_.createdBy_id as createdBy29_11_3_, task0_.createdOn as createdOn11_3_, task0_.documentAccessType as
document7_11_3_, task0_.documentContentId as document8_11_3_, task0_.documentType as document9_11_3_, task0_.expirationTime as expirat10_11_3_, task0_.faultAccessType as faultAc11_11_3_, task0_.faultC
ontentId as faultCo12_11_3_, task0_.faultName as faultName11_3_, task0_.faultType as faultType11_3_, task0_.outputAccessType as outputA15_11_3_, task0_.outputContentId as outputC16_11_3_, task0_.outpu
tType as outputType11_3_, task0_.parentId as parentId11_3_, task0_.previousStatus as previou19_11_3_, task0_.processId as processId11_3_, task0_.processInstanceId as process21_11_3_, task0_.processSes
sionId as process22_11_3_, task0_.skipable as skipable11_3_, task0_.status as status11_3_, task0_.workItemId as workItemId11_3_, task0_.OPTLOCK as OPTLOCK11_3_, user1_.id as id6_0_, user2_.id as id6_1
_, user3_.id as id6_2_ from Task task0_ left outer join OrganizationalEntity user1_ on task0_.taskInitiator_id=user1_.id left outer join OrganizationalEntity user2_ on task0_.actualOwner_id=user2_.id
left outer join OrganizationalEntity user3_ on task0_.createdBy_id=user3_.id where task0_.id=?
[java] org.apache.mina.filter.codec.ProtocolEncoderException: java.lang.NullPointerException
[java] at org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilter.java:355)
[java] at org.apache.mina.core.filterchain.DefaultIoFilterChain.callPreviousFilterWrite(DefaultIoFilterChain.java:509)
[java] at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1400(DefaultIoFilterChain.java:46)
[java] at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.filterWrite(DefaultIoFilterChain.java:808)
[java] at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.filterWrite(DefaultIoFilterChain.java:734)
[java] at org.apache.Hibernate: select names0_.Task_Names_Id as Task5_1_, names0_.id as id1_, names0_.id as id7_0_, names0_.language as language7_0_,mina.core.filterchain.DefaultIoFilterChain
.callPreviousFilterWrite(DefaultIoFilterChain.java:509)
[java] at org.apache.mina.core.filt names0_.text as text7_0_ from I18NText names0_ where names0_.Task_Names_Id=?
[java] Hibernate: select subjects0_.Task_Subjects_Id as erchain.DefaultIoFilterChain.fireFilterWrite(DefaultIoFilterChain.java:501)
[java] at org.apache.mina.core.session.AbstractIoSession.Task4_1_, subjects0_.id as id1_, subjects0_.id as id7_0_, subjects0_.language as language7_0_, subjects0_.text as text7_0_ from write(
AbstractIoSession.java:490)
[java] at org.apache.mina.core.session.AbstractIoSession.write(AbstractIoSession.java:435)
[java] at orgI18NText subjects0_ where subjects0_.Task_Subjects_Id=?
[java] .jbpm.task.service.mina.MinaSessionWriter.write(MinaSessionWriter.java:31)
[java] at org.jbpm.task.service.TaskServerHandler.messageReceived(TaskServerHandler.java:134)
[java] at org.jbpm.task.service.mina.MinaTaskServerHandler.messageReceived(MinaTaskServerHandler.java:41)
[java] at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:716)
[java] at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
[java] at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)
[java] at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)
[java] at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:427)
[java] at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:245)
[java] at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
[java] at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)
[java] at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)
[java] at org.apache.mina.filter.logging.LoggingFilter.messageReceived(LoggingFilter.java:177)
[java] at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
[java] at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:46)
[java] at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:796)
[java] at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:119)
[java] at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:434)
[java] at org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:426)
[java] at org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:692)
[java] at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:645)
[java] at org.apache.mina.core.polling.AbstractPollingIoProcessor.process(AbstractPollingIoProcessor.java:634)
[java] at org.apache.mina.core.polling.AbstractPollingIoProcessor.access$400(AbstractPollingIoProcessor.java:66)
[java] at org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.run(AbstractPollingIoProcessor.java:1078)
[java] at org.apache.mina.util.NamePreservingRunnable.run(NamePreservingRunnable.java:64)
[java] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
[java] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
[java] at java.lang.Thread.run(Thread.java:662)
[java] Caused by: java.lang.NullPointerException
[java] at java.io.ObjectOutputStream$BlockDataOutputStream.getUTFLength(ObjectOutputStream.java:2106)
[java] at java.io.ObjectOutputStream$BlockDataOutputStream.writeUTF(ObjectOutputStream.java:1977)
[java] at java.io.ObjectOutputStream.writeUTF(ObjectOutputStream.java:849)
[java] at org.jbpm.task.I18NText.writeExternal(I18NText.java:53)
[java] at org.jbpm.task.utils.CollectionUtils.writeI18NTextList(CollectionUtils.java:235)
[java] at org.jbpm.task.Task.writeExternal(Task.java:92)
[java] at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1429)
[java] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1398)
[java] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
[java] at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1346)
[java] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1154)
[java] at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
[java] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
[java] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
[java] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
[java] at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1518)
[java] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1483)
[java] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1400)
[java] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1158)
[java] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:330)
[java] at org.apache.mina.core.buffer.AbstractIoBuffer.putObject(AbstractIoBuffer.java:2011)
[java] at org.apache.mina.filter.codec.serialization.ObjectSerializationEncoder.encode(ObjectSerializationEncoder.java:80)
[java] at org.apache.mina.filter.codec.ProtocolCodecFilter.filterWrite(ProtocolCodecFilter.java:322)
[java] ... 36 more
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/744057#744057]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[jBPM] - Re: jbpm 3 and getVariable : application slowness
by vchmakov
vchmakov [https://community.jboss.org/people/vchmakov] created the discussion
"Re: jbpm 3 and getVariable : application slowness"
To view the discussion, visit: https://community.jboss.org/message/745128#745128
--------------------------------------------------------------
Hi,
Well, first of all you are asking jBPM 3 question. As to my knowledge jBPM 3 has been transformed into Activiti and moved out. jBPM 5 is a completely new product and is rooting from the Drools. I can be wrong on this, so forgive me if I am.
Secondly, your question mostly relates to how Hibernate works/performs. Our company currently working with jBPM 5.2 and we had problems with some SQLs containing in orm.xml files coming with jBPM. The SQL’s are less then optimal and Firebird DB is dying executing them. But it is not jBPM but Hibernate (and perhaps Firebird). Our approach was to not using “bad” SQLs but write our own optimized SQLs and execute them via Hibernate’s Native Query mechanisms.
As to jBPM 5 performance - we do not have any complains so far.
Hope this helps.
Thanks,
Vladimir
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/745128#745128]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[jBPM] - Null cmdScopedEntityManager during stateful session load
by Bira Neto
Bira Neto [https://community.jboss.org/people/biraneto] created the discussion
"Null cmdScopedEntityManager during stateful session load"
To view the discussion, visit: https://community.jboss.org/message/744900#744900
--------------------------------------------------------------
I am getting a nullpointerexception during ksession load due to a null cmdScopedEntityManager (from JpaPersistenceContextManager).
First I created a conditional event and executed a instance of this workflow (which results in an active workflow waiting for a condition)
After restarting my server, the session load will fire (or try to fire) an ActivationCreatedEventImpl for my pending rule (named after my process.... RuleFlowStateNode-conditionalTest_2_0-7)
The problem though.... is that when calling getProcessInstancesWaitingForEvent it will try to call a getProcessPersistenceContext() implementation which tries to return a new JpaProcessPersistenceContext( cmdScopedEntityManager );
This cmdScopedEntityManager was not initialized yet though. It seems to be lazy initialized during beginCommandScopedEntityManager (from JpaPersistenceContextManager).
Is that a bug or is there some way or something else I need to add to my environment to use this properly?
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/744900#744900]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[JBoss Web Services] - Trying to resolve systemId as a non-file URL JBoss 5.1
by getstarted
getstarted [https://community.jboss.org/people/getstarted] created the discussion
"Trying to resolve systemId as a non-file URL JBoss 5.1"
To view the discussion, visit: https://community.jboss.org/message/745125#745125
--------------------------------------------------------------
08:30:55,530 INFO [ServerCache] **LOCAL** Class loaders url's synched up
08:30:56,273 WARN [JBossEntityResolver] Trying to resolve systemId as a non-file URL: http://host:port/client-ws/services/ http://host:port/client-ws/services/{port}?xsd=1
08:30:57,856 WARN [JBossEntityResolver] Trying to resolve systemId as a non-file URL: http://host:port/client-ws/services/ http://host:port/client-ws/services/{port}?xsd=24
08:31:04,614 INFO [ServerImpl] Runtime shutdown hook called, forceHalt: true
08:31:04,968 WARN [JBossEntityResolver] Trying to resolve systemId as a non-file URL: http://host:port/client-ws/services/ http://host:port/client-ws/services/{port}?xsd=25
08:31:05,327 WARN [JBossEntityResolver] Trying to resolve systemId as a non-file URL: http://host:port/client-ws/services/ http://host:port/client-ws/services/{port}?xsd=2
08:31:05,456 WARN [JBossEntityResolver] Trying to resolve systemId as a non-file URL: http://host:port/client-ws/services/ http://host:port/client-ws/services/{port}?xsd=3
Hello, I wrote a Web service client for our vendor's web service. It is working fine with Soap UI and stand-alone Java application. But after i deployed to JBoss, I am having the above error. I am getting this while instatiating the service. After having several of the above messages, I am getting the "Cannot load Java type error. Again the same code work fine as a stand-alone program from Main method.
I am using JBoss 5.1, JDK 1.6, JAX-WS, IntelliJ IDEA as an IDE.
Should i download all xsd's and wsdl to my local drive and refer from there? If I am deploying to JBoss, how do I packages these xsds inside the jar file, and how to refer them? I have the code similar to this
Generated code by JAX-ws:
super(WSDL_LOCATION, new QName(" http:// http://{URL}", "{operation}")); //error is getting here
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/745125#745125]
Start a new discussion in JBoss Web Services at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[jBPM] - Error in ant start.human.task
by Tejas B
Tejas B [https://community.jboss.org/people/tejasb] created the discussion
"Error in ant start.human.task"
To view the discussion, visit: https://community.jboss.org/message/745120#745120
--------------------------------------------------------------
Hi,
I am trying to set up JBPM and during the initial setup when I invoke
ant start.human.task
I get the following error.
C:\T\jbpm-installer>ant start.human.task
Buildfile: C:\T\jbpm-installer\build.xml
start.human.task:
[javac] C:\T\jbpm-installer\build.xml:844: warning: 'includeantruntime' was
not set, defaulting to build.sysclasspath=last; set to false for repeatable buil
ds
[javac] Compiling 1 source file to C:\T\jbpm-installer\task-service\target
[javac] C:\T\jbpm-installer\task-service\src\org\jbpm\DemoTaskService.java:3
4: error: method eval in class TaskService cannot be applied to given types;
[javac] Map<String, User> users = ( Map<String, User> ) TaskServ
ice.eval( reader, vars );
[javac]
^
[javac] required: String,Map
[javac] found: Reader,Map
[javac] *reason: actual argument Reader cannot be converted to String by me*
*thod invocation conversion*
[javac] C:\T\jbpm-installer\task-service\src\org\jbpm\DemoTaskService.java:4
3: error: method eval in class TaskService cannot be applied to given types;
[javac] Map<String, Group> groups = ( Map<String, Group> ) TaskS
ervice.eval( reader, vars );
[javac]
^
[javac] required: String,Map
[javac] found: Reader,Map
[javac] reason: actual argument Reader cannot be converted to String by me
thod invocation conversion
[javac] 2 errors
BUILD FAILED
I even tried modifying the code and converted reader to String and then stored in Map. But in this case, I get an error
*error: non-static method eval(String,Map) cannot be referenced from a static*
*context*
Please suggest a solution on this as I have been struggling on this for a while.
Regards,
Tejas
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/745120#745120]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months
[jBPM] - jbpm 3 and getVariable : application slowness
by Ender Wiggin
Ender Wiggin [https://community.jboss.org/people/enderwiggin30] created the discussion
"jbpm 3 and getVariable : application slowness"
To view the discussion, visit: https://community.jboss.org/message/728360#728360
--------------------------------------------------------------
We have a small app which uses jbpm v3. One of the things in the app is to list the tasks a user is assigned to. The task details such as client name, address are stored in variable called client. When the home page is being rendered, for each task, the client is read from database and task is displayed with a proper description. The problem is for 50 tasks the user has, getting the client object means hitting the database once which slows the app. It literally takes 30 seconds for some users... When I look at hibernate layer queries, I see a bunch of select statements for each task to get the client object.
Is there a way to speed up the jbpm so that variables are loaded more efficiently or in batch ? Doing it per task instance is simply not acceptable performance wise. Thanks.
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/728360#728360]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years, 5 months